ANT properties (1)

17 February 2008

A 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 task. For example, ${os.name} expands to the name of the operating system. This is a list of Ant built-in properties.

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.

del.icio.us:ANT properties (1)  digg:ANT properties (1)  spurl:ANT properties (1)  wists:ANT properties (1)  simpy:ANT properties (1)  newsvine:ANT properties (1)  blinklist:ANT properties (1)  furl:ANT properties (1)  reddit:ANT properties (1)  fark:ANT properties (1)  blogmarks:ANT properties (1)  Y!:ANT properties (1)  smarking:ANT properties (1)  magnolia:ANT properties (1)  segnalo:ANT properties (1)  gifttagging:ANT properties (1)

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)

Leave a Reply