Ant - Task


A task is a function and belongs to a target

The task operates only on the parameters it is given. Tasks can consume and emit items and properties. By design, they have no other insight into the state of the build. They should not discover files on disk - this makes them opaque and less reuseable.

Some tasks will generate build failures if they are used outside of targets as they may cause infinite loops otherwise (<antcall> for example).


Tasks have a common structure:

<taskname id="taskID" attribute1="value1" attribute2="value2" ... />


  • taskname is the name of the task,
  • taskID is a unique identifier that you use to refer to this task in scripts or other tasks.
  • attributeN is the attribute name, and valueN is the value for this attribute.



Ant supports a number of optional tasks. An optional task is a task which typically requires an external library to function.



Powered by ComboStrap