From a77432f1aa2b458b61dd1435f177c4e6a4bad82f Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Mon, 24 Nov 2003 16:35:31 +0000 Subject: [PATCH] Clarify when properties are resolved when using presetdef git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275673 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/presetdef.html | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/docs/manual/CoreTasks/presetdef.html b/docs/manual/CoreTasks/presetdef.html index 166d643af..71be361eb 100644 --- a/docs/manual/CoreTasks/presetdef.html +++ b/docs/manual/CoreTasks/presetdef.html @@ -22,6 +22,11 @@

since Ant 1.6

+

+ The resolution of properties in any of the attributes or + nested text takes place with the definition is used and not + when the preset definition is defined. +

Parameters

@@ -105,6 +110,41 @@ </project> +

+ The following is an example of evaluation of properties when the + definition is used: +

+
+
+<target name="defineandcall">
+   <presetdef name="showmessage">
+      <echo>message is '${message}'</echo>
+   </presetdef>
+   <showmessage/>
+   <property name="message" value="Message 1"/>
+   <showmessage/>
+   <antcall target="called">
+      <param name="message" value="Message 2"/>
+   </antcall>
+</target>
+<target name="called">
+   <showmessage/>
+</target>
+
+
+

+ The command ant defineandcall results in the output: +

+
+
+defineandcall:
+[showmessage] message is '${message}'
+[showmessage] message is 'Message 1'
+
+called:
+[showmessage] message is 'Message 2'
+
+

Copyright © 2003 Apache Software Foundation. All rights Reserved.