• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Localization and Build Configurations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Localization and Build Configurations


  • Subject: Re: Localization and Build Configurations
  • From: Chris Espinosa <email@hidden>
  • Date: Tue, 3 Jan 2006 16:11:31 -0800

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.


Other than basic shell scripting (for which there are plenty of decent tutorials in the Unix world, such as http://www.tldp.org/LDP/abs/html/part1.html), Xcode's Run Script build phase is pretty straightforward:

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
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Localization and Build Configurations (From: Nick Nallick <email@hidden>)
 >Re: Localization and Build Configurations (From: Chris Espinosa <email@hidden>)
 >Re: Localization and Build Configurations (From: Nick Nallick <email@hidden>)

  • Prev by Date: Re: iCode development tool
  • Next by Date: Ordering of function pointers in mod_init_funcs
  • Previous by thread: Re: Localization and Build Configurations
  • Next by thread: Re: Localization and Build Configurations
  • Index(es):
    • Date
    • Thread