< Zurück | Inhalt | Weiter >

9.3.2 Installing a Source Tarball

We do not encourage you to install ant from source, although we do encourage you to download and study the ant source. It is an excellent sample Java application.

If you must build from source, the start of the process is the same as above. You download the tarball, verify it with GPG or md5sum, then unzip and untar it.


It begins to differ at this point. The ant source package comes with a shell script, build.sh, that actually builds a minimal version of ant and then runs ant to complete the install.

Make sure that the JAVA_HOME and ANT_HOME are set as you want them, then execute build.sh install. Unless you have installed the optional tasks,5 you will see several warnings about missing classes. You may safely ignore these.

As with the installation of other packages built from source, you will need to have appropriate permissions for the target directories. This might mean running the install as root, with all appropriate attention and dread.


9.4 A SAMPLE ANT BUILDFILE


Let’s go over the basics of creating an Ant buildfile. We’ll start with an intro- duction to XML, and then move on to the specific tags Ant supports and how you might use them to automate a build.