Re: Xcode build rules and not-quite-compiled scripts
Re: Xcode build rules and not-quite-compiled scripts
- Subject: Re: Xcode build rules and not-quite-compiled scripts
- From: Greg Guerin <email@hidden>
- Date: Wed, 29 Sep 2010 10:05:40 -0700
Gwynne Raskind wrote:
So, my question is, what is the correct combination of build rules,
derived files, copy files phases, and voodoo to make these things
happen? Preferably without mucking around with Run Script phases,
which insist on running even when the files don't need re-processing.
I think you can do the whole process using a custom Build Rule, or at
most a couple rules and a Run Script phase.
I recently revived and revised a custom Build Rule for assembling
microcontroller code and downloading it to the device. The reference
docs I found most useful were:
http://developer.apple.com/library/mac/#documentation/DeveloperTools/
Conceptual/XcodeBuildSystem/200-Build_Phases/bs_build_phases.html
http://cocoawithlove.com/2010/02/custom-build-rules-generated-tables-
and.html
In the 1st doc, the "Build Rules" heading has all the info for making
custom build rules. The sub-heading "Creating a Build Rule Script"
has details for writing your own rules as a script.
A lot of the build, target, and configuration values are available as
env-vars, so you can choose the ones you want to use in the rule.
I started out by putting all the shell commands into the Custom
script of the custom build rule, but I eventually moved all that code
into a separate shell script file stored in a common location. I did
that because any script changes would have to be manually applied to
every project (there are several). If the script is stored in a file
like "AsmBuildRule" it makes it a lot easier to revise things. Then
the custom rule just invokes one command: the build-rule script itself.
The custom build rule should always have a symbolic output file, so
Xcode can apply rules only as needed, and not every time you build.
The 2nd URL above shows an example.
-- GG
_______________________________________________
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