|
|
@@ -90,18 +90,25 @@ should react to. For example:</p> |
|
|
|
<pre><target name="build-module-A" if="module-A-present"/></pre> |
|
|
|
<pre><target name="build-own-fake-module-A" unless="module-A-present"/></pre> |
|
|
|
</blockquote> |
|
|
|
<p>In the first example, if the <code>module-A-present</code> |
|
|
|
property is set (to any value), the target will be run. In the second |
|
|
|
example, if the <code>module-A-present</code> property is set |
|
|
|
(again, to any value), the target will not be run. |
|
|
|
</p> |
|
|
|
<p>If no <code>if</code> and no <code>unless</code> attribute is present, |
|
|
|
the target will always be executed.</p> |
|
|
|
<p>The optional <code>description</code> attribute can be used to provide a one-line description of this target, which is printed by the |
|
|
|
<nobr><code>-projecthelp</code></nobr> command-line option. Targets |
|
|
|
without such a description are deemed internal and will not be listed. |
|
|
|
without such a description are deemed internal and will not be listed, |
|
|
|
unless either the <nobr><code>-verbose</code></nobr> or |
|
|
|
<nobr><code>-debug</code></nobr> option is used. |
|
|
|
</p> |
|
|
|
<p>It is a good practice to place your <a |
|
|
|
href="CoreTasks/tstamp.html">tstamp</a> tasks in a so-called |
|
|
|
<i>initialization</i> target, on which |
|
|
|
all other targets depend. Make sure that target is always the first one in |
|
|
|
the depends list of the other targets. In this manual, most initialization targets |
|
|
|
have the name "init".</p> |
|
|
|
have the name <code>"init"</code>.</p> |
|
|
|
<p>A target has the following attributes:</p> |
|
|
|
<table border="1" cellpadding="2" cellspacing="0"> |
|
|
|
<tr> |
|
|
@@ -138,17 +145,20 @@ have the name "init".</p> |
|
|
|
<td align="center" valign="top">No</td> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
</p> |
|
|
|
|
|
|
|
A target name can be any alphanumeric string valid in the encoding of the XML |
|
|
|
file. The empty string "" is in this set, as is comma "," and space " ". |
|
|
|
Please avoid using these as they will not be supported in future ant versions |
|
|
|
because of all the confusion they cause. IDEs support of unusual target names |
|
|
|
-or any target name containing spaces, varies with the IDE. |
|
|
|
file. The empty string "" is in this set, as is |
|
|
|
comma "," and space " ". |
|
|
|
Please avoid using these, as they will not be supported in future Ant versions |
|
|
|
because of all the confusion they cause. IDE support of unusual target names, |
|
|
|
or any target name containing spaces, varies with the IDE. |
|
|
|
|
|
|
|
<p> |
|
|
|
|
|
|
|
Targets beginning with a hyphen such as "-restart" are valid, and can be used |
|
|
|
to name targets which must not be called directly from the command like. |
|
|
|
Targets beginning with a hyphen such as <code>"-restart"</code> |
|
|
|
are valid, and can be used |
|
|
|
to name targets that should not be called directly from the command line. |
|
|
|
|
|
|
|
<h3><a name="tasks">Tasks</a></h3> |
|
|
|
<p>A task is a piece of code that can be executed.</p> |
|
|
@@ -189,7 +199,7 @@ to set the <code>foo</code> attribute of this particular task instance. |
|
|
|
In another task (written in Java), you can access the instance via |
|
|
|
<code>project.getReference("task1")</code>. |
|
|
|
<p> |
|
|
|
Note<sup>1</sup>: If "task1" has not been run yet, then |
|
|
|
Note<sup>1</sup>: If "task1" has not been run yet, then |
|
|
|
it has not been configured (ie., no attributes have been set), and if it is |
|
|
|
going to be configured later, anything you've done to the instance may |
|
|
|
be overwritten. |
|
|
|