We’ve already used a few of the core tasks included with
Ant in our earlier examples. Our compile target uses the
javac task, which invokes the Java compiler,
archive target uses the
jar task, which creates a jar
archive from a set of files. In addition to these Java-specific tasks,
we’ve also seen some general-purpose tasks, like the
mkdir task that creates a directory and the
delete task for deleting files and
Many, many other tasks bundled with the Ant distribution can be combined in a virtually infinite set of combinations to do what you need to do in your development process. We don’t intend to document all of them here—again, for complete coverage of the core Ant tasks, go to the Ant project site (http://ant.apache.org) and pick up Ant: The Definitive Guide (O’Reilly). In the following sections, we briefly discuss some general functional areas that are encountered in nearly every development project and some of the common ways that Ant supports these needs with its core tasks. These tasks are the workhorse tasks in Ant that you’ll find yourself using over and over again.
At the heart of any software development effort is the need to do things to files and directories. Files need to be moved or copied from one place to another, directories need to be created or deleted, sets of files need to be pulled together into archives in various formats. Naturally, Ant provides numerous built-in tasks that support these needs. ...