Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 3461 invoked from network); 20 Apr 2004 14:45:29 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 20 Apr 2004 14:45:29 -0000 Received: (qmail 50884 invoked by uid 500); 20 Apr 2004 14:45:22 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 50846 invoked by uid 500); 20 Apr 2004 14:45:22 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 50832 invoked by uid 500); 20 Apr 2004 14:45:22 -0000 Received: (qmail 50828 invoked from network); 20 Apr 2004 14:45:22 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 20 Apr 2004 14:45:22 -0000 Received: (qmail 3421 invoked by uid 1694); 20 Apr 2004 14:45:26 -0000 Date: 20 Apr 2004 14:45:26 -0000 Message-ID: <20040420144526.3420.qmail@minotaur.apache.org> From: jhm@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/docs/manual/CoreTasks macrodef.html X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N jhm 2004/04/20 07:45:26 Modified: docs/manual/CoreTasks macrodef.html Log: Document the use of @{attributes} inside 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 @@ - + 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 @@ -266,10 +271,29 @@ </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"/>
  +
+

Copyright © 2003-2004 Apache Software Foundation. All rights Reserved.

- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org