On Jan 3, 2006, at 11:40 AM, Nick Nallick wrote: On Jan 3, 2006, at 11:59 AM, Chris Espinosa wrote:
I'm working on a new localization. In CodeWarrior I include the experimental localization in my debug build but not in my release build. How do I set up my Xcode project to include this localization only in the release build configuration?
Xcode generally doesn't have great facilities for different target membership per-configuration. We've added some facilities for doing such things for compilation, but not across-the board.
Your best bet is to add a Run Script Build Phase to the target that, conditionally on the value of ${CONFIGURATION}, strips the experimental localizations from the built product.
As a Mac developer for the last twenty years my shell scripting is pretty rusty. Can you point me at any examples of how to combine Xcode build settings and scripts? The Xcode documentation doesn't seem to cover this.
1) The "Command" line denotes the shell to use and any options to pass it. So you can use bash, tcsh, perl, whatever command-line interpreter you want.
2) All Xcode build settings are passed in environment variables, so the current configuration is passed in the CONFIGURATION environment variable. In bash, the syntax for referring to an environment variable is ${VARNAME}.
3) Xcode sets the environment variable SCRIPT_INPUT_FILE_COUNT to an integer representing the number of files listed in the "Input Files" list in the Run Script Build Phase inspector pane, and defines that number of environment variables SCRIPT_INPUT_FILE_0 through SCRIPT_INPUT_FILE_(count-1) with the full path to each file listed. Same goes for SCRIPT_OUTPUT_FILE_COUNT and SCRIPT_OUTPUT_FILE_<n>.
bash scripting is a little, well, opaque, but here's a sample loop that iterates over the input files and executes a simple 'ls' command on each one:
for INFILE in ${!SCRIPT_INPUT_FILE_*}; do I=${!INFILE}; if [[ -e "$I" ]]; then ls -l "$I"; fi done
Chris |