• 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: Build Phase per Configuration
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Build Phase per Configuration


  • Subject: Re: Build Phase per Configuration
  • From: Chris Hanson <email@hidden>
  • Date: Tue, 13 Nov 2007 17:06:53 -0800

On Nov 13, 2007, at 3:13 PM, David Dunham wrote:

if [ $(CONFIGURATION) -eq "Release" ] then
	echo "Signing code"
	codesign -v -s ###
fi

Bourne shell syntax is funky. This should be:

if [ "${CONFIGURATION}" = "Release" ]; then
   echo "Signing code"
   codesign -v -s ###
fi

Xcode will pass all build settings to your script build phase as environment variables, so you need to use environment syntax to check them. (Chris E. used Make/Xcode syntax, a common mistake.) The semicolon between the close-bracket and "then" is necessary as well, since technically it's another statement or something.

If you're more comfortable with another scripting language like Ruby or Python, you can just use it instead, by putting the path to its interpreter in place of /bin/sh in the script build phase's Get Info window. Xcode will cd to the project root and use the tool you specify to run your script, after setting its environment to contain all of the build settings.

 -- Chris

/usr/local/bin/scsh

(cond ((get-env "CONFIGURATION")
        (progn (echo "Signing code")
               (codesign -v -s ###)))
     (#t nil))

;;; just kidding, even I'm not crazy enough to use Olin Shivers' Scheme Shell for this...

_______________________________________________
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


  • Follow-Ups:
    • Re: Build Phase per Configuration
      • From: David Dunham <email@hidden>
References: 
 >Build Phase per Configuration (From: David Dunham <email@hidden>)
 >Re: Build Phase per Configuration (From: Chris Espinosa <email@hidden>)
 >Re: Build Phase per Configuration (From: David Dunham <email@hidden>)

  • Prev by Date: Re: Can't build RubyCocoa examples with xcode 3
  • Next by Date: Re: Build Phase per Configuration
  • Previous by thread: Re: Build Phase per Configuration
  • Next by thread: Re: Build Phase per Configuration
  • Index(es):
    • Date
    • Thread