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 d开发者_StackOverflowifferent 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?
Xcode Configuration Files are probably what you are looking for. They put build settings in a text file for easier management.
Also: https://stackoverflow.com/questions/tagged/xcconfig
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
精彩评论