source: release-kits/lirk3/bin/ant-installer/web/manual1.7.0/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.7 KB
Line 
1<!--
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<html>
18
19<head>
20<meta http-equiv="Content-Language" content="en-us">
21<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
22<title>Condition Task</title>
23</head>
24
25<body>
26
27<h2><a name="Condition">Condition</a></h2>
28<h3>Description</h3>
29<p>Sets a property if a certain condition holds true - this is a
30generalization of <a href="available.html">Available</a> and <a
31href="uptodate.html">Uptodate</a>.</p>
32<p>If the condition holds true, the property value is set to true by
33default; otherwise, the property is not set. You can set the value to
34something other than the default by specifying the <code>value</code>
35attribute.</p>
36<p>Conditions are specified as <a href="#nested">nested elements</a>,
37you must specify exactly one condition.</p>
38<h3>Parameters</h3>
39<table border="1" cellpadding="2" cellspacing="0">
40 <tr>
41 <td valign="top"><b>Attribute</b></td>
42 <td valign="top"><b>Description</b></td>
43 <td align="center" valign="top"><b>Required</b></td>
44 </tr>
45 <tr>
46 <td valign="top">property</td>
47 <td valign="top">The name of the property to set.</td>
48 <td valign="top" align="center">Yes</td>
49 </tr>
50 <tr>
51 <td valign="top">value</td>
52 <td valign="top">The value to set the property to. Defaults to
53 &quot;true&quot;.</td>
54 <td valign="top" align="center">No</td>
55 </tr>
56 <tr>
57 <td valign="top">else</td>
58 <td valign="top">The value to set the property to if the condition
59 evaluates to <i>false</i>. By default the property will remain unset.
60 <em>Since Ant 1.6.3</em>
61 </td>
62 <td valign="top" align="center">No</td>
63 </tr>
64</table>
65<h3><a name="nested">Parameters specified as nested elements</a></h3>
66<p>All conditions to test are specified as nested elements, for a
67complete list see <a href="conditions.html">here</a>.</p>
68
69<h3>Examples</h3>
70<pre>
71 &lt;condition property=&quot;javamail.complete&quot;&gt;
72 &lt;and&gt;
73 &lt;available classname=&quot;javax.activation.DataHandler&quot;/&gt;
74 &lt;available classname=&quot;javax.mail.Transport&quot;/&gt;
75 &lt;/and&gt;
76 &lt;/condition&gt;
77</pre>
78<p>sets the property <code>javamail.complete</code> if both the
79JavaBeans Activation Framework and JavaMail are available in the
80classpath.</p>
81
82<pre>
83 &lt;condition property=&quot;isMacOsButNotMacOsX&quot;&gt;
84 &lt;and&gt;
85 &lt;os family=&quot;mac&quot;/&gt;
86
87 &lt;not&gt;
88 &lt;os family=&quot;unix&quot;/&gt;
89
90 &lt;/not&gt;
91 &lt;/and&gt;
92 &lt;/condition&gt;
93</pre>
94<p>sets the property <code>isMacOsButNotMacOsX</code> if the current
95operating system is MacOS, but not MacOS X - which Ant considers to be
96in the Unix family as well.</p>
97
98<pre>
99 &lt;condition property=&quot;isSunOSonSparc&quot;&gt;
100 &lt;os name=&quot;SunOS&quot; arch=&quot;sparc&quot;/&gt;
101
102 &lt;/condition&gt;
103</pre>
104<p>sets the property <code>isSunOSonSparc</code> if the current
105operating system is SunOS and if it is running on a sparc architecture.</p>
106
107
108
109</body>
110</html>
Note: See TracBrowser for help on using the repository browser.