ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r321171 - /ant/core/trunk/docs/manual/using.html
Date Fri, 14 Oct 2005 18:42:40 GMT
Author: jhm
Date: Fri Oct 14 11:42:32 2005
New Revision: 321171

Some words to if/unless on targets


Modified: ant/core/trunk/docs/manual/using.html
--- ant/core/trunk/docs/manual/using.html (original)
+++ ant/core/trunk/docs/manual/using.html Fri Oct 14 11:42:32 2005
@@ -107,10 +107,26 @@
   <pre>&lt;target name=&quot;build-own-fake-module-A&quot; unless=&quot;module-A-present&quot;/&gt;</pre>
 <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
+property is set (to any value, e.g. <i>false</i>), 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>Only one propertyname can be specified in the if/unless clause. If you want to check
+multiple conditions, you can use a dependend target for computing the result for the check:</p>
+&lt;target name="myTarget" depends="myTarget.check" if=""&gt;
+    &lt;echo&gt;Files foo.txt and bar.txt are present.&lt;/echo&gt;
+&lt;target name="myTarget.check"&gt;
+    &lt;condition property=""&gt;
+        &lt;and&gt;
+            &lt;available file="foo.txt"/&gt;
+            &lt;available file="bar.txt"/&gt;
+        &lt;/and&gt;
+    &lt;/condition&gt;
 <p>If no <code>if</code> and no <code>unless</code> attribute
is present,
 the target will always be executed.</p>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message