+The project file format is very similar to that of Ant 1. The root element of
+the project file must be a <project>
element. It can
+take the following attributes:
+
Attribute | Description | Default Value |
---|---|---|
name | +The project name. | +The base-name of the project file, with the extension removed. | +
basedir | +The base directory for the project. The base directory is used + to resolve all relative file names used in the project file. + | +The directory containing the project file. | +
default | +The name of the default target. | +main |
+
version | +The project file version that the project is written for. | +None, must be 2.0 |
+
+A <project>
element can contain the following elements,
+in the order given below:
+
Project references allow the project to import, or reference, other projects.
+A <projectref>
element takes the following attributes:
Attribute | Description | Default Value |
---|---|---|
name | +The name to use to identify the referenced project. | +Required | +
location | +The path to the project file to reference. | +Required | +
+The targets of a referenced project can be used in the depends
list
+of a target in the referencing project, using the following syntax:
+project-name->target-name
. Here is a simple example:
Library imports allow the project to import the tasks and data-types from an
+antlib. An <import>
element takes the following attributes:
Attribute | Description | Default Value |
---|---|---|
library | +The name of the library to import. The ext directory
+ of the Myrmidon distribution is searched for a library file with
+ the given name, and an atl extension. |
+ Required | +
type | +The type of definition to import. Values include task ,
+ and data-type . |
+ None | +
name | +The name of the type to import. | +None | +
+If the type
and name
attributes are not provided,
+the entire contents of the antlib are imported.
+
The following example import the <my-task>
task from
+the my-tasks
antlib.
Implicit tasks are run before any of the project's targets are run. Any task
+can be used, including <property>
and data-type instances.
+Implicit tasks can be used to initialise the project. For example:
Targets have the same format as in Ant 1.x, though some of the behaviour
+is different. A <target>
element takes the following
+attributes:
Attribute | Description | Default Value |
---|---|---|
name | +The name of the target. | +Required | +
depends | +A comma-separated list of targets that this target depends on. + This list can contain targets from referenced projects. | +None | +
if | +Only execute this target if the specified property is set, and not
+ equal to false . |
+ None | +
unless | +Do not execute this target if the specified property is set, and not
+ equal to false . |
+ None | +
+The following table lists some of the current set of tasks. You can find
+example usages of these tasks in the sample project file
+src/make/sample.ant
.
+
Task | Description |
---|---|
fail | +Causes the build to fail. | +
if | +Conditionally executes a set of tasks. | +
load-properties | +Loads a set of properties from a file. | +
log | +Writes a log message. | +
property | +Sets a property. | +
try-catch | +Runs a set of tasks, with a provided error and clean-up handler. | +
converter-def | +Register a type converter. These are used when configuring a task + or data-type from attributes. | +
type-def | +Register a task or data-type. | +
import | +Register the contents of an antlib. | +
-The project file format is very similar to that of Ant 1. The root element of
-the project file must be a <project>
element. It can
-take the following attributes:
-
Attribute | Description | Default Value |
---|---|---|
name | -The project name. | -The base-name of the project file, with the extension removed. | -
basedir | -The base directory for the project. The base directory is used - to resolve all relative file names used in the project file. - | -The directory containing the project file. | -
default | -The name of the default target. | -main |
-
version | -The project file version that the project is written for. | -None, must be 2.0 |
-
-A <project>
element can contain the following elements,
-in the order given below:
-
Project references allow the project to import, or reference, other projects.
-A <projectref>
element takes the following attributes:
Attribute | Description | Default Value |
---|---|---|
name | -The name to use to identify the referenced project. | -Required | -
location | -The path to the project file to reference. | -Required | -
-The targets of a referenced project can be used in the depends
list
-of a target in the referencing project, using the following syntax:
-project-name->target-name
. Here is a simple example:
Library imports allow the project to import the tasks and data-types from an
-antlib. An <import>
element takes the following attributes:
Attribute | Description | Default Value |
---|---|---|
library | -The name of the library to import. The ext directory
- of the Myrmidon distribution is searched for a library file with
- the given name, and an atl extension. |
- Required | -
type | -The type of definition to import. Values include task ,
- and data-type . |
- None | -
name | -The name of the type to import. | -None | -
-If the type
and name
attributes are not provided,
-the entire contents of the antlib are imported.
-
The following example import the <my-task>
task from
-the my-tasks
antlib.
Implicit tasks are run before any of the project's targets are run. Any task
-can be used, including <property>
and data-type instances.
-Implicit tasks can be used to initialise the project. For example:
Targets have the same format as in Ant 1.x, though some of the behaviour
-is different. A <target>
element takes the following
-attributes:
Attribute | Description | Default Value |
---|---|---|
name | -The name of the target. | -Required | -
depends | -A comma-separated list of targets that this target depends on. - This list can contain targets from referenced projects. | -None | -
if | -Only execute this target if the specified property is set, and not
- equal to false . |
- None | -
unless | -Do not execute this target if the specified property is set, and not
- equal to false . |
- None | -
-The following table lists some of the current set of tasks. You can find
-example usages of these tasks in the sample project file
-src/make/sample.ant
.
-
Task | Description |
---|---|
fail | -Causes the build to fail. | -
if | -Conditionally executes a set of tasks. | -
load-properties | -Loads a set of properties from a file. | -
log | -Writes a log message. | -
property | -Sets a property. | -
try-catch | -Runs a set of tasks, with a provided error and clean-up handler. | -
converter-def | -Register a type converter. These are used when configuring a task - or data-type from attributes. | -
type-def | -Register a task or data-type. | -
import | -Register the contents of an antlib. | -