peterreilly 2003/11/24 08:36:35 Modified: docs/manual/CoreTasks Tag: ANT_16_BRANCH presetdef.html Log: sync with head Revision Changes Path No revision No revision 1.1.2.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.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- presetdef.html 6 Nov 2003 09:07:51 -0000 1.1.2.3 +++ presetdef.html 24 Nov 2003 16:36:35 -0000 1.1.2.4 @@ -18,6 +18,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> @@ -101,6 +106,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]