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 |
addElse(\SequentialTask $e)
addThen(\SequentialTask $t)
countConditions() : integer
integer
createFilesMatch()
createHasFreeSpace()
createHttp()
createIsFailure()
createIsPropertyFalse() : \IsPropertyFalseCondition
createIsPropertyTrue() : \IsPropertyTrueCondition
createPhingVersion()
createReferenceExists() : \ReferenceExistsCondition
createSocket()
createVersionCompare()
customChildCreator(string $elementName, \Project $project) : \Condition
throws |
---|
string
the name of the element that has been requested
\Condition
getIterator()
getProject() : \Project
log(string $msg, integer $level = \Project::MSG_INFO) : void
string
The message to be logged.
integer
The message's priority at this message should have
main()
setProject(\Project $project) : void
thenTasks :
elseIfTasks :
elseTasks :
conditions :
project : \Project