diff --git a/manual/properties.html b/manual/properties.html index 3cfb82828..0c5eb2f29 100644 --- a/manual/properties.html +++ b/manual/properties.html @@ -28,13 +28,13 @@
Properties are key-value pairs where Apache Ant tries to expand ${key}
to value
at run time.
There are many tasks that can set properties, the most common one is +
There are many tasks that can set properties; the most common one is the property task. In addition properties can be defined via command line arguments or similar mechanisms from outside of Ant.
-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, i.e. once they have been +
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, i.e., once they have been defined they are available for any task or target invoked subsequently—it is not possible to set a property in a child build process created via the ant, antcall @@ -74,12 +74,12 @@
<project>
.ant.project.invoked-targets
<ant>
task ...) when invoking the current project.<project>
tag) the list will be empty if no target has
- been specified while it will contain the project's default target in this case for tasks
- nested into targets.<ant>
task, etc...) when invoking the current
+ project.<project>
tag) the list will be
+ empty if no target has been specified while it will contain the project's default target in
+ this case for tasks nested into targets.ant.java.version
9,
1.8,
1.7,
1.6,
1.5,
1.4,
1.3@@ -117,7 +117,7 @@ PropertyHelper and its delegates from the context of the Ant buildfile.
There are three sub-interfaces of Delegate
that may be useful to
- implement.
org.apache.tools.ant.property.PropertyExpander
is responsible for finding the
@@ -150,11 +150,10 @@
for setting properties.
This is the interface you'd implement if you want to provide your own storage independent
- of Ant's project instance—the interface represents the reading end. An example for
+ of Ant's project instance—the interface represents the writing end. An example for
this would be org.apache.tools.ant.property.LocalProperties
which
implements storage for local properties.
The default PropertyExpander
looks similar to:
In its default configuration Ant will expand the text $$
to a single $
and
suppress the normal property expansion mechanism for the text immediately following it,
- i.e. $${key} expands to ${key} and not value
even though
+ i.e., $${key} expands to ${key} and not value
even though
a property named key
was defined and had the value value. This can be
used to escape literal $
characters and is useful in constructs that only look like
property expansions or when you want to provide diagnostic output like in
In order to maintain backward compatibility with older Ant releases, a single $
character encountered apart from a property-like construct (including a matched pair of french
- braces) will be interpreted literally; that is, as $
. The "correct" way to specify this
+ braces) will be interpreted literally, that is, as $
. The "correct" way to specify this
literal character, however, is by using the escaping mechanism unconditionally, so
that $$
is obtained by specifying $$$$
. Mixing the two approaches yields
unpredictable results, as $$$
results in $$
.
This means you can't use easily expand properties whose names are given by properties, but +
This means you can't use easily expand properties whose names are stored in properties, but
there are some workarounds for older versions of Ant. Since Ant 1.8.0 using
the props Antlib you can
configure Ant to use the NestedPropertyExpander
defined there if you
need such a feature.
In its most simple form ${key} is supposed to look up a property
named key
and expand to the value of the property.
@@ -254,13 +253,13 @@ public class ToStringEvaluator implements PropertyHelper.PropertyEvaluator {
Any Ant type which has been declared with a reference can also its string value extracted by - using the ${toString:} operation, with the name of the reference listed after +
Any Ant type item which has been declared with a reference can also its string value extracted
+ by using the ${toString:} operation, with the name of the reference listed after
the toString:
text. The toString()
method of the Java
class instance that is referenced is invoked—all built in types strive to produce useful
and relevant output in such an instance.
For example, here is how to get a listing of the files in a fileset,
+
For example, here is how to get a listing of the files in a fileset:
<fileset id="sourcefiles" dir="src" includes="**/*.java"/> @@ -271,8 +270,8 @@ public class ToStringEvaluator implements PropertyHelper.PropertyEvaluator {Getting the value of a Reference with ${ant.refid:}
-Any Ant type which has been declared with a reference can also be used as a property by using - the ${ant.refid:} operation, with the name of the reference listed after +
Any Ant type item which has been declared with a reference can also be used as a property by + using the ${ant.refid:} operation, with the name of the reference listed after the
ant.refid:
text. The difference between this operation and ${toString:} is that ${ant.refid:} will expand to the referenced object itself. In most circumstances