From 69d85ab035ac0f844d21d1b33e7f508820942277 Mon Sep 17 00:00:00 2001
From: Matthew Jason Benson
Ant will always expand properties before it passes the value of an -attribute to the corresponding setter method.
+attribute to the corresponding setter method. Since Ant 1.8, it is +possible to extend Ant's property handling +such that a non-string Object may be the result of the evaluation of a string +containing a single property reference. These will be assigned directly via +setter methods of matching type. Since it requires some beyond-the-basics +intervention to enable this behavior, it may be a good idea to flag attributes +intended to permit this usage paradigm. +The most common way to write an attribute setter is to use a
java.lang.String
argument. In this case Ant will pass
@@ -156,6 +163,13 @@ is more! If the argument of you setter method is
org.apache.tools.ant.types.Resource
+ org.apache.tools.ant.types.Resource
, Ant will
+ resolve the string as a java.io.File
as above, then
+ pass in as a org.apache.tools.ant.types.resources.FileResource
.
+ Since Ant 1.8
+ org.apache.tools.ant.types.Path
, Ant will tokenize
the value specified in the build file, accepting :
and
;
as path separators. Relative path names will be
diff --git a/docs/manual/tutorial-writing-tasks.html b/docs/manual/tutorial-writing-tasks.html
index 96ca63cc5..6e5a9b881 100644
--- a/docs/manual/tutorial-writing-tasks.html
+++ b/docs/manual/tutorial-writing-tasks.html
@@ -282,8 +282,10 @@ arguments of the set-method:org.apache.tools.ant.PropertyHelper
associated with the current Project.
+You can learn more about this class by examining Ant's Java API. In Ant 1.8 the
+PropertyHelper class was much reworked and now itself employs a number of helper
+classes (actually instances of the org.apache.tools.ant.PropertyHelper$Delegate
+marker interface) to take care of discrete tasks such as property setting, retrieval,
+parsing, etc. This makes Ant's property handling highly extensible; also of interest is the
+new propertyhelper task used to manipulate the
+PropertyHelper and its delegates from the context of the Ant buildfile.
+
<project name="MyProject" default="dist" basedir="."> diff --git a/docs/manual/usinglist.html b/docs/manual/usinglist.html index 8d6982ca7..014c0b34d 100644 --- a/docs/manual/usinglist.html +++ b/docs/manual/usinglist.html @@ -35,6 +35,7 @@ Tasks
Properties
Built-in Properties
+ Property Helpers
Example Buildfile
Token Filters
Path-like Structures