blob: 60b112bad7f4451136540fd559fd4dfe114cb6db [file] [log] [blame]
<!-- Condition task -->
<external>
<description>
<p>Sets a property if a certain condition holds true - this is a
generalization of <a href="available.html">Available</a> and <a
href="uptodate.html">Uptodate</a>.</p>
<p>If the condition holds true, the property value is set to true by
default; otherwise, the property is not set. You can set the value to
something other than the default by specifying the <code>value</code>
attribute.</p>
<p>Conditions are specified as <a href="#nested">nested elements</a>,
you must specify exactly one condition.</p>
</description>
<section anchor="examples" name="Examples">
<pre>
&lt;condition property=&quot;javamail.complete&quot;&gt;
&lt;and&gt;
&lt;available classname=&quot;javax.activation.DataHandler&quot; /&gt;
&lt;available classname=&quot;javax.mail.Transport&quot; /&gt;
&lt;/and&gt;
&lt;/condition&gt;
</pre>
<p>sets the property <code>javamail.complete</code> if both the
JavaBeans Activation Framework and JavaMail are available in the
classpath.</p>
<pre>
&lt;condition property=&quot;isMacOsButNotMacOsX&quot;&gt;
&lt;and&gt;
&lt;os family=&quot;mac&quot; />
&lt;not&gt;
&lt;os family=&quot;unix&quot; />
&lt;/not&gt;
&lt;/and&gt;
&lt;/condition&gt;
</pre>
<p>sets the property <code>isMacOsButNotMacOsX</code> if the current
operating system is MacOS, but not MacOS X - which Ant considers to be
in the Unix family as well.</p>
<pre>
&lt;condition property=&quot;isSunOSonSparc&quot;&gt;
&lt;os name=&quot;SunOS&quot; arch=&quot;sparc&quot; />
&lt;/condition&gt;
</pre>
<p>sets the property <code>isSunOSonSparc</code> if the current
operating system is SunOS and if it is running on a sparc architecture.</p>
</section>
</external>