ANT Targets and Tasks
17 February 2008In this post, I will talk about ANT targets and tasks.
Targets
Each buildfile contains at least one target within the project. One target can be dependent upon the another target.
<target name="A"/> <target name="B" depends="A"/> <target name="C" depends="B"/> <target name="D" depends="C"/> <target name="E" depends="D,C,B,A"/>
Suppose you want to execute target E, which depends upon D, C, B and A
D depends on C
C depends on B
B depends on A
First A is executed, then B, then C, then D and in the end E
Tasks
Targets consists of tasks. It is a piece of code that can be executed. A task can have several attributes. The value of an attribute might contain references to a property. These references will be resolved before the task is executed.
Tasks have a common structure:
<name attribute1="value1" attribute2="value2" ... />
where name is the name of the task, attributeN is the attribute name, and valueN is the value for this attribute.
There are built-in tasks as well as optional tasks. You can also write your own tasks.
Related Posts:
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: ANT Targets and Tasks