Java Reference
In-Depth Information
$ ant
Buildfile: build.xml
useless:
[echo] This example's usefulness: nil. OK?
BUILD SUCCESSFUL
Total time: 1 second
9.4.2.4
A task is something that must be done to build the target. There is no single
“task” tag; instead, each kind of task has its own tag 8 so there are many tags
referred to collectively as task tags .
There are dozens of standard task tags, but only a few of them are “every-
day.” We'll introduce a few of them here, and then talk about the tags that
don't fall into the project/target/task hierarchy.
Tasks
Standard task attributes.
All ant task tags have at least the three attributes:
id
A unique ID for the task (not required).
taskname
A name for the task, used in logging (not required).
description
A description of the task, used for comments.
The javac task. The javac task, not surprisingly, runs the Java compiler.
Note that since the Java compiler is written in Java and so is ant , there is no
VM launch overhead to running the compiler. This can make ant many times
faster than make simply for normal compiles.
The javac tag is one of the most complex in ant .
The javac task tag has a very large number of attributes, and may contain
quite a number of other tags within it. First off, it is sensitive to a property,
build.compiler , which may be used to specify that a particular Java compiler
version must be used. The use of this will come up later when we build part of
8. In fact, task tag names correspond to the names of the Java classes that implement them.
This will matter to you only if you wish to write your own ant tasks. We will not take you that
far in this topic.
Search WWH ::




Custom Search