views:

27

answers:

2

We're transitioning to an automated build process for our iphone projects. These projects can be checked out by individual devs, in which case all the API URLs need to point to a certain path. There are also a variety of build environments, each with their own API root paths.

I could probably add multiple, different build targets, and have each of them include a different URLs definition file, but this seems like a lot of upkeep and a bit overkill.

Any best practices out there for swapping a few environmental variables for different build environments without much fuss?

+1  A: 

Xcode Configuration Files are probably what you are looking for. They put build settings in a text file for easier management.

Also: http://stackoverflow.com/questions/tagged/xcconfig

drawnonward
Close. That's useful for setting actual build settings, but I'm looking for methods that can inject different URLs into my project. From what I can tell, config files aren't really intended for that purpose.
DougW
+1  A: 

In Project tree > Targets > high light a target > Cmd-I > in Build tab ...

scroll to "GCC 4.2 - Precessing" > Preprocessor macros

just add as much as needed, e.g.

  TARGET=8
ohho