To be acceptable to Ant, each build file must have a <project>
element as its root element.
A <project>
has three attributes. This standard deviates slightly from the Ant standard in that the "name" attribute is required and will be the same as the file name without the ".xml" extension.
Table 4.1. Project Attributes
Attribute | Description | Required |
---|---|---|
name | the name of the project. This attribute should be the same as the file name without the .xml extension. | Yes |
default | the default target to use when no target is supplied. | Yes |
basedir | the base directory from which all path calculations are done. This attribute might be overridden by setting the "basedir" property beforehand. When this is done, it must be omitted in the project tag. If neither the attribute nor the property have been set, the parent directory of the buildfile will be used. | No |
Ant allows that a description for the project can be provided as a top-level <description>
element. This description
will be included in the output of the ant -projecthelp
command. While this is optional for Ant, the description element is required by this standard.
Example description:
<description> This build file is used to build the Foo subproject within the large and complex Bar project. </description>