ANT properties (1)
17 February 2008A project in a build.xml can have a set of properties. This property has a name and a value. In which the name of the property is case-sensitive. Properties can be used in the value of task attributes. It is done by putting the property name between “${” and “}” in the attribute value. For example, if there is a “builddir” property with the value “build”, then this could be used in an attribute like this: ${builddir}/classes. At run-time this is resolved as build/classes.
Properties are unchangeable. If someone sets a property first, it is freezed for the rest of the build. Properties are also not variable. Properties can be compared with string constants in other languages.
Ant Built-in Properties
Ant provides access to all system properties as if they have been defined using a
basedir - the absolute path of the project’s basedir (as set with the basedir attribute of
ant.file - the absolute path of the buildfile.
ant.version - the version of Ant
ant.project.name - the name of the project that is currently executing; it is set in the name attribute of
ant.java.version - the JVM version Ant detected; For example, it can hold the values “1.2″, “1.3″, “1.4″ and “1.5″.
Please follow the next post on this topic.
Related Posts:
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: ANT properties (1)