diff --git a/docs/manual/CoreTasks/macrodef.html b/docs/manual/CoreTasks/macrodef.html index 4257ca40c..f94d02a82 100644 --- a/docs/manual/CoreTasks/macrodef.html +++ b/docs/manual/CoreTasks/macrodef.html @@ -1,5 +1,5 @@ - + MacroDef Task @@ -9,18 +9,23 @@ --> - + - +

MacroDef

Description

- 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.

+

Note

+

+ You can also use prior defined attributes for default-values in + other attributes. See the examples. +

since Ant 1.6

@@ -183,7 +188,7 @@ No - +

Examples

The following example defined a task called testing and @@ -264,6 +269,26 @@ <echotest> Hello world </echotest> + + +

+ The following uses a prior defined attribut for setting the + default value of another. The output would be + one=test two=test. If you change the order of lines + *1 and *2 the output would be one=test two=@{one}, + because while processing the two-line the value for + one is not set. +

+
+
+<macrodef name="test"/>
+   <attribute name="one"/>                     *1
+   <attribute name="two" default="@{one}"/>    *2
+   <sequential>
+      <echo>one=@{one}   two=@{two}</echo>
+   </sequential>
+</macrodef/>
+<test one="test"/>
 

@@ -272,4 +297,3 @@ Foundation. All rights Reserved.

-