Cernunnos Manual


<if>

Description:

Execustes SUBTASKS if the TEST expression evaluates to Boolean.TRUE.

Reagents:

Name XPath Description Reagent Type Expected Type Required
TEST @test Boolean value indicating whether SUBTASKS should be executed. PHRASE java.lang.Boolean Yes
SUBTASKS * The set of tasks that are children of this task. NODE_LIST java.util.List No

Examples:

Tests to see if the first argument on the command line contains the colon (':') character; if so, the argument is sepparated into tokens and a new directory is created using each token:

 
       
        <with-attribute key="Attributes.STRING" value="${$1}"> 
          <if test="${groovy(Attributes.STRING.contains(':'))}"> 
            <token-iterator regex=":"> 
              <mkdirs path="${Attributes.STRING}"/> 
            </token-iterator> 
          </if> 
        </with-attribute>