Information Technology Reference
In-Depth Information
Build phases are most useful when working with multiple targets. For example, if your project has two targets,
such as an app and a framework, you typically add the framework to the app's Target Dependencies and add
the library it creates to the app's Link Binary with Libraries list as shown in Figure 13.29. Adding it to the link
list guarantees that the compiled framework is included in the finished app. Depending on the details of the tar-
get, you can choose to compile its source files with the other app files or independently as part of its own target
build sequence.
FIGURE 13.29
Exploring build phases
Getting started with scripts and macros
You can use the Run Script option to add customized scripted processing or support. Scripts can be written in
any language that works from the command line, including AppleScript, Perl, Python, Ruby, and the standard
UNIX shell, all of which are built into OS X.
Build setting macros allow you to access useful build settings in your script. The two default examples in Figure
13.30 show how to read the source and destination directories. A more complex script might loop through
every file in the source directory, or select files with a specific extension and then process them in some way. Be-
cause scripts have access to environment variables and to other processes, the potential of custom scripting is al-
most limitless. For example, you can implement or import complete source management tools and add them
here, or back up some or all of the files in your build to a remote server.
To remove a script or build phase, click the cancel icon at the top right. You can rearrange the order in which
build phases are run by dragging them up and down the list. The Target Dependencies are fixed, but every oth-
er phase can be moved.
Search WWH ::




Custom Search