May 2002
Intermediate to advanced
288 pages
10h 50m
English
Shown
next is a generic buildfile good for using as a template. A buildfile
consists of the <project> element with its
nested <target>,
<property>, and
<path> elements.
<project default="all">
<property name="a.property" value="a value"/>
<property name="b.property" value="b value"/>
<path id="a.path">
<pathelement location="${java.home}/jre/lib/rt.jar"/>
</path>
<target name="all">
<javac srcdir=".">
<classpath refid="a.path"/>
</javac>
</target>
</project>Some notes about buildfiles to remember:
All buildfiles require the <project> element
and at least one <target> element.
There is no default value for the <project>
element’s default attribute.
Buildfiles do not have to be named build.xml.
However, build.xml is the default name for which
Ant searches.
You can have only one <project> element per
buildfile.
Read now
Unlock full access