Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 60973 invoked from network); 20 Oct 2003 11:35:35 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 20 Oct 2003 11:35:35 -0000 Received: (qmail 33939 invoked by uid 500); 20 Oct 2003 11:35:31 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 33905 invoked by uid 500); 20 Oct 2003 11:35:30 -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 33883 invoked from network); 20 Oct 2003 11:35:29 -0000 Received: from unknown (HELO corvil.com) (213.94.219.177) by daedalus.apache.org with SMTP; 20 Oct 2003 11:35:29 -0000 Received: from preilly.local.corvil.com (preilly.local.corvil.com [172.18.1.173]) by corvil.com (8.12.9/8.12.5) with ESMTP id h9KBZRd8017022 for ; Mon, 20 Oct 2003 12:35:27 +0100 (IST) (envelope-from peter.reilly@corvil.com) From: peter reilly Organization: corvil To: Ant Developers List Subject: Re: Macrodef and parallel in a recursive situation Date: Mon, 20 Oct 2003 12:35:50 +0100 User-Agent: KMail/1.5 References: <747F247264ECE34CA60E323FEF0CCC0C5D08D0@london.cellectivity.com> In-Reply-To: <747F247264ECE34CA60E323FEF0CCC0C5D08D0@london.cellectivity.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310201235.50959.peter.reilly@corvil.com> 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 On Monday 20 October 2003 11:43, Jose Alberto Fernandez wrote: > Peter, > > sounds great. How does your implementation using threadLocal > works when going across or ? Just curious. The local properties do not cross to the ant/antcall project. They could but I figured that as they are "local", they do not need to. Peter > > Jose Alberto > > > -----Original Message----- > > From: peter reilly [mailto:peter.reilly@corvil.com] > > Sent: 20 October 2003 09:59 > > To: Ant Developers List > > Subject: Re: Macrodef and parallel in a recursive situation > > > > > > I have written the code to support local properties. > > While I was doing this, I realized that the attributes > > of a macrodef could/should be local properties as well, > > removing some of the issues seen last week (use of attribute > > in a bsf script and support of parallel/recursive). > > > > The following shows it in using a new task called local. > > > > > > > > > > > > prop1 is "${prop1}" > > > > > > prop1 is "${prop1}" > > > > > > > > This ant test2 generates the following: > > > > test1: > > prop1 is "a local value" > > > > test2: > > prop1 is "a global value" > > > > Each taskcontainer sets up a new local scope: > > > > > > > > > > > > prop2 is "${prop2}" > > > > prop2 is "${prop2}" > > > > > > will generate the following: > > sequential: > > prop2 is "in sequential" > > prop2 is "in target" > > > > The value part of is optional, and the local > > property may be set by a subsequent , > > will only set it if the value is not set. > > > > > > > > prop3 is "${prop3}" > > > > > > prop3 is "${prop3}" > > > > > > will generate the following: > > notset: > > prop3 is "${prop3}" > > prop3 is "is set" > > > > prop3 is still a local variable and will not be seen outside > > the target. > > > > The local properties are thread local so the following works > > as expected: > > > > > > > > > > > > t1: prop4 is "${prop4}" > > > > > > > > t2: prop4 is "${prop4}" > > > > > > > > t3: prop4 is "${prop4}" > > > > > > > > > > parallel: > > t2: prop4 is "thread2" > > t1: prop4 is "thread1" > > t3: prop4 is "thread3" > > > > Use with macrodef. > > ----------------- > > > > Attributes may now be implemented as local properties, which > > means that they will be seen as normal properties by ant > > tasks - including script. > > > > > > > > > > > > > > > > > > > > > > > > > > will generate: > > macro: > > x is 'this is x' > > > > Macrodef does not do the attribute substitutions so the following > > > > > > > > > > > > > > > > > > > > > > will generate: > > macro2: > > x is '${x}' > > as