![](https://csdnimg.cn/release/download_crawler_static/5215155/bg3.jpg)
Tutorials Point, Simply Easy Learning
3 | P a g e
<target name="pacakge" depends="clean,compile">
....
</target>
<target name="clean" >
....
</target>
<target name="compile" >
....
</target>
The target element has the following attributes:
The name of the target (Required)
Comma separated list of all targets that this target depends on. (Optional)
A short description of the target. (optional)
Allows the execution of a target based on the trueness of a conditional
attribute. (optional)
Adds the target to the dependency list of the specified Extension Point. An
Extension Point is similar to a target, but it does not have any tasks.
(Optional)
Ant - Property Task
Ant build files are written in XML, which does not cater for declaring variables as you do in your
favourite programming language. However, as you may have imagined, it would be useful if Ant
allowed declaring variables such as project name, project source directory etc.
Ant uses the property element which allows you to specify properties. This allows the
properties to be changed from one build to another. or from one environment to another.
By default, Ant provides the following pre-defined properties that can be used in the build file
The full location of the build file.
The version of the Apache Ant installation.
The basedir of the build, as specified in the basedir attribute of
the project element.
The version of the JDK that is used by Ant.