I've created a new target for unit tests in Xcode 4.2, and obviously i need to bring in certain application files into that target. But there is a lot, and it seems cumbersome to click each .m file then click TargetMembership and tick the new target box.
Is there an easier way to do this in Xcode that i'm missing?
Thanks
I include them in the project by right-clicking on the project folder in the project view in Xcode, and selecting "Add Files to ...". I then navigate to the folder containing the source files, click on the folder and select "Add." With the options "Create folder references" and "Add to target [target name]".
Go to project's settings in the Project Navigator panel. Under the Targets sections, right click the existing target and select Duplicate to copy your existing target.
An project is a repository for all the files, resources, and information required to build one or more software products. A target specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace.
I though't i'd return to this with an improved answer. It's still difficult to do this via Xcode main interface, as if you filter for .m and try and do CMD-A to select all, it selects the folders too, so you can't add these to the target.
However, if you go to Project Settings > Build Phases > Compile Sources. You can click the + button, filter .m files, and you can CMD-A to select all here.
This works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With