Life Cycle of a Task

Every Ant task passes through four distinct phases: creation, initialization, execution, and destruction. To gain an understanding of how Ant moves a task through these phases, let’s begin by examining a typical build process.

The main entry point into Ant is the class org.apache.tools.ant.Main. It’s responsible for the initial configuration of the class org.apache.tools.ant.Project. First, it uses information found on the command line to preset any properties before it moves on to create a Project. Once created, the Project under goes a standard initialization process that, among other things, defines Ant data types and tasks. A ProjectHelper is used to fill out the project with the configurations found in the build file. ...

Get Ant Developer’s Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.