Call another target within the same buildfile optionally specifying some properties (params in this context). This task must not be used outside of a target.
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 false and only “user” properties (i.e., those passed on the command-line) will be passed to the new project. In either case, the set of properties passed to the new project will override the properties that are set in the new project (see also the property task).
You can also set properties in the new project from the old project by using nested tags. These properties are always passed to the new project and any project created in that project regardless of the setting of inheritAll. This allows you to parameterize your subprojects. Properties defined on the command line can not be overridden by nested elements.
When more than one nested element would set a property of the same name, the one declared last will win. This is for backwards compatibility reasons even so it is different from the way
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 target—or indeed in the doSomethingElse target.
The called target(s) are run in a new project; be aware that this means properties, references, etc. set by called targets will not persist back to the calling project.
If the build file changes after you’ve started the build, the behavior of this task is undefined.
|target||The target to execute.||Yes|
|inheritAll||If true, pass all properties to the new Apache Ant project.||No; defaults to true|
|inheritRefs||If true, pass all references to the new Ant project.||No; defaults to false|
Note on inheritRefs
Parameters specified as nested elements
Specifies the properties to set before running the specified target. See property for usage guidelines.
These properties become equivalent to properties you define on the command line. These are special properties and they will always get passed down, even through additional <*ant*> tasks with inheritAll set to false (see above).
Used to choose references that shall be copied into the new project, optionally changing their id.
|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|
Since Ant 1.6.
You can specify a set of properties to be copied into the new project with propertysets.
Since Ant 1.6.3.
You can specify multiple targets using nested
|name||The name of the called target.||Yes|
will run the target doSomethingElse and echo param1=value, whereas
will copy the parent’s definition of path1 into the new project using the id path2.