Sophie

Sophie

distrib > Mageia > 2 > i586 > by-pkgid > 16e567b9c4f399396e323ecd14733323 > files > 24

ant-contrib-1.0-0.12.b3.1.mga2.noarch.rpm

<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>
More Conditions</title>
<meta content="DocBook XSL Stylesheets V1.60.1" name="generator">
<link rel="home" href="index.html" title="Antelope Users Guide">
<link rel="up" href="bk03ch05.html" title="Chapter&nbsp;5.&nbsp;If Task">
<link rel="previous" href="bk03ch05.html" title="Chapter&nbsp;5.&nbsp;If Task">
<link rel="next" href="bk03ch06.html" title="Chapter&nbsp;6.&nbsp;SwitchTask">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="section" lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="conditionals">
</a>
More Conditions</h2>
</div>
</div>
<div>
</div>
</div>
<p>

These conditions are suitable for use in the &lt;bool&gt; element. Unfortunately, they cannot be used in the &lt;condition&gt; task, although all conditions for the &lt;condition&gt; task can be used with the &lt;bool&gt; and the &lt;bool&gt; can be used anywhere that &lt;condition&gt; can be used.
</p>
<h4>
<a name="N10708">
</a>
IfPropertyTrue</h4>
<p>

Given a property name, tests whether the value for that property equals "true" (or "yes" or "on").
</p>
<p>

<div class="table">
<a name="N1070F">
</a>
<p class="title">
<b>
Table&nbsp;5.2.&nbsp;IfPropertyTrue Attributes</b>
</p>
<table summary="IfPropertyTrue Attributes" border="1">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>
Attribute</th>
<th>
Description</th>
<th>
Required</th>
</tr>
</thead>
<tbody>
<tr>
<td>
property</td>
<td>
The name of a property to test the value of.</td>
<td>
Yes</td>
</tr>
</tbody>
</table>
</div>

</p>
<p>

<table border="0" bgcolor="#E0E0E0">
<tr>
<td>
<pre class="programlisting">


&lt;ispropertytrue property="myprop"/&gt;
&lt;ispropertytrue property="${someprop}"/&gt;

</pre>
</td>
</tr>
</table>

</p>
<h4>
<a name="N1072C">
</a>
IfPropertyFalse</h4>
<p>

Given a property name, tests whether the value for that property equals "false" (or "no" or "off").
</p>
<p>

<div class="table">
<a name="N10733">
</a>
<p class="title">
<b>
Table&nbsp;5.3.&nbsp;IfPropertyFalse Attributes</b>
</p>
<table summary="IfPropertyFalse Attributes" border="1">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>
Attribute</th>
<th>
Description</th>
<th>
Required</th>
</tr>
</thead>
<tbody>
<tr>
<td>
property</td>
<td>
The name of a property to test the value of.</td>
<td>
Yes</td>
</tr>
</tbody>
</table>
</div>

</p>
<p>

<table border="0" bgcolor="#E0E0E0">
<tr>
<td>
<pre class="programlisting">


&lt;ispropertyfalse property="myprop"/&gt;
&lt;ispropertyfalse property="${someprop}"/&gt;

</pre>
</td>
</tr>
</table>

</p>
<h4>
<a name="N10750">
</a>
StartsWith</h4>
<p>

Given a property name, tests whether the value for that property starts with a specified string.
</p>
<p>

<div class="table">
<a name="N10757">
</a>
<p class="title">
<b>
Table&nbsp;5.4.&nbsp;StartsWith Attributes</b>
</p>
<table summary="StartsWith Attributes" border="1">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>
Attribute</th>
<th>
Description</th>
<th>
Required</th>
</tr>
</thead>
<tbody>
<tr>
<td>
string</td>
<td>
The string to test.</td>
<td>
Yes</td>
</tr>
<tr>
<td>
with</td>
<td>
Check if 'string' starts with this value.</td>
<td>
Yes</td>
</tr>
</tbody>
</table>
</div>

</p>
<p>

<table border="0" bgcolor="#E0E0E0">
<tr>
<td>
<pre class="programlisting">


&lt;startswith string="abcdefg" with="abc"/&gt;
&lt;startswith string="${myprop}" with="foo"/&gt;

</pre>
</td>
</tr>
</table>

</p>
<h4>
<a name="N1077B">
</a>
EndsWith</h4>
<p>

Given a property name, tests whether the value for that ends with with a specified string.
</p>
<p>

<div class="table">
<a name="N10782">
</a>
<p class="title">
<b>
Table&nbsp;5.5.&nbsp;EndsWith Attributes</b>
</p>
<table summary="EndsWith Attributes" border="1">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>
Attribute</th>
<th>
Description</th>
<th>
Required</th>
</tr>
</thead>
<tbody>
<tr>
<td>
string</td>
<td>
The string to test.</td>
<td>
Yes</td>
</tr>
<tr>
<td>
with</td>
<td>
Check if 'string' ends with this value.</td>
<td>
Yes</td>
</tr>
</tbody>
</table>
</div>

</p>
<p>

<table border="0" bgcolor="#E0E0E0">
<tr>
<td>
<pre class="programlisting">


&lt;endswith string="abcdefg" with="efg"/&gt;
&lt;endswith string="${myprop}" with="bar"/&gt;

</pre>
</td>
</tr>
</table>

</p>
<h4>
<a name="N107A6">
</a>
IsGreaterThan</h4>
<p>

Tests whether the first argument is greater than the second argument. Will
automatically treat the arguments as numbers if both arguments consists of only the characters 0 through 9 and optionally a decimal point. Otherwise, a String
comparison is used. 
</p>
<p>

<div class="table">
<a name="N107AD">
</a>
<p class="title">
<b>
Table&nbsp;5.6.&nbsp;IsGreaterThan Attributes</b>
</p>
<table summary="IsGreaterThan Attributes" border="1">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>
Attribute</th>
<th>
Description</th>
<th>
Required</th>
</tr>
</thead>
<tbody>
<tr>
<td>
arg1</td>
<td>
The first argument.</td>
<td>
Yes</td>
</tr>
<tr>
<td>
arg2</td>
<td>
The second argument.</td>
<td>
Yes</td>
</tr>
</tbody>
</table>
</div>

</p>
<p>

<table border="0" bgcolor="#E0E0E0">
<tr>
<td>
<pre class="programlisting">


&lt;!-- evaluates to true --&gt;
&lt;isgreaterthan arg1="6.02" arg2="4"/&gt;

&lt;!-- evaluates to false --&gt;
&lt;isgreaterthan arg1="bar" arg2="foo"/&gt;

</pre>
</td>
</tr>
</table>

</p>
<h4>
<a name="N107D1">
</a>
IsLessThan</h4>
<p>

Tests whether the first argument is less than the second argument. Will
automatically treat the arguments as numbers if both arguments consists of only the characters 0 through 9 and optionally a decimal point. Otherwise, a String
comparison is used. 
</p>
<p>

<div class="table">
<a name="N107D8">
</a>
<p class="title">
<b>
Table&nbsp;5.7.&nbsp;IsLessThan Attributes</b>
</p>
<table summary="IsLessThan Attributes" border="1">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>
Attribute</th>
<th>
Description</th>
<th>
Required</th>
</tr>
</thead>
<tbody>
<tr>
<td>
arg1</td>
<td>
The first argument.</td>
<td>
Yes</td>
</tr>
<tr>
<td>
arg2</td>
<td>
The second argument.</td>
<td>
Yes</td>
</tr>
</tbody>
</table>
</div>

</p>
<p>

<table border="0" bgcolor="#E0E0E0">
<tr>
<td>
<pre class="programlisting">


&lt;!-- evaluates to false --&gt;
&lt;islessthan arg1="6.02" arg2="4"/&gt;

&lt;!-- evaluates to true --&gt;
&lt;islessthan arg1="bar" arg2="foo"/&gt;

</pre>
</td>
</tr>
</table>

</p>
</div>
    <hr>
    <p align="center">Copyright &copy; 2003 Ant-Contrib Project. All
    rights Reserved.</p>
</body>
</html>