ant

Description

Run a series of Ant tasks.

Oddjob creates it's own Ant project to use internally this project can be shared between different AntJob jobs using the 'project' attribute. This allows taskdefs and properties to be defined in one place and shared in many jobs.

Oddjob component properties can be referenced inside an Ant tasks using the ${id.property} notation. Ant will look up the Oddjob property before it looks up properties defined with the <property> tag. The oddjob derived properties of an Ant task aren't constant. Oddjob variables can change unlike Ant properties.

Not all tasks have been tested.

Note: Ant looks up properties beginning with 'ant.' - Therefore no component can have an id of 'ant' as the lookup will fail to retrieve the properties from that component (unless of course the 'ant' component implements all the properties that Ant requires!).

Properties

NameDescriptionRequired
name A name, can be any text. No.
project A reference to project in another ant job. This allows reference ids to be shared. No.
messageLevel The message level for output. one of DEBUG, ERROR, INFO, VERBOSE, WARN. No.
baseDir The base directory. Equivelant to setting the basedir attribute of an ant project. No.
exception If true, then a build failure will result in an Exception state for this job. No, defaults to false.

Example

 <ant>
  <tasks>
   <xml>
    <tasks>
     <property name="test.thing" value="Test" />
     <echo message='${test.thing}'/>
    </tasks>
   </xml>
  </tasks>
 </ant>
 

 <sequential>
  <jobs>
   <ant id='defs'>
    <tasks>
     <xml>
      <tasks>
       <taskdef name='foo' 
                   classname='org.oddjob.reference.ant.OurTask'/>
       <property name="test.thing" value="Test"/>
      </tasks>
     </xml>
    </tasks>
   </ant>
   <ant project='${defs.project}'>
    <tasks>
     <xml>
      <tasks>
       <foo stuff='${test.thing}'/>
      </tasks>
     </xml>
    </tasks>
   </ant>
  </jobs>
 </sequential>
 

 <sequential>
 	<jobs>
   <variables id='v'>
    <stuff>
     <value value='Hello World'/>
    </stuff>
   </variables>
   <ant>
    <tasks>
     <xml>
      <echo message='${v.stuff}'/>
     </xml>
    </tasks>
   </ant>
 </sequential>
 


(c) Rob Gordon 2005 - 2009