tags:

views:

85

answers:

2

In XCode, is there a way to specify that all files in a folder are compiled by a target. Eg. the 'Test' target automatically compiles all files in the 'Tests' folder, whereas the 'App' target compiles everything in the 'Sources' folder. Today, the way I'm doing it, is to add a file to a target everytime I create it. This feels a bit error prone and redundant since the files are already organized in the correct folders.

Thanks.

A: 

Yes - just select all the files in the folder and use the inspector window (targets tab).

Paul R
But with this, every time a new file is created, the target will need to be specified. What would be nice is, if there was a way of auto setting this target based on the folder in which the file is in. Then, there would be no need to assign targets to files everytime, since they would be in the correct folder. eg. Test, App example from above.
Akshay
@Akshay: I see what you're saying - yes, that might save a little time. You can use the Apple Bug Reporter to make feature requests such as this.
Paul R
just found this from googling - there HAS to be a way to do this, i bet. looking to do the same thing.
taber
You might try asking on Apple's Xcode mailing list: "Xcode Users" <[email protected]>
Paul R
A: 

Xcode is extensible using shell scripts. You can set the shell script to run at build time so you can basically make xcode do anything you want. You're only limited by your shell scripting abilities and I'm sure you can find help for that too.

regulus6633
How exactly would that look like? Of course it should not recompile all files all the time, etc.
Albert