Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode template to import file by file path

I have a Xcode template file like so:

#import "___FILEBASENAME___.h"

@implementation ___FILEBASENAMEASIDENTIFIER___
@end

This will create an example file like so:

#import "ExampleFile.h"

@implementation ExampleFile
@end

However due to some complexity in our build system, I need to import files by their file path.

For example, if I was creating ExampleFile.m inside of Path/To/ folder. Then my desired output would be:

// Desired template output
#import "Path/To/ExampleFile.h"

I tried looking through some Apple example templates, but didn't seem to find a way to make it work.

I also stumpled upon ___DIRECTORY___ referenced here, but it doesn't seem to work for me when I attempted to use it.

Does anyone know if there is a way to accomplish this?

like image 878
MrHappyAsthma Avatar asked Nov 08 '22 20:11

MrHappyAsthma


1 Answers

Try enabling "Use custom working directory" option, it will let you choose the base directory. How to enable this is answered in the following question. Xcode: How to set current working directory to a relative path for an executable?

Hope this helps

like image 192
TAS Avatar answered Nov 14 '22 22:11

TAS