To build Ant from source, you can either install the Ant source distribution or checkout the ant module from CVS.
Once you have installed the source, change into the installation directory.
Set the JAVA_HOME environment variable to the directory where the JDK is installed. See Installing Ant for examples on how to do this for your operating system.
Make sure you have downloaded any auxiliary jars required to build tasks you are interested in. These should either be available on the CLASSPATH or added to the lib directory. See Library Dependencies (section 2.5 for a list of jar requirements for various features. Note that this will make the auxiliary jars available for the building of Ant only. For running Ant you will still need to make the jars available as described under Installing Ant.
Your are now ready to build Ant:
build -Ddist.dir=<directory_to_contain_Ant_distribution> dist (Windows) build.sh -Ddist.dir=<directory_to_contain_Ant_distribution> dist (Unix)This will create a binary distribution of Ant in the directory you specified.
The above action does the following:
On most occasions you will not need to explicitly bootstrap Ant since the build scripts do that for you. If however, the build file you are using makes use of features not yet compiled into the bootstrapped Ant, you will need to manually bootstrap. Run bootstrap.bat (Windows) or bootstrap.sh (UNIX) to build a new bootstrap version of Ant.
If you wish to install the build into the current ANT_HOME directory,
you can use:
build install (Windows)
build.sh install (Unix)
You can avoid the lengthy Javadoc step, if desired, with:
build install-lite (Windows)
build.sh install-lite (Unix)
This will only install the bin and lib directories.
Both the install and install-lite targets will overwrite the current
Ant version in ANT_HOME.