Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 54066 invoked from network); 13 Mar 2011 07:38:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Mar 2011 07:38:50 -0000 Received: (qmail 73930 invoked by uid 500); 13 Mar 2011 07:38:50 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 73764 invoked by uid 500); 13 Mar 2011 07:38:48 -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 73751 invoked by uid 99); 13 Mar 2011 07:38:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Mar 2011 07:38:47 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gudnabrsam@gmail.com designates 74.125.82.173 as permitted sender) Received: from [74.125.82.173] (HELO mail-wy0-f173.google.com) (74.125.82.173) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Mar 2011 07:38:38 +0000 Received: by wyb42 with SMTP id 42so3835195wyb.4 for ; Sat, 12 Mar 2011 23:38:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=8WLzZNjv2pNR7xFS19stSNLwvH/Xa6IYPK7w/qpZ6J0=; b=obKyuYdvazxH3LRsjtQ6vPt2FQltz4LX0TD6gCPmkSR7P01+XVnOxOO2dZlpsTnKu0 CNvBosLyQo4fi17jTPf1foUXLjf1dreNKE7XlcIGsmRWoaAtolhWHo1pBmc2hwC+nfis GwZMucvdlfDb3MYLzDETYBgc80Yijl9WtcW0M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=lqXyoAdgZocMfUT38MR4gIvENtACI1DQT82QbMLbcZTxI4PnqELKTclc8EpvzbajgM 2lRQt6uRL6PDoStKgHFdQTQZ9yHynpZkoqpIPOEbdkSYiZDJVujqds1MaQlwvZ3ObTWY 6yy/lIAa5FqstVc/kaFwWdWpE6Gco9bgrX2qk= MIME-Version: 1.0 Received: by 10.216.229.4 with SMTP id g4mr1313164weq.54.1300001898512; Sat, 12 Mar 2011 23:38:18 -0800 (PST) Received: by 10.216.177.198 with HTTP; Sat, 12 Mar 2011 23:38:18 -0800 (PST) Reply-To: gudnabrsam@gmail.com In-Reply-To: References: Date: Sun, 13 Mar 2011 01:38:18 -0600 Message-ID: Subject: Re: How to manage properties for identical tasks/macros run in parallel? From: Matt Benson To: Ant Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org You should see the task, whereby you can set up scoped property "shadowing." Matt On Sat, Mar 12, 2011 at 10:59 PM, Parag Doke wrote: > Any ideas anyone ? > Thanks in advance, > Parag Doke > Save paper, save trees. Do not print emails/documents unless > absolutely necessary. > > > > On Mon, Mar 7, 2011 at 12:52 PM, Parag Doke = wrote: >> Hello ant users. >> I am facing an issue with handling properties with calls to tasks/macros >> nested within the parallel task. More of a logical/approach related issu= e >> rather than anything with the tool itself. Here go the details: >> Using ant: >> Apache Ant version 1.8.1 compiled on April 30 2010 >> With Java: >> java version "1.6.0_22" >> Java(TM) SE Runtime Environment (build 1.6.0_22-b04) >> Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing) >> The most relevant part of the build.xml: >> =A0=A0 =A0 =A0 =A0 >> =A0=A0 =A0 =A0 =A0 =A0 =A0 >> =A0=A0 =A0 =A0 =A0 =A0 =A0 >> =A0=A0 =A0 =A0 =A0 =A0 =A0 >> =A0=A0 =A0 =A0 =A0 =A0 =A0 >> =A0=A0 =A0 =A0 =A0 >> mySleep is my own macro with the following declaration: >> =A0=A0 =A0 >> =A0=A0 =A0 =A0 =A0 >> =A0=A0 =A0 =A0 =A0 >> =A0=A0 =A0 =A0 =A0 =A0 =A0 >> =A0=A0 =A0 =A0 =A0 =A0 =A0 >> =A0=A0 =A0 =A0 =A0 =A0 =A0Now working with ${myProp} >> =A0=A0 =A0 =A0 =A0 >> =A0=A0 =A0 >> Since properties are immutable, if it so happens that the 4th macro call >> sets the property, the rest of them cannot modify it. A quick alternativ= e to >> this might be using the variable task (in place of property) from >> ant-contrib.sf.net. However, the above is just an example. In reality, m= y >> macro does an exec call. The outputproperty attribute to the exec call w= ill >> be what I need to process later. >> So I guess my questions are: >> 1) What is the best approach to handle properties/variables for (almost) >> identical macro calls ? I cannot modify the property name each time. I c= ould >> redirect stdout/stderr of the exec task to some file. But not sure how t= o >> guarantee that the file will be unique and not get overwritten if 2 task= s >> finish at the same instant of time. >> 2) Can the outputproperty value be captured in a variable directly ? I r= ead >> that it is possible to use the ant-contrib propertycopy task to get one >> property value into another. But then there is a risk that the copy migh= t >> not be synchronized ... >> The last option I have is of course to get rid of the parallel task and = let >> the macros run one after the other. But that would be modifying the >> requirement to suit the scripting limitation I've run into. So I thought= of >> asking here before jumping on any implementation. >> Thanks in advance for any pointers, >> Parag Doke >> Save paper, save trees. Do not print emails/documents unless absolutely >> necessary. >> > > --------------------------------------------------------------------- > 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