Ant was developed in part as an improvement to previous build tools like make. At a high level, the improvements it offers include an improved command file format (using XML as the basis for its buildfiles) and the ability to extend the tool using Java code rather than shell script commands. In the past, many developers found the text format of make and its variants to be somewhat arcane and error-prone (to the point that people developed tools like imake, which provided a metalanguage for the generation of makefiles). An XML format is much more directly accessible to the average developer, the syntax rules are clearer since they are based on general XML syntax, and the plethora of XML tools can be used directly to edit Ant buildfiles.
The ability to extend the build tool using Java code is also an obvious advantage, at least to Java developers. As we’ll see later in this section, tasks in Ant are invoked using XML elements in the buildfile with a core set of tasks provided with the tool. Custom Ant tasks can also be written using Java code. This allows for more portable extensibility than earlier shell command systems, since the syntax of shell commands and their arguments tends to be platform-dependent.
Before we look at the model Ant uses for managing development tasks, let’s get familiar with the terminology of Ant.
Ant is driven from a buildfile that you write. This buildfile defines a set of project-specific targets that represent specific goals or results that you ...