Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 28071 invoked from network); 27 Mar 2008 07:19:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Mar 2008 07:19:57 -0000 Received: (qmail 96400 invoked by uid 500); 27 Mar 2008 07:19:53 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 96369 invoked by uid 500); 27 Mar 2008 07:19:53 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 96358 invoked by uid 99); 27 Mar 2008 07:19:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2008 00:19:53 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of peter.kitt.reilly@gmail.com designates 209.85.200.175 as permitted sender) Received: from [209.85.200.175] (HELO wf-out-1314.google.com) (209.85.200.175) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2008 07:19:12 +0000 Received: by wf-out-1314.google.com with SMTP id 27so3299392wfd.10 for ; Thu, 27 Mar 2008 00:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=ax//pcovtzsBNGKXWJO6Y81EME9YPDXO5CH/DW0VDHw=; b=p4/LNdcBVI7El+69cII/6u1ucWU6nEEiqZhRddVmaP3hvn1j4r6JMzC1gjbi4RVtgHTkVLfXEgjtQWMzRJpsmyvH14sGBtzcabMjyI+fCrtCtFuxyEnfvU2I5Jci48vJV0GaqQKreICPv3YSgUCHrlooGCk6iJNguUrWMt1cnaw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bjHUYE7TUNtEPATvD4SmnQvFdkHfUHn15LZUwrq9uooez736JtAsKmN2MMIXnwu/6xT1ROEgtJq1pQnVT8lNFtS//oECoonLT9/LYenpRVWxgCMUbaVPEvZguI4tgUMYyxxKJy7vAgEXpMXtBaE3QG3yoc5dw6JR5CrXzylrcz8= Received: by 10.143.161.3 with SMTP id n3mr907578wfo.32.1206602363342; Thu, 27 Mar 2008 00:19:23 -0700 (PDT) Received: by 10.142.144.1 with HTTP; Thu, 27 Mar 2008 00:19:23 -0700 (PDT) Message-ID: Date: Thu, 27 Mar 2008 07:19:23 +0000 From: "Peter Reilly" To: "Ant Users List" Subject: Re: Having problem using property to in macrodef if invoke for more than one time In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Mar 27, 2008 at 5:51 AM, CheeYang Chau wrote: > Hi, > > I love the macrodef task. However, it has a weakness. We must be very > careful if using property within the macrodef. I face problem with a > macrodef that is more complicated than the following example. I have > to use dirname and condition in my macrodef, but it cause problem if I > invoke macrodef for more than one time as the property has been set > for the first time. Here is an example that trying to replay the > situation I face: > > > > > > ${myvalue} > > > > > > > > > I expect the output should be > > [echo] venus > [echo] mars > > but it turn out: > > [echo] venus > [echo] venus > > I think this is a common issue using macrodef and there are some > temporary solution to pass a temporary property name to the macrodef. > This is not feasible in my situation as I need to pass more than 5 to > 10 properties to my macrodef. > > Some other solution is using local property but I couldn't find this > task. I am using ANT 1.7.0. > > Any solution? Please advice. Thank you very much. A common, if not so nice solution, is to use an attribute value as a property name. For example: ${myvalue.@{module}} Peter > > -- > Best regards, > Chau Chee Yang > > E Stream Software Sdn Bhd > URL: www.sql.com.my > SQL Financial Accounting > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org