|
|
@@ -69,8 +69,8 @@ project's <var>default</var> is used.</p> |
|
|
|
|
|
|
|
<h3 id="targets">Targets</h3> |
|
|
|
<p>A target can depend on other targets. You might have a target for compiling, for example, and a target for creating a |
|
|
|
distributable. You can only build a distributable when you have compiled first, so the distribute target |
|
|
|
<em>depends on</em> the compile target. Ant resolves these dependencies.</p> |
|
|
|
distributable. You can only build a distributable when you have compiled first, so the <q>distribute</q> |
|
|
|
target <em>depends on</em> the <q>compile</q> target. Ant resolves these dependencies.</p> |
|
|
|
<p>It should be noted, however, that Ant's <var>depends</var> attribute only specifies the <em>order</em> in which |
|
|
|
targets should be executed—it does not affect whether the target that specifies the dependency(s) gets executed if |
|
|
|
the dependent target(s) did not (need to) run.</p> |
|
|
@@ -104,7 +104,7 @@ scripts you could do:</p> |
|
|
|
task1.setFoo("bar"); |
|
|
|
</script></pre> |
|
|
|
<p>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> |
|
|
|
access the instance via <code class="code">project.getReference("task1")</code>.</p> |
|
|
|
<p>Note 1: If <q>task1</q> 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.</p> |
|
|
|
<p>Note 2: Future versions of Ant will most likely <em>not</em> be backward-compatible with this behaviour, since there |
|
|
@@ -433,20 +433,21 @@ errors. Use Ant's own <a href="install.html#optionalTasks">mechanisms</a> for ad |
|
|
|
<li>declare a single task per using instruction using |
|
|
|
<code><<a href="Tasks/taskdef.html">taskdef</a> name="taskname" |
|
|
|
classname="ImplementationClass"/></code><br/> |
|
|
|
<code><taskdef name="for" classname="net.sf.antcontrib.logic.For"/> <for |
|
|
|
<code class="code"><taskdef name="for" classname="net.sf.antcontrib.logic.For"/> <for |
|
|
|
... /></code> |
|
|
|
</li> |
|
|
|
<li>declare a bundle of tasks using a <samp>properties</samp> file holding these taskname–ImplementationClass |
|
|
|
pairs and <code><taskdef></code><br/> |
|
|
|
<code><taskdef resource="net/sf/antcontrib/antcontrib.properties"/> <for ... /></code> |
|
|
|
<code class="code"><taskdef resource="net/sf/antcontrib/antcontrib.properties"/> <for |
|
|
|
... /></code> |
|
|
|
</li> |
|
|
|
<li>declare a bundle of tasks using an <a href="Types/antlib.html">xml file</a> holding these |
|
|
|
taskname-ImplementationClass-pairs and <code><taskdef></code><br/> |
|
|
|
<code><taskdef resource="net/sf/antcontrib/antlib.xml"/> <for ... /></code> |
|
|
|
<code class="code"><taskdef resource="net/sf/antcontrib/antlib.xml"/> <for ... /></code> |
|
|
|
</li> |
|
|
|
<li>declare a bundle of tasks using an xml file named <samp>antlib.xml</samp>, XML namespace |
|
|
|
and <a href="Types/antlib.html#antlibnamespace"><code>antlib:</code> protocol handler</a><br/> |
|
|
|
<code><project xmlns:ac="antlib:net.sf.antcontrib"/> <ac:for ... /></code> |
|
|
|
<code class="code"><project xmlns:ac="antlib:net.sf.antcontrib"/> <ac:for ... /></code> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
|
|
|
|