|
@@ -107,10 +107,26 @@ to the empty string is still an existing property. For example:</p> |
|
|
<pre><target name="build-own-fake-module-A" unless="module-A-present"/></pre> |
|
|
<pre><target name="build-own-fake-module-A" unless="module-A-present"/></pre> |
|
|
</blockquote> |
|
|
</blockquote> |
|
|
<p>In the first example, if the <code>module-A-present</code> |
|
|
<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 |
|
|
example, if the <code>module-A-present</code> property is set |
|
|
(again, to any value), the target will not be run. |
|
|
(again, to any value), the target will not be run. |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
<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> |
|
|
|
|
|
<blockquote><pre> |
|
|
|
|
|
<target name="myTarget" depends="myTarget.check" if="myTarget.run"> |
|
|
|
|
|
<echo>Files foo.txt and bar.txt are present.</echo> |
|
|
|
|
|
</target> |
|
|
|
|
|
|
|
|
|
|
|
<target name="myTarget.check"> |
|
|
|
|
|
<condition property="myTarget.run"> |
|
|
|
|
|
<and> |
|
|
|
|
|
<available file="foo.txt"/> |
|
|
|
|
|
<available file="bar.txt"/> |
|
|
|
|
|
</and> |
|
|
|
|
|
</condition> |
|
|
|
|
|
</target> |
|
|
|
|
|
</pre></blockquote> |
|
|
<p>If no <code>if</code> and no <code>unless</code> attribute is present, |
|
|
<p>If no <code>if</code> and no <code>unless</code> attribute is present, |
|
|
the target will always be executed.</p> |
|
|
the target will always be executed.</p> |
|
|
|
|
|
|
|
|