views:

48

answers:

0

I am currently working on a way to automate the process of adding new targets to my XCode projects. One target has to be added to multiple XCode projects and each target in the different project needs the same source files to be added, same groups to store the source files in the XCode project, and the same build settings. Doing this manually can take a while and is very prone to human error, and I have to do this task fairly often. I have already written a script to generate new source files, copy them to system folders, edit source files with new information etc, but now I need to automate the XCode part.

This sums up what I want my automation to achieve:

Open an XCode project at /this/path/project.xcodeproj

Duplicate an existing target and rename it

Edit the Build Settings of the new target

Add a group to the Source and Resources section, then rename them

Add source files to the groups, and add the file to the new Target

Close XCode

Ideally I want this to run from my Bourne Shell script, I know you can launch automator workflows from there. I'm not sure what the best approach is to achieving this though, any ideas? Thanks in advance :-)