Ant (Pete's notes)


Introduction to Ant

Ant is like make, but it's platform-independent. It's Java code that reads an XML file instead of a C program that reads a Makefile. Web to the Ant home page.

Get, build and install Ant

Ant can be installed via RPMs or by building the sources. The RPM method doesn't give you docs and doesn't put Ant where JDE expects to find it, so I installed the sources.
(as root)
mkdir /usr/src/jakarta
chown siemsen /usr/src/jakarta
(as siemsen)
cd /usr/src/jakarta
gunzip apache-ant-1.6.0-src.tar.gz
tar xf apache-ant-1.6.0-src.tar
rm apache-ant-1.6.0-src.tar
cd apache-ant-1.6.0
cp -R docs /usr/web/ant-doc
Documentation is now in the local web at Ant User Manual

(as siemsen)
sudo mkdir /usr/local/ant
sudo chown siemsen /usr/local/ant
cd /usr/src/jakarta/apache-ant-1.6.0
./build.sh -Ddist.dir=/usr/local/ant dist

This built several things, and generated some errors in the javadoc section that I think I can ignore. It finished with "BUILD SUCCESSFUL", so I guess it's ok.

Edit .bashrc to add

export ANT_HOME=/usr/local/ant
pathadd $ANT_HOME

Logout and log in to set the environment variables. To do a very rudimentary test, try this:

ant -version

Using Ant

See the Ant User Manual. The basic idea is to create a build.xml file and then run "ant".

To use Ant from JDE, see the JDE page.

To use JUnit from Ant, see the JUnit page.


Pete Siemsen
Last modified: Mon Feb 9 13:38:29 MST 2004