Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 41643 invoked from network); 29 May 2008 07:01:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 May 2008 07:01:11 -0000 Received: (qmail 1818 invoked by uid 500); 29 May 2008 07:01:10 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 1779 invoked by uid 500); 29 May 2008 07:01:10 -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 1766 invoked by uid 99); 29 May 2008 07:01:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 May 2008 00:01:10 -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 gscokart@gmail.com designates 64.233.166.183 as permitted sender) Received: from [64.233.166.183] (HELO py-out-1112.google.com) (64.233.166.183) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 May 2008 07:00:22 +0000 Received: by py-out-1112.google.com with SMTP id a73so2284772pye.17 for ; Thu, 29 May 2008 00:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; 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=9QZ5XGY42Z8aM45ob2M+pRMfLVnWrJ3G65LepQ/4pXo=; b=xd5/F3Zsgi4G9pg0HMoTRLvrk99LjtHDaz0ZeBsg5RgndxysqxpvaimJQ+kV6iH6pUCmY8sj8tL0PdG1Vegf/s05/b2uwtV3OQVpRbz7+vXt3XBux8UIFqWb4H8tJtyZ+Izv4CwALEVDKa85oO3ovMfxUdspqsqYmT+vSeypCT4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=HixefCe9Ub+qEgj6n4E9vX6TA1Ka04lzzSLA3Q28n12in7lJrFhaBVhxIg9PWUSe7VveElex+bD7K0G57AagScxjDDGNQnqQipMgpFlzv+OriI4G6Gp4mbXWEMAtEoDXlhvsnh4xygdYCbCqvCCGWAX1Z3lQKG9GscWCpoOEH3M= Received: by 10.142.47.6 with SMTP id u6mr1427713wfu.159.1212044438024; Thu, 29 May 2008 00:00:38 -0700 (PDT) Received: by 10.142.225.2 with HTTP; Thu, 29 May 2008 00:00:37 -0700 (PDT) Message-ID: Date: Thu, 29 May 2008 09:00:37 +0200 From: "Gilles Scokart" To: "Ant Users List" Subject: Re: How can I "conditionall chooise" a target implementation? In-Reply-To: <345520A34347BA49B798F70B218ACD13055570535A@MERCMBX14.na.sas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <345520A34347BA49B798F70B218ACD13055570535A@MERCMBX14.na.sas.com> X-Virus-Checked: Checked by ClamAV on apache.org Wouldn't be possible to put an if="use.A" in every target of lib_A.xml, and have every target of A and B repeated in your generic with a dependency on the A and B implementation. Maybe you can also try to play with macro instead of target. You replace every target by a macro, and place them in A and B, inside a . Then n the generic script you put some generic target implementation that calls the macro. 2008/5/29 Cyril Sagan : > PROBLEM: I'm trying to develop a general build framework. In so doing, > I need some mechanism for to provide a "conditional implementation" > for a target. We cannot solve this problem using . > Can anyone suggest an implementation? > > > Here's a couple ways that I tried, that almost work,... but do not. > > All use this simple build.xml: > > > > > > > > Failing attempt #1: This almost works, but doesn't because > cannot be embedded inside a target!! arg! > > common.xml: > > > > > > > > > > > > > depends="init, use_lib_A, use_lib_B, all_impl" /> > > > > > Failing attempt #2: This would work, if Ant supported property expansion > in the targets's depends attribute. > > common.xml: > > > > > > > > > > > > > > > > > > > depends="init, use_lib_A, use_lib_B, ${use.library}.all_impl" /> > > > > > Failing attempt #3: Almost works, except the depends targets > always excute... > > common.xml: > > > > > > > > > > > > This gets us closest to what we want, and would suffice if we could > tolerate the : > > > > > ...but we can't use antcall because it re-reads the *entire* build > file. There's some fairly complicated init (that we don't have > control of) that doesn't tolerate being called multiple times. > > I'd appreciate any suggestions from the experts! > > Thanks. > > --Cyril > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > -- Gilles Scokart --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org