Runs Ant on a supplied buildfile.

This can be used to build subprojects. This task must not be used outside of a target if it invokes the same build file it is part of.

When the attribute is omitted, the file "build.xml"; in the supplied directory ( attribute) is used.

If no attribute is supplied, the default target of the new project is used.

By default, all of the properties of the current project will be available in the new project. Alternatively, you can set the attribute to 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 property tags. These properties are always passed to the new project and any project created in that project regardless of the setting of . This allows you to parameterize your subprojects. Properties defined on the command line cannot be overridden by nested elements.

References to data types can also be passed to the new project, but by default they are not. If you set the inheritrefs attribute to true, all references will be copied, but they will not override references defined in the new project.

Nested elements can also 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 that have been defined outside of targets in the new project - but not those defined inside of targets.

java.io.File the buildfile to use. Defaults to "build.xml". This file is expected to be a filename relative to the dir attribute given. java.io.File the directory to use as a basedir for the new Ant project. Defaults to the current project's basedir, unless inheritall has been set to false, in which case it doesn't have a default value. This will override the basedir setting of the called project. java.lang.String the target of the new Ant project that should be executed. Defaults to the new project's default target. java.io.File Filename to write the ant output to. This is relative to the value of the dir attribute if it has been set or to the base directory of the current project otherwise. boolean Whether to inherit properties. If , pass all properties to the new Ant project. Defaults to . boolean Whether to inherit references. If , pass all references to the new Ant project. Defaults to . Pass an explicit property value to the new Ant project.

See the description of the task.

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 , , tasks with inheritAll set to (see above).

Note that the refid attribute points to a reference in the calling project, not in the new one.

Pass an explicit reference value to the new Ant project. Used to choose references that shall be copied into the new project, optionally changing their id. java.lang.String The id of the reference in the calling project. java.lang.String The id of the reference in the new project. Defaults to the value of . You can specify a set of properties to be copied into the new project with s. Call an explicit target. You can specify multiple targets using nested elements instead of using the target attribute. These will be executed as if Ant had been invoked with a single target whose dependencies are the targets so specified, in the order specified. java.lang.String The name of the called target.

The value of the new project is affected by the two attributes and , see the following table for details:

dir attribute inheritAll attribute new project's basedir
value provided true value of dir attribute
value provided false value of dir attribute
omitted true basedir of calling project (the one whose build file contains the <ant> task).
omitted false basedir attribute of the <project> element of the new project
The build file of the calling project defines some elements like this: 2000-2005