ANT Targets and Tasks

17 February 2008

In 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.

del.icio.us:ANT Targets and Tasks  digg:ANT Targets and Tasks  spurl:ANT Targets and Tasks  wists:ANT Targets and Tasks  simpy:ANT Targets and Tasks  newsvine:ANT Targets and Tasks  blinklist:ANT Targets and Tasks  furl:ANT Targets and Tasks  reddit:ANT Targets and Tasks  fark:ANT Targets and Tasks  blogmarks:ANT Targets and Tasks  Y!:ANT Targets and Tasks  smarking:ANT Targets and Tasks  magnolia:ANT Targets and Tasks  segnalo:ANT Targets and Tasks  gifttagging:ANT Targets and Tasks

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

Leave a Reply