concept Ant task in category ant

This is an excerpt from Manning's book Ant in Action.
Because Ant tasks are Java classes, the overhead of invoking each task is quite small. For each task, Ant creates a Java object, configures it, then calls its execute() method. A simple task such as <mkdir> would call a Java library method to create a directory. A more complex task such as <ftp> would invoke a third-party FTP library to talk to the remote server, and, optionally, perform dependency checking to upload only files that were newer than those at the destination. A very complex task such as <javac> not only uses dependency checking to decide which files to compile, it supports multiple compiler back ends, calling Sun’s Java compiler in the same Java Virtual Machine (JVM), or executing a different compiler as an external executable.
In this chapter we’re going explore that feature creep—Ant’s task model and API. We’ll show the reader how to write and test Ant tasks. Authors of existing Ant tasks should read this chapter, because the testing mechanism and resource API is new—everyone will learn something!