Ant

Ant (http://jakarta.apache.org/ant/) is a build tool written in Java that eliminates some of the deficiencies of working with the traditional make tool. Ant is very customizable because of its inherent use of object-oriented design concepts. Ant build files are defined in XML (http://www.w3.org/XML/) format and are very easy to use. The build.xml file defines various tasks to be executed, any of which can have dependencies on other tasks. Ant is also very extensible; since each task is a Java class, you can easily write your own custom tasks and then use them in the build.xml file.

Example

Our example source code is Kurt Kirkham's Performance Lab library, which right now consists of these files: We want to compile the files, jar them up and then create JavaDocs for them. Here are the tasks (each arrow represents a dependency): tasks.gif
Here is the resulting build.xml file that is used by Ant.

Now, since the build.xml file is in the same directory as the source files, all we have to type on the command line is ant. Here are the results:

bonhamcm@orb:indyjug> ant
Buildfile: build.xml

compile:
    [javac] Compiling 2 source files to /home/bonhamcm/zip/indyjug

jar:
   [delete] DEPRECATED - Use of the implicit FileSet is deprecated.  Use a nested fileset element instead.
   [delete] Deleting 1 files from /home/bonhamcm/zip/indyjug
      [jar] Building jar: /home/bonhamcm/zip/indyjug/perflab.jar

javadocs:
  [javadoc] Generating Javadoc
  [javadoc] Javadoc execution
  [javadoc] Loading source file PerformanceLab.java...
  [javadoc] Loading source file StringTest.java...
  [javadoc] Constructing Javadoc information...
  [javadoc] Building tree for all the packages and classes...
  [javadoc] Building index for all the packages and classes...
  [javadoc] Building index for all classes...

main:

BUILD SUCCESSFUL

Total time: 41 seconds