2001-11-30 12:05:27 +00:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Language" content="en-us">
|
2002-02-03 22:00:42 +00:00
|
|
|
<title>Conditions Task</title>
|
2001-11-30 12:05:27 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h2><a name="Conditions">Conditions</a></h2>
|
|
|
|
|
|
|
|
<p>These are the nested elements that can be used as conditions in the
|
2002-02-01 07:24:49 +00:00
|
|
|
<a href="condition.html"><code><condition></code></a> and
|
2001-11-30 12:05:27 +00:00
|
|
|
<a href="waitfor.html"><code><waitfor></code></a> tasks.</p>
|
|
|
|
|
|
|
|
<h4>not</h4>
|
|
|
|
<p>The <code><not></code> element expects exactly one other
|
|
|
|
condition to be nested into this element, negating the result of the
|
|
|
|
condition. It doesn't have any attributes and accepts all nested
|
|
|
|
elements of the condition task as nested elements as well.</p>
|
|
|
|
|
|
|
|
<h4>and</h4> <p>
|
|
|
|
The <code><and></code> element doesn't have any attributes and
|
|
|
|
accepts an arbitrary number of conditions as nested elements - all
|
|
|
|
nested elements of the condition task are supported. This condition
|
|
|
|
is true if all of its contained conditions are, conditions will be
|
|
|
|
evaluated in the order they have been specified in the build file.</p>
|
|
|
|
<p>The <code><and></code> condition has the same shortcut
|
|
|
|
semantics as the Java && operator, as soon as one of the
|
|
|
|
nested conditions is false, no other condition will be evaluated.</p>
|
|
|
|
|
|
|
|
<h4>or</h4> <p>
|
|
|
|
The <code><or></code> element doesn't have any attributes and
|
|
|
|
accepts an arbitrary number of conditions as nested elements - all
|
|
|
|
nested elements of the condition task are supported. This condition
|
|
|
|
is true if at least one of its contained conditions is, conditions
|
|
|
|
will be evaluated in the order they have been specified in the build
|
|
|
|
file.</p> <p>The <code><or></code> condition has the same
|
|
|
|
shortcut semantics as the Java || operator, as soon as one of the
|
|
|
|
nested conditions is true, no other condition will be evaluated.</p>
|
|
|
|
|
|
|
|
<h4>available</h4>
|
|
|
|
<p>This condition is identical to the <a
|
|
|
|
href="available.html">Available</a> task, all attributes and nested
|
|
|
|
elements of that task are supported, the property and value attributes
|
|
|
|
are redundant and will be ignored.</p>
|
|
|
|
|
|
|
|
<h4>uptodate</h4>
|
|
|
|
<p>This condition is identical to the <a
|
|
|
|
href="uptodate.html">Uptodate</a> task, all attributes and nested
|
|
|
|
elements of that task are supported, the property and value attributes
|
|
|
|
are redundant and will be ignored.</p>
|
|
|
|
|
|
|
|
<h4>os</h4>
|
|
|
|
<p>Test whether the current operating system is of a given type. Each
|
|
|
|
defined attribute is tested and the result is true only if <i>all</i>
|
|
|
|
the tests succeed.
|
|
|
|
</p>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">family</td>
|
|
|
|
<td valign="top">The name of the operating system family to expect.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">name</td>
|
|
|
|
<td valign="top">The name of the operating system to expect.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">arch</td>
|
|
|
|
<td valign="top">The architecture of the operating system to expect.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">version</td>
|
|
|
|
<td valign="top">The version of the operating system to expect.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<p>Supported values for the family attribute are:
|
|
|
|
<ul>
|
|
|
|
<li>windows (for all versions of Microsoft Windows)</li>
|
|
|
|
<li>dos (for all Microsoft DOS based operating systems including
|
|
|
|
Microsoft Windows and OS/2)</li>
|
|
|
|
<li>mac (for all Apple Macintosh systems)</li>
|
|
|
|
<li>unix (for all Unix and Unix-like operating systems)</li>
|
|
|
|
<li>netware (for Novell NetWare)</li>
|
|
|
|
<li>os/2 (for OS/2)</li>
|
2003-05-23 13:40:37 +00:00
|
|
|
<li>tandem (for HP's NonStop Kernel - formerly Tandem)</li>
|
2002-01-29 17:22:56 +00:00
|
|
|
<li>win9x for Microsoft Windows 95 and 98</li>
|
2002-06-01 12:26:43 +00:00
|
|
|
<li>z/os for z/OS and OS/390</li>
|
2002-09-27 08:18:51 +00:00
|
|
|
<li>os/400 for OS/400</li>
|
2001-11-30 12:05:27 +00:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<h4>equals</h4>
|
|
|
|
<p>Tests whether the two given Strings are identical</p>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">arg1</td>
|
|
|
|
<td valign="top">First string to test.</td>
|
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">arg2</td>
|
|
|
|
<td valign="top">Second string to test.</td>
|
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
2002-01-08 08:52:32 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">casesensitive</td>
|
|
|
|
<td valign="top">Perform a case sensitive comparision. Default is
|
|
|
|
true.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">trim</td>
|
|
|
|
<td valign="top">Trim whitespace from arguments before comparing
|
|
|
|
them. Default is false.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
2001-11-30 12:05:27 +00:00
|
|
|
</table>
|
|
|
|
|
|
|
|
<h4>isset</h4>
|
|
|
|
<p>Test whether a given property has been set in this project.</p>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">property</td>
|
|
|
|
<td valign="top">The name of the property to test.</td>
|
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<h4>checksum</h4>
|
2002-02-01 07:24:49 +00:00
|
|
|
<p>This condition is identical to the <a href="checksum.html">Checksum</a>
|
2001-11-30 12:05:27 +00:00
|
|
|
task, all attributes and nested elements of that task are supported,
|
|
|
|
the property and overwrite attributes are redundant and will be
|
|
|
|
ignored.</p>
|
|
|
|
|
|
|
|
<h4>http</h4>
|
|
|
|
<p>The <code>http</code> condition checks for a valid response from a
|
2002-06-01 12:26:43 +00:00
|
|
|
web server of the specified url. By default, HTTP responses errors
|
|
|
|
of 400 or greater are viewed as invalid.</p>
|
2001-11-30 12:05:27 +00:00
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
2002-02-01 07:24:49 +00:00
|
|
|
<tr>
|
2001-11-30 12:05:27 +00:00
|
|
|
<td width="12%" valign="top"><b>Attribute</b></td>
|
|
|
|
<td width="78%" valign="top"><b>Description</b></td>
|
|
|
|
<td width="10%" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
2002-02-01 07:24:49 +00:00
|
|
|
<tr>
|
2001-11-30 12:05:27 +00:00
|
|
|
<td valign="top">url</td>
|
2002-02-01 07:24:49 +00:00
|
|
|
<td valign="top">The full URL of the page to request. The web server must
|
2002-12-01 01:30:08 +00:00
|
|
|
return a status code below the value of <tt>errorsBeginAt</tt></td>
|
2001-11-30 12:05:27 +00:00
|
|
|
<td align="center">Yes.</td>
|
|
|
|
</tr>
|
2002-07-09 21:06:15 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">errorsBeginAt</td>
|
|
|
|
<td valign="top">The lowest HTTP response code that signals an error;
|
|
|
|
by default '400'; server errors, not-authorized, not-found and the like
|
|
|
|
are detected</td>
|
|
|
|
<td align="center">No</td>
|
|
|
|
</tr>
|
2001-11-30 12:05:27 +00:00
|
|
|
</table>
|
|
|
|
|
|
|
|
<h4>socket</h4>
|
|
|
|
<p>The <code>socket</code> condition checks for the existence of a
|
|
|
|
TCP/IP listener at the specified host and port.</p>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
2002-02-01 07:24:49 +00:00
|
|
|
<tr>
|
2001-11-30 12:05:27 +00:00
|
|
|
<td width="12%" valign="top"><b>Attribute</b></td>
|
|
|
|
<td width="78%" valign="top"><b>Description</b></td>
|
|
|
|
<td width="10%" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
2002-02-01 07:24:49 +00:00
|
|
|
<tr>
|
2001-11-30 12:05:27 +00:00
|
|
|
<td valign="top">server</td>
|
|
|
|
<td valign="top">The DNS name or IP address of the server.</td>
|
|
|
|
<td align="center">Yes.</td>
|
|
|
|
</tr>
|
2002-02-01 07:24:49 +00:00
|
|
|
<tr>
|
2001-11-30 12:05:27 +00:00
|
|
|
<td valign="top">port</td>
|
|
|
|
<td valign="top">The port number to connect to.</td>
|
|
|
|
<td align="center">Yes.</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
2002-01-14 00:06:07 +00:00
|
|
|
<h4>filesmatch</h4>
|
2002-02-01 07:24:49 +00:00
|
|
|
<p>Test two files for matching. Nonexistence of either file results in "false".
|
2002-01-14 00:06:07 +00:00
|
|
|
This test does a byte for byte comparision, so test time scales with
|
2002-02-01 07:24:49 +00:00
|
|
|
byte size. NB: if the files are different sizes , one of them is missing
|
|
|
|
or the filenames match the answer is so obvious the detailed test is omitted.
|
|
|
|
|
|
|
|
|
2002-01-14 00:06:07 +00:00
|
|
|
</p>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
2002-02-01 07:24:49 +00:00
|
|
|
<tr>
|
2002-01-14 00:06:07 +00:00
|
|
|
<td width="12%" valign="top"><b>Attribute</b></td>
|
|
|
|
<td width="78%" valign="top"><b>Description</b></td>
|
|
|
|
<td width="10%" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
2002-02-01 07:24:49 +00:00
|
|
|
<tr>
|
2002-01-14 00:06:07 +00:00
|
|
|
<td valign="top">file1</td>
|
|
|
|
<td valign="top">First file to test</td>
|
|
|
|
<td align="center">Yes.</td>
|
|
|
|
</tr>
|
2002-02-01 07:24:49 +00:00
|
|
|
<tr>
|
2002-01-14 00:06:07 +00:00
|
|
|
<td valign="top">file2</td>
|
|
|
|
<td valign="top">Second file to test</td>
|
|
|
|
<td align="center">Yes.</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
2002-02-20 08:36:27 +00:00
|
|
|
<h4>contains</h4>
|
2002-04-19 07:15:44 +00:00
|
|
|
<p>Tests whether a string contains another one.</p>
|
2002-02-20 08:36:27 +00:00
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">string</td>
|
|
|
|
<td valign="top">The string to search in.</td>
|
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">substring</td>
|
|
|
|
<td valign="top">The string to search for.</td>
|
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">casesensitive</td>
|
|
|
|
<td valign="top">Perform a case sensitive comparision. Default is
|
|
|
|
true.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
2002-04-19 07:15:44 +00:00
|
|
|
<h4>istrue</h4>
|
|
|
|
<p>Tests whether a string equals any of the ant definitions of true,
|
|
|
|
that is "true","yes", or "on"</p>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">value</td>
|
|
|
|
<td valign="top">value to test</td>
|
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<pre>
|
2002-09-04 11:05:19 +00:00
|
|
|
<istrue value="${someproperty}"/>
|
|
|
|
<istrue value="false"/>
|
2002-07-09 21:06:15 +00:00
|
|
|
</pre>
|
|
|
|
|
2002-04-19 07:15:44 +00:00
|
|
|
<h4>isfalse</h4>
|
|
|
|
<p>Tests whether a string is not true, the negation of <istrue>
|
|
|
|
</p>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">value</td>
|
|
|
|
<td valign="top">value to test</td>
|
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<pre>
|
2002-09-04 11:05:19 +00:00
|
|
|
<isfalse value="${someproperty}"/>
|
|
|
|
<isfalse value="false"/>
|
2002-07-09 21:06:15 +00:00
|
|
|
</pre>
|
|
|
|
|
2002-09-09 08:21:39 +00:00
|
|
|
<h4>isreference</h4>
|
|
|
|
|
|
|
|
<p>Test whether a given reference has been defined in this project and
|
|
|
|
- optionally - is of an expected type.</p>
|
|
|
|
|
|
|
|
<p>This condition has been added in Apache Ant 1.6.</p>
|
|
|
|
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">refid</td>
|
|
|
|
<td valign="top">The id of the reference to test.</td>
|
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">type</td>
|
|
|
|
<td valign="top">Name of the data type or task this reference is
|
|
|
|
expected to be.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
2001-11-30 12:05:27 +00:00
|
|
|
<hr>
|
2003-03-14 16:01:04 +00:00
|
|
|
<p align="center">Copyright © 2001-2003 Apache Software
|
2001-11-30 12:05:27 +00:00
|
|
|
Foundation. All rights Reserved.</p>
|
|
|
|
|
|
|
|
</body>
|
2002-01-14 00:06:07 +00:00
|
|
|
</html>
|