SE450: Ant: The build file - intro to XML [22/41] Previous pageContentsNext page

The build file is written in XML. This means that it has to conform to XML rules, as well as be properly configured for what Ant expects.

Some XML basics.

The Ant build file structure.

project
  property
  property
  target
    task
    task
  target
    task
    task

Properties are settings that you use throughout your build file. They are set, and then dereferenced in the build file by using the following syntax: ${property}

A build file consists of multiple targets. Targets can be dependent on one another so they are always run in the correct order. For example, you would always need to run an init target that makes directories where your javadoc will go.

A target consists of multiple tasks. Ant contains built-in tasks for some of the following:

It also has optional tasks for things such as:

Previous pageContentsNext page