Chapter 21. Call Task
Prev | Additional Ant Tasks | Next

## Chapter 21. Call Task

This is the simplest and possibly the most obvious of the "call" type of tasks. It simply calls a target in the current build file and provides exactly the functionality expected by many users of "antcall".

To use this task in your build files, include a task definition like this:

        <taskdef name="call" classname="ise.antelope.tasks.Call"/>

There is only one attribute, that is the name of the target to call.

Table 21.1. Call Task Attributes

Attribute | Description | Default | Required
--- | --- | --- | ---
target | The name of a target to execute. | None | Yes

There is none of the weird property manipulation done by "ant", "antcall", "antfetch", or "antcallback", and none of the overhead. When you call a target, any properties set in that target are immediately available in the calling target. A simple example should be all that is necessary:

     <target name="test" description="Test Call">
         <call target="called"/>
         <echo>a = ${a}</echo>
         <echo>b = ${b}</echo>
     </target>

     <target name="called">
         <property name="a" value="A"/>
         <property name="b" value="B"/>
     </target>

Prev | Up | Next
Chapter 20. AntCallBack | Home | Chapter 22. Grep Task