mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
95 lines
3.2 KiB
HTML
95 lines
3.2 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<title>Ant-contrib Tasks: If</title>
|
|
</head>
|
|
|
|
<body>
|
|
<h1>If</h1>
|
|
|
|
<p>Perform some tasks based on whether a given condition holds
|
|
true or not.</p>
|
|
|
|
<p>This task is heavily based on the Condition framework that can
|
|
be found in Ant 1.4 and later, therefore it cannot be used
|
|
inconjunction with versions of Ant prior to 1.4. Due to numeruos
|
|
bugs in Ant 1.4(.1) that affect this task, we recommend to use Ant
|
|
1.5 or later.</p>
|
|
|
|
<h2>Parameters</h2>
|
|
|
|
<p>This task doesn't have any attributes, the condition to test is
|
|
specified by a nested element - see the documentation of your
|
|
<code><condition></code> task (see <a
|
|
href="http://ant.apache.org/manual/CoreTasks/condition.html">the
|
|
online documentation</a> for example) for a complete list of
|
|
nested elements.</p>
|
|
|
|
<p>Just like the <code><condition></code> task, only a
|
|
single condition can be specified - you combine them using
|
|
<code><and></code> or <code><or></code>
|
|
conditions.</p>
|
|
|
|
<p>In addition to the condition, you can specify three different
|
|
child elements, <code><elseif></code>, <code><then></code> and
|
|
<code><else></code>. All three subelements are optional.
|
|
|
|
Both <code><then></code> and <code><else></code> must not be
|
|
used more than once inside the if task. Both are
|
|
containers for Ant tasks, just like Ant's
|
|
<code><parallel></code> and <code><sequential></code>
|
|
tasks - in fact they are implemented using the same class as Ant's
|
|
<code><sequential></code> task.</p>
|
|
|
|
The <code><elseif></code> behaves exactly like an <code><if></code>
|
|
except that it cannot contain the <code><else></code> element
|
|
inside of it. You may specify as may of these as you like, and the
|
|
order they are specified is the order they are evaluated in. If the
|
|
condition on the <code><if></code> is false, then the first
|
|
<code><elseif></code> who's conditional evaluates to true
|
|
will be executed. The <code><else></code> will be executed
|
|
only if the <code><if></code> and all <code><elseif></code>
|
|
conditions are false.
|
|
|
|
<h2>Example</h2>
|
|
|
|
<pre><code>
|
|
<if>
|
|
<equals arg1="${foo}" arg2="bar" />
|
|
<then>
|
|
<echo message="The value of property foo is bar" />
|
|
</then>
|
|
<else>
|
|
<echo message="The value of property foo is not bar" />
|
|
</else>
|
|
</if>
|
|
</code></pre>
|
|
|
|
<pre><code>
|
|
<if>
|
|
<equals arg1="${foo}" arg2="bar" />
|
|
<then>
|
|
<echo message="The value of property foo is 'bar'" />
|
|
</then>
|
|
|
|
<elseif>
|
|
<equals arg1="${foo}" arg2="foo" />
|
|
<then>
|
|
<echo message="The value of property foo is 'foo'" />
|
|
</then>
|
|
</elseif>
|
|
|
|
|
|
<else>
|
|
<echo message="The value of property foo is not 'foo' or 'bar'" />
|
|
</else>
|
|
</if>
|
|
</code></pre>
|
|
|
|
<hr>
|
|
<p align="center">Copyright © 2002-2003 Ant-Contrib Project. All
|
|
rights Reserved.</p>
|
|
|
|
</body>
|
|
</html>
|