jhm 2004/04/20 07:45:26
Modified: docs/manual/CoreTasks macrodef.html
Log:
Document the use of @{attributes} inside <attribute/> definition.
Revision Changes Path
1.14 +30 -6 ant/docs/manual/CoreTasks/macrodef.html
Index: macrodef.html
===================================================================
RCS file: /home/cvs/ant/docs/manual/CoreTasks/macrodef.html,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- macrodef.html 25 Feb 2004 11:33:34 -0000 1.13
+++ macrodef.html 20 Apr 2004 14:45:26 -0000 1.14
@@ -1,5 +1,5 @@
<html>
-
+
<head>
<meta http-equiv="Content-Language" content="en-us"></meta>
<title>MacroDef Task</title>
@@ -9,18 +9,23 @@
-->
</style>
</head>
-
+
<body>
-
+
<h2><a name="macrodef">MacroDef</a></h2>
<h3>Description</h3>
<p>
- This defines a new task using a <sequential>
+ This defines a new task using a <sequential>
nested task as a template. Nested elements <attribute> and
<element> are used to specify attributes and elements of
the new task. These get substituted into the <sequential>
task when the new task is run.
</p>
+ <h3>Note</h3>
+ <p>
+ You can also use <i>prior defined</i> attributes for default-values in
+ other attributes. See the examples.
+ </p>
<p>
<em>since Ant 1.6</em>
</p>
@@ -183,7 +188,7 @@
<td valign="top" align="center">No</td>
</tr>
</table>
-
+
<h3>Examples</h3>
<p>
The following example defined a task called testing and
@@ -266,10 +271,29 @@
</echotest>
</pre>
</blockquote>
+ <p>
+ The following uses a prior defined attribut for setting the
+ default value of another. The output would be
+ <tt>one=test two=test</tt>. If you change the order of lines
+ *1 and *2 the output would be <tt>one=test [EMAIL PROTECTED]</tt>,
+ because while processing the <i>two</i>-line the value for
+ <i>one</i> is not set.
+ </p>
+ <blockquote>
+<pre class="code">
+<macrodef name="test"/>
+ <attribute name="one"/> <b>*1</b>
+ <attribute name="two" default="@{one}"/> <b>*2</b>
+ <sequential>
+ <echo>[EMAIL PROTECTED] [EMAIL PROTECTED]</echo>
+ </sequential>
+</macrodef/>
+<test one="test"/>
+</pre>
+ </blockquote>
<hr>
<p align="center">Copyright © 2003-2004 Apache Software
Foundation. All rights Reserved.</p>
</body>
</html>
-
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]