Properties are key-value-pairs where Apache Ant tries to expand key to value at runtime.
The key name is case-sensitive.
Properties:
Normally property values can not be changed, once a property is set, most tasks will not allow its value to be modified.
In general properties are of global scope.
The property name is case-sensitive.
${PropertyName}
Example in an attribute, for a “builddir” property with the value “build”:
${builddir}/classes.
build/classes.
Properties may be used in:
<project name="MyProject" default="dist" basedir=".">
<!-- set global properties -->
<property name="src" location="src"/>
<property file="myPropertyFile.properties" />
<import file="myPropertyFile.xml" />
......
:: Example
ant -f myBuildFile.xml -DpropertyName=value target
with a property file
ant -f myBuildFile.xml --propertyfile=build.properties
<property environment="env"/>
<echo message="ANT_HOME is set to = ${env.ANT_HOME}"/>
type %HOME%\antrc_pre.bat
echo antrc_pre.bat was called
SET USER=.......
SET PWD=........
See built-in-props