Before the build
Back in Chapter 3, Application Structure, we touched on the build.xml
file that Sencha Cmd generates as part of an application template. Now, we'll take a closer look to see how we can use this file to hook into the build process and leverage it for our own purposes.
We've already mentioned that Sencha Cmd uses Ant, an XML-based build system at its core. A key concept of Ant is that of "targets", a term that describes a bundle of tasks that perform a part of the build process from the Ant manual:
"A target is a container of tasks that cooperate to reach a desired state during the build process."
In our case, Sencha Cmd comes with a set of pre-existing targets that we can use to hook into various parts of the build process. The build.xml
file contains stubs for these targets as well as some comments on what they do. We're going to hook into one of these and implement a task that will halt the build process if certain conditions are not met.
When we discussed the role of the architect...