Ejen Logo
 
   <exec>


Description
Exec node is intended to execute an XPath expression (only useful with some extensions).
 
<?xml version="1.0" encoding="UTF-8"?>

<project default="build" name="build">

  <taskdef classname="org.ejen.ant.Ejen" name="ejen"/>

  <target name="build">
    <ejen>
      <option name="namespace" value="var=org.ejen.ext.ThreadGlobalVariables"/>
      ...
      <variable name="myVar1" select="'myValue1'"/>
      <variable name="myVar2" select="'myValue2'"/>
      ...
      <!-- printout "myValue1,myValue2" -->
      <echo message="{$myVar1},{$myVar2}"/>
      <!-- remove "myVar2" variable -->
      <exec select="var:remove('myVar2')"/>
      <!-- printout "myValue1," -->
      <echo message="{$myVar1},{$myVar2}"/>
      <!-- clear all variables -->
      <exec select="var:clear()"/>
      <!-- printout "," -->
      <echo message="{$myVar1},{$myVar2}"/>
      ...
    </ejen>
  </target>

</project>

Note: we must use the 'var' namespace prefix in order to call 'remove' and 'clear' methods of the org.ejen.ext.ThreadGlobalVariables extension. The {$myVar1} syntax is strictly equivalent to {var:get('myVar1')} (but you don't need to declare any namespace in the first case).

Attribute Summary
 
NameDefault ValueOptionalAccepted Values
select false 

Attribute Detail
 
select
any valid XPath expression.

Children
 
No.


SourceForge.net Logo