source: release-kits/lirk3/bin/ant-installer/web/manual1.6.2/manual/CoreTasks/condition.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 2.8 KB
Line 
1<html>
2
3<head>
4<meta http-equiv="Content-Language" content="en-us">
5<title>Condition Task</title>
6<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
7</head>
8
9<body>
10
11<h2><a name="Condition">Condition</a></h2>
12<h3>Description</h3>
13<p>Sets a property if a certain condition holds true - this is a
14generalization of <a href="available.html">Available</a> and <a
15href="uptodate.html">Uptodate</a>.</p>
16<p>If the condition holds true, the property value is set to true by
17default; otherwise, the property is not set. You can set the value to
18something other than the default by specifying the <code>value</code>
19attribute.</p>
20<p>Conditions are specified as <a href="#nested">nested elements</a>,
21you must specify exactly one condition.</p>
22<h3>Parameters</h3>
23<table border="1" cellpadding="2" cellspacing="0">
24 <tr>
25 <td valign="top"><b>Attribute</b></td>
26 <td valign="top"><b>Description</b></td>
27 <td align="center" valign="top"><b>Required</b></td>
28 </tr>
29 <tr>
30 <td valign="top">property</td>
31 <td valign="top">The name of the property to set.</td>
32 <td valign="top" align="center">Yes</td>
33 </tr>
34 <tr>
35 <td valign="top">value</td>
36 <td valign="top">The value to set the property to. Defaults to
37 &quot;true&quot;.</td>
38 <td valign="top" align="center">No</td>
39 </tr>
40</table>
41<a name="nested"></a><h3>Parameters specified as nested elements</h3>
42<p>All conditions to test are specified as nested elements, for a
43complete list see <a href="conditions.html">here</a>.</p>
44
45<h3>Examples</h3>
46<pre>
47 &lt;condition property=&quot;javamail.complete&quot;&gt;
48 &lt;and&gt;
49 &lt;available classname=&quot;javax.activation.DataHandler&quot;/&gt;
50 &lt;available classname=&quot;javax.mail.Transport&quot;/&gt;
51 &lt;/and&gt;
52 &lt;/condition&gt;
53</pre>
54<p>sets the property <code>javamail.complete</code> if both the
55JavaBeans Activation Framework and JavaMail are available in the
56classpath.</p>
57
58<pre>
59 &lt;condition property=&quot;isMacOsButNotMacOsX&quot;&gt;
60 &lt;and&gt;
61 &lt;os family=&quot;mac&quot;/&gt;
62
63 &lt;not&gt;
64 &lt;os family=&quot;unix&quot;/&gt;
65
66 &lt;/not&gt;
67 &lt;/and&gt;
68 &lt;/condition&gt;
69</pre>
70<p>sets the property <code>isMacOsButNotMacOsX</code> if the current
71operating system is MacOS, but not MacOS X - which Ant considers to be
72in the Unix family as well.</p>
73
74<pre>
75 &lt;condition property=&quot;isSunOSonSparc&quot;&gt;
76 &lt;os name=&quot;SunOS&quot; arch=&quot;sparc&quot;/&gt;
77
78 &lt;/condition&gt;
79</pre>
80<p>sets the property <code>isSunOSonSparc</code> if the current
81operating system is SunOS and if it is running on a sparc architecture.</p>
82
83<hr>
84<p align="center">Copyright &copy; 2001-2002,2004 The Apache Software
85Foundation. All rights Reserved.</p>
86
87</body>
88</html>
Note: See TracBrowser for help on using the repository browser.