Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 16080 invoked from network); 2 Jan 2008 22:04:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jan 2008 22:04:31 -0000 Received: (qmail 3617 invoked by uid 500); 2 Jan 2008 22:04:15 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 3589 invoked by uid 500); 2 Jan 2008 22:04:15 -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 3578 invoked by uid 99); 2 Jan 2008 22:04:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2008 14:04:15 -0800 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 Cyril.Sagan@sas.com designates 149.173.6.148 as permitted sender) Received: from [149.173.6.148] (HELO mercav05.na.sas.com) (149.173.6.148) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2008 22:03:52 +0000 Received: from merchub02.na.sas.com ([10.19.20.25]) by mercav05.na.sas.com with InterScan Message Security Suite; Wed, 02 Jan 2008 17:03:54 -0500 Received: from MERCMBX14.na.sas.com ([10.19.20.124]) by merchub02.na.sas.com ([10.19.20.25]) with mapi; Wed, 2 Jan 2008 17:03:54 -0500 From: Cyril Sagan To: Ant Users List CC: "troy.daniels@baesystems.com" Date: Wed, 2 Jan 2008 17:02:52 -0500 Subject: RE: Returning properties Thread-Topic: Returning properties Thread-Index: AchNglqN6XD1ozN+Q9OFL9onjl4slgAB9ctA Message-ID: <345520A34347BA49B798F70B218ACD130437A00DF8@MERCMBX14.na.sas.com> References: <40CBD611A793EA438464B91E749DD8B00361E85E@blums0017.alphatech.com> In-Reply-To: <40CBD611A793EA438464B91E749DD8B00361E85E@blums0017.alphatech.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Troy - You're having *exactly* the same problem I had three weeks ago. Here's the full thread from suggestions I got: http://www.opensubscriber.com/message/user@ant.apache.org/8193149.html The best solution I came up with was to use ant-contrib's , i= t can take a list of properties to return values back to the calling contex= t. I think you'll want something like: The one disadvantage of vs. is that does not support multiple nested like does= (in 1.7 at least). This isn't a huge problem, but caused me to introduce = more wrapper targets. Not sure if this will be an issue for you. Hope this helps. --Cyril -----Original Message----- From: Daniels, Troy (US SSA) [mailto:troy.daniels@baesystems.com] Sent: Wednesday, January 02, 2008 4:08 PM To: user@ant.apache.org Subject: Returning properties I have a pattern that is repeated several times, so I'm trying to extract it into separate tasks in a common build file. I think I'm running into problems because I'm trying to treat ant more like a functional language than it is. In several places, I have targets that look like this When ant tries to run generate-foo, it first runs check-foo-up-to-date, which sets foo-up-to-date if foo is up to date. If foo is up to date, the unless parameter means the generate-foo target isn't run and all is good. If I try to factor out the common parts, there are a few things that need to be parameterized, which prevents me from calling them with a simple depends attribute. Instead, I'm using antcall and the new targets look like with generate and check-up-to-date being the new, generic tasks. This appears to work, except that foo-up-to-date doesn't get updated in the original project, only the project associated with the antcall. Is there a good way to get the property back to the original project? I could do it with files and available, but I'd like something simple to put into the multiple copies of check-*-up-to-date. Troy --------------------------------------------------------------------- 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