peterreilly 2003/11/24 08:35:31
Modified: docs/manual/CoreTasks presetdef.html
Log:
Clarify when properties are resolved when using presetdef
Revision Changes Path
1.4 +40 -0 ant/docs/manual/CoreTasks/presetdef.html
Index: presetdef.html
===================================================================
RCS file: /home/cvs/ant/docs/manual/CoreTasks/presetdef.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- presetdef.html 6 Nov 2003 09:04:08 -0000 1.3
+++ presetdef.html 24 Nov 2003 16:35:31 -0000 1.4
@@ -22,6 +22,11 @@
<p>
<em>since Ant 1.6</em>
</p>
+ <p>
+ The resolution of properties in any of the attributes or
+ nested text takes place with the definition is used and <em>not</em>
+ when the preset definition is defined.
+ </p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
@@ -105,6 +110,41 @@
</project>
</pre>
</blockquote>
+ <p>
+ The following is an example of evaluation of properties when the
+ definition is used:
+ </p>
+ <blockquote>
+<pre class="code">
+<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>
+</pre>
+ </blockquote>
+ <p>
+ The command ant defineandcall results in the output:
+ </p>
+ <blockquote>
+<pre class="code">
+defineandcall:
+[showmessage] message is '${message}'
+[showmessage] message is 'Message 1'
+
+called:
+[showmessage] message is 'Message 2'
+</pre>
+ </blockquote>
<hr></hr>
<p align="center">Copyright © 2003 Apache Software
Foundation. All rights Reserved.</p>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]