Re: Post-action Script Syntax. Was: Finding the Xcode 4 "Build Products Path"
Re: Post-action Script Syntax. Was: Finding the Xcode 4 "Build Products Path"
- Subject: Re: Post-action Script Syntax. Was: Finding the Xcode 4 "Build Products Path"
- From: Marco S Hyman <email@hidden>
- Date: Tue, 16 Oct 2012 10:46:57 -0700
>> ${CP} -pR "$ARCHIVE_PRODUCTS_PATH/$INSTALL_PATH/$WRAPPER_NAME" ~/Desktop
>
> Back to Marco's Post-action script. Apparently, Marco is invoking the unix "cp" program, but he capitalizes the command, encloses it in curly brackets, and prepends a $.
CP is an environment variable set by Xcode. It contains the full path to
the cp command. ${CP} is just another way of writing $CP. The sh(1) man page says:
${parameter}
The value of parameter is substituted. The braces are required
when parameter is a positional parameter with more than one
digit, or when parameter is followed by a character which is not
to be interpreted as part of its name.
In this instance the {} are not needed, but they don't hurt. I tend to use them
from habit.
> What does that do, or even better, where is the Xcode documentation which explains how to write Post-action shell scripts like that?
I forget where I found the environment values listed. Probably the Xcode build
settings guide. See
https://developer.apple.com/library/mac/#documentation/opensource/Conceptual/ShellScripting/shell_scripts/shell_scripts.html
for info about writing shell scripts. There is nothing magic about a post-action
shell script.
_______________________________________________
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