|
AntCallDescriptionCall another target within the same build-file optionally specifying some properties (param's in this context) By default, all of the properties of the current project will be
available in the new project. Alternatively, you can
set the inheritAll attribute to You can also set properties in the new project from the old project by using nested param tags. These properties are always passed regardless of the setting of inheritAll. This allows you to parameterize your subprojects. Nested <reference> elements can be used to copy references from the calling project to the new project, optionally under a different id. References taken from nested elements will override existing references in the new project. When a target is invoked by antcall, all of its dependent targets will also be called within the context of any new parameters. For example. if the target "doSomethingElse" depended on the target "init", then the antcall of "doSomethingElse" will call "init" during the call. Of course, any properties defined in the antcall task or inherited from the calling target will be fixed and not overridable in the init task -or indeed in the "doSomethingElse" task. Parameters
Note on
|
Attribute | Description | Required |
refid | The id of the reference in the calling project. | Yes |
torefid | The id of the reference in the new project. | No, defaults to the value of refid. |
<target name="default"> <antcall target="doSomethingElse"> <param name="param1" value="value"/> </antcall> </target> <target name="doSomethingElse"> <echo message="param1=${param1}"/> </target>
Will run the target 'doSomethingElse' and echo 'param1=value'.
<antcall ... > <reference refid="path1" torefid="path2"/> </antcall>
will copy the parent's definition of path1
into the
new project using the id path2
.
Copyright © 2000-2002 Apache Software Foundation. All rights Reserved.