Re: Run Script Build Phase and Copy Files Build Phase
Re: Run Script Build Phase and Copy Files Build Phase
- Subject: Re: Run Script Build Phase and Copy Files Build Phase
- From: Philip Aker <email@hidden>
- Date: Thu, 08 May 2008 04:53:00 -0700
On 08-05-07, at 22:02, Duane Murphy wrote:
I'm trying to work out the best way to have a Run Script build phase
generate a file that needs to be used by a Copy Files build phase.
The Run Script build phase will process some files into a new file.
This new file is to be added to the Resources folder of the built
project (a framework). What is the best way to make that happen?
I can write the script to assemble the required file, but where
should it be put so that the file can be used for the Copy Files
build phase?
And with a little more challenge, how do I handle different build
configurations? That is a different file is generated for the Debug
build than for the Release build. How do I generate a different file
for each build and have the right file get added to the Resources
folder at the end?
It seems like this is an intermediate file (aka like an object
file), but how does the intermediate file get added to the Copy
Files build phase?
What I do is create a separate target (say "Prepare") and place the
Run Script in it. Then make the Prepare target a dependency of your
main target. So at first build the Prepare target to create the file.
Then add that file to your main target and run the main target. Note
that it's good to 'touch' your output file at the end of the Prepare
script and, depending on what mood Xcode is in, also remove the output
file from the Resources folder of your main target's built project
framework so the output file destination is updated correctly.
There are other avenues available as well - like creating a custom
build rule: <file:///Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.DeveloperTools.docset/Contents/Resources/Documents/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/05_03_bs_build_phases/chapter_32_section_10.html
>.
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
Sent from my SE/30
_______________________________________________
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