source: release-kits/lirk3/resources/gs3-release-maker/ant/docs/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: 3.0 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 <tr>
41 <td valign="top">else</td>
42 <td valign="top">The value to set the property to if the condition
43 evaluates to <i>false</i>. By default the property will remain unset.
44 <em>Since Ant 1.6.3</em>
45 </td>
46 <td valign="top" align="center">No</td>
47 </tr>
48</table>
49<h3><a name="nested">Parameters specified as nested elements</a></h3>
50<p>All conditions to test are specified as nested elements, for a
51complete list see <a href="conditions.html">here</a>.</p>
52
53<h3>Examples</h3>
54<pre>
55 &lt;condition property=&quot;javamail.complete&quot;&gt;
56 &lt;and&gt;
57 &lt;available classname=&quot;javax.activation.DataHandler&quot;/&gt;
58 &lt;available classname=&quot;javax.mail.Transport&quot;/&gt;
59 &lt;/and&gt;
60 &lt;/condition&gt;
61</pre>
62<p>sets the property <code>javamail.complete</code> if both the
63JavaBeans Activation Framework and JavaMail are available in the
64classpath.</p>
65
66<pre>
67 &lt;condition property=&quot;isMacOsButNotMacOsX&quot;&gt;
68 &lt;and&gt;
69 &lt;os family=&quot;mac&quot;/&gt;
70
71 &lt;not&gt;
72 &lt;os family=&quot;unix&quot;/&gt;
73
74 &lt;/not&gt;
75 &lt;/and&gt;
76 &lt;/condition&gt;
77</pre>
78<p>sets the property <code>isMacOsButNotMacOsX</code> if the current
79operating system is MacOS, but not MacOS X - which Ant considers to be
80in the Unix family as well.</p>
81
82<pre>
83 &lt;condition property=&quot;isSunOSonSparc&quot;&gt;
84 &lt;os name=&quot;SunOS&quot; arch=&quot;sparc&quot;/&gt;
85
86 &lt;/condition&gt;
87</pre>
88<p>sets the property <code>isSunOSonSparc</code> if the current
89operating system is SunOS and if it is running on a sparc architecture.</p>
90
91<hr>
92<p align="center">Copyright &copy; 2001-2002, 2004-2005 Apache Software
93Foundation. All rights Reserved.</p>
94
95</body>
96</html>
Note: See TracBrowser for help on using the repository browser.