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
Just like the
In addition to the condition, you can specify three different
child elements,
The <elseif>
behaves exactly like an <if>
except that it cannot contain the <else>
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 <if>
is false, then the first
<elseif>
who's conditional evaluates to true
will be executed. The <else>
will be executed
only if the <if>
and all <elseif>
conditions are false.
Use the following task to define the
<taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" />
author | |
---|---|
package |
phing.tasks.system |
addThen(\SequentialTask $t)
addElse(\SequentialTask $e)
main()
countConditions()
getIterator()
getConditions()
createReferenceExists() : \ReferenceExistsCondition
customChildCreator(string $elementName, \Project $project) : \Condition
setProject(\Project $project)
getProject() : \Project
log(string $msg, integer $level = \Project::MSG_INFO)
string
The message to be logged.
integer
The message's priority at this message should have
thenTasks :
elseIfTasks :
elseTasks :
conditions :
project : \Project