Managing Software Life Cycle with Ant
Managing Software Life Cycle with Ant
Ant is an open-source, Java-based build tool (the acronym stands for "Another Neat Tool"). Because it is extended via Java classes, and run via XML-encoded scripts, it is not bound to the OS and/or shell syntax in which it is used. The same Ant build files can run on Solaris, OS X, Windows, or Linux boxes, so that developers across platforms can maintain a common set of build scripts.
In the Streek framework, Ant is used to build, test, and deploy components and applications.
- A common set of properties, largely used to refer to standard directory structures in which Streek projects are developed, are stored in the ist-jxde tree (cf. the antlib/properties directory), which can be checked out from CVS.
- Project specific properties are stored in properties files in the project's root directory.
- In addition to tasks available in the core Ant distribution, the Ant-Contrib project's extensions to Ant are utilized in some Streek builds; the current version of ant-contrib-#.#.jar is stored in CVS in the ist-jxde project's ant/lib directory. This jar file should be added to the Ant runtime classpath (whether in Eclipse or on the command line classpath of a developer's machine) in order to run Streek builds.
- Hydrant, a project in CVS, is a collection of Ant scripts invoked to check out and deploy web applications and their dependencies (e.g., an application server). Developers can thus clearly specify, whether to each other or to server administrators, the easily invokable and accurately repeatable steps necessary to deploy their applications.
The Ant manual is available online. In it, the many tasks that can be scripted with Ant are described - from copying with filtering (i.e., token replacement) and creation of Jar archives, to compiling Java classes and running XSLT; from scripted CVS checkouts to generation of SMTP mail. The many build files in the Streek tree (build.xml and variants thereon) provide local examples to augment the script snippets in the Ant manual.
A book by Erik Hatcher and Steve Loughran, Java Development with Ant, provides an excellent introduction and overview to Ant usage in the context of J2EE development.


