Perform some tasks based on whether a given condition holds true or not.
This task is heavily based on the Condition framework that can be found in Ant 1.4 and later, therefore it cannot be used in conjunction with versions of Ant prior to 1.4.
This task doesn't have any attributes, the condition to test is specified by a nested element - see the documentation of your
task (see
the
online documentation for example) for a complete list of nested
elements.
Just like the
task, only a single
condition can be specified - you combine them using
or
conditions.
In addition to the condition, you can specify three different child elements,
,
and
. All three subelements are optional.
Both
and
must not be
used more than once inside the if task. Both are
containers for Ant tasks, just like Ant's
and
tasks - in fact they are implemented using the same class as Ant's
task.
The
behaves exactly like an
except that it cannot contain the
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
is false, then the first
who's conditional evaluates to true will be executed. The
will be executed only if the
and all
conditions are false.
Use the following task to define the
task before you use it the first time:
<taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" />
author | <a href="mailto:stefan.bodewig@freenet.de">Stefan Bodewig</a> |
---|---|
package | phing.tasks.system |
copyright | 2001,2002 THYRELL. All rights reserved |
version | $Id: f667c12da5ad79ccdd6f2d346f5c5bcede98b0a7 $ |
addAvailable(\AvailableTask $a) : void
inherited_from | \ConditionBase::addAvailable() |
---|
addElse(\SequentialTask $e)
Not required.
addElseIf(\ElseIfTask $ei)
addThen(\SequentialTask $t)
Not required.
countConditions()
inherited_from | \ConditionBase::countConditions() |
---|
customChildCreator(string $elementName, \Project $project) : \Condition
inherited_from | \ConditionBase::customChildCreator() |
---|
string
\Project
\BuildException |
---|
getConditions()
inherited_from | \ConditionBase::getConditions() |
---|
getIterator()
inherited_from | \ConditionBase::getIterator() |
---|
getProject() : \Project
inherited_from | \ProjectComponent::getProject() |
---|---|
inherited_from | \ConditionBase::getProject() |
\Project
Reference to current porject objectlog(string $msg, integer $level)
inherited_from | \ProjectComponent::log() |
---|---|
inherited_from | \ConditionBase::log() |
string
The message to be logged.
integer
The message's priority at this message should have
main()
setProject(\Project $project)
inherited_from | \ProjectComponent::setProject() |
---|---|
inherited_from | \ConditionBase::setProject() |
$conditions
inherited_from | \ConditionBase::$$conditions |
---|
$project : \Project
inherited_from | \ProjectComponent::$$project |
---|---|
inherited_from | \ConditionBase::$$project |
$elseIfTasks
$elseTasks
$thenTasks