views:

27

answers:

1

I have two targets in my iPhone application: one for my actual app, and another for my unit testing. I added a run script to my main application's target so that when I compile, the script will generate Doxygen documentation. The problem is that the script runs when I am compiling and running my unit testing target. Is there a way to make xcode execute my script only when compiling/running my main application's target, and not my unit testing target?

+1  A: 

Your build script phase has access to the full set of environment from build to build. Make sure you check "Show Environment Variables in build Log" in your run script inspector in XCode so that you can see the change in env variables as they hit your script.

That way you can use the shell to ignore the doxygen calls on things like

${TARGET_NAME}
${CONFIGURATION}

etc.

Your log will also show you what's going on because your run-scripts should be target dependent, but if your unit-tests have a build dependency, you can filter through the method mentioned above.

Good luck!

Andrei Freeman