Re: Setting the deployment location
Re: Setting the deployment location
- Subject: Re: Setting the deployment location
- From: Heath Raftery (local) <email@hidden>
- Date: Tue, 20 Jan 2004 18:29:26 +1100
On 17/01/2004, at 8:58 PM, Markus Ruggiero wrote:
Hi list,
When I do a deployment build of a simple Cocoa app I want the
resulting app to go to ~/Applications. Specifying a build location is
fine but Xcode puts the stuff into /tmp.... How can I override this? I
know it may not make sense to build into the install location but in
my case I want to do this. I was able to do it in project Builder but
I cannot find a way in Xcode (sometimes I simply get lost in the user
interface of Xcode...)
Yeah, not real intuitive, is it? After struggling with this with
Project Builder for a year, I set about figuring out how it works in
Xcode. Deep in some documentation somewhere, I found that if you set
the deployment location, it does indeed place the result based in /tmp,
because it thinks that the deployment location probably isn't a good
place to build an application. Maybe that's fair enough in most
situations, but when I was building a preference pane for System
Preferences, I really needed the result to go in a
/Library/PreferencePanes for it to do anything.
Here's what I do:
In build settings for the target
- check "Deployment Location"
- check "Deployment Post-processing"
- fill in Installation Path (eg. "/Applications")
Add a Build Phase to the target
- ctrl-click the target in the xcode project browser
- in the pop-up menu, navigate to Add->New Build Phase->New Shell
Script Build Phase
- in the shell script info window that appears, leave the shell as
/bin/sh and add these lines to the script
rm -R "$INSTALL_PATH/$FULL_PRODUCT_NAME"
mv "$INSTALL_DIR/$FULL_PRODUCT_NAME" "$INSTALL_PATH/"
Check the box about only running the script during a deployment build.
I discovered these environment variables by watching the build progress
carefully and experimenting. I also have a copy files phase and a
couple of other complications, but the result is a very smooth build
process. As far as I can see, a shell script is the recommended way to
deploy like this, but there is no example of the script that might do
it. My script seems to work.
Hope that helps,
Heath
--
___________________________________________________
| Heath Raftery |
| email@hidden |
| *Quotation is a serviceable substitute for wit* |
| _\|/_ |
|________________________________m(. .)m____________|
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.