Name
antcall
Synopsis
Invokes a target in the current buildfile. Properties are passed to
the new target using nested <param>
elements. An investigation of the Ant source code reveals that
antcall instantiates and calls the
ant task using the current buildfile. This means
that a new project instance is created and properties work the same
as they do for ant.
Attributes
-
inheritall(1.4, boolean, N) Defines how properties are propagated to the new target. Defaults to
true, meaning all properties in the current build process are inherited by the new target. Prior to Ant 1.4, this was the only behavior. Whenfalse, properties set by users on the command line are the only ones passed to the new target.-
target(all, String, Y) The name of the target to call.
Content
- 0..n nested
<param>elements (all) Passes a property to the new build process. Each
<param>element is implemented using the same class as thepropertytask; allpropertyattributes are applicable.
Example Usage
Call the cleandir target and specify the
dir-to-clean property:
<target name="clean"><antcall target="cleandir"><param name="dir-to-clean" value="javadocs"/></antcall></target>
Delete a directory specified by the dir-to-clean
property:
<target name="cleandir">
<delete dir="${dir-to-clean}"/>
</target>See Also
See the property task for allowable attributes on
nested <param> elements.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access