Apache ANT
A platform independent build tool for
Java programs.
http://ant.apache.org/
Winter 2005 Jason Prideaux 1
ANT – A build tool for Java
ANT is similar to make, gnumake, etc.
It is designed for and written in Java.
Thus, it is a platform independent.
It is the de facto standard for open source
Java projects.
Ideal for large, complex software projects.
Winter 2005 Jason Prideaux 2
ANT – A build tool for Java
Build files are written in standard XML as
opposed to a specialty language.
One build file can be used to set classpath,
compile and run your program, generate
javadocs, create jars, perform CVS
commands, and much more.
Winter 2005 Jason Prideaux 3
ANT – Build files
ANT build files contain the following XML
tags:
Project – The name and location of your
software program/project.
Properties – Global variables.
Targets – Tasks/commands that ANT can
perform.
Spring 2005 Jason Prideaux 4
ANT – Example build file
You start by declaring your project in the
xml build file.
Build file for simplechat. (optional)
…
Winter 2005 Jason Prideaux 5
ANT – Example build file
Next, add properties to the XML file, such
as classpath, code directories, compile
destinations, etc.
…
…
Winter 2005 Jason Prideaux 6
ANT – Example build file
Lastly, add targets to the XML file, which
can correspond to commands like javac,
java, cvs, etc.
Winter 2005 Jason Prideaux 7
References
Instructions for setting up and running ANT are
online at: cis410sm/lecture-slides/ant.html
More information on ANT:
http://ant.apache.org/
Winter 2005 Jason Prideaux 8