Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 71135 invoked from network); 23 May 2004 23:15:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 May 2004 23:15:19 -0000 Received: (qmail 84185 invoked by uid 500); 23 May 2004 23:15:13 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 84022 invoked by uid 500); 23 May 2004 23:15:12 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 84007 invoked by uid 98); 23 May 2004 23:15:12 -0000 Received: from DDevienne@lgc.com by hermes.apache.org by uid 82 with qmail-scanner-1.20 (clamuko: 0.70. Clear:RC:0(134.132.72.99):. Processed in 0.122136 secs); 23 May 2004 23:15:12 -0000 X-Qmail-Scanner-Mail-From: DDevienne@lgc.com via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(134.132.72.99):. Processed in 0.122136 secs) Received: from unknown (HELO junior.lgc.com) (134.132.72.99) by hermes.apache.org with SMTP; 23 May 2004 23:15:12 -0000 Received: from lgchvw01.lgc.com (lgchvw01.lgc.com [134.132.93.107]) by junior.lgc.com (8.11.7/8.11.3) with SMTP id i4NNDp416467 for ; Sun, 23 May 2004 18:13:51 -0500 (CDT) Received: from 134.132.93.152 by lgchvw01.lgc.com (InterScan E-Mail VirusWall NT); Sun, 23 May 2004 18:14:57 -0500 Received: by lgchexchbh.ad.lgc.com with Internet Mail Service (5.5.2657.72) id ; Sun, 23 May 2004 18:14:57 -0500 Message-ID: From: Dominique Devienne To: "'Ant Users List'" Subject: RE: How to create paths that depend on a condition? Date: Sun, 23 May 2004 18:14:56 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain X-Spam-Rating: hermes.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > From: Vincent Massol [mailto:vmassol2@pivolis.com] > > Ok, I've found a solutiob but it looks really ugly: > > > > > > > > > > > > Any better solution? Maybe... If I understand correctly, you want to include the share-12-13-14 path element only if either j2ee1[34]* properties are defined. I haven't tested this, but I think I remember the 'path' attribute of will accept an empty value, simply ignoring it. So Should do what you want, is easy enough to read, and is pure Ant. --DD I'd rather have if/unless on all Ant elements, as I lament often, rather than rely on knowledge of edge cases behavior in though. I've created for my own task a Path-derivative that accepts nested s, with built-in if/unless/iftrue/unlessTrue/os/osFamily condition attributes, but it's only really useful in my own tasks only, unless you id/refid that Path, or when using the semi-official ant:type magic attribute (which still works only with tasks with add*(Path), and not the ones using create*(Path)). Anyways, I think your use case is yet more evidence for the usefulness of generalized if/unless. > > -----Original Message----- > > From: Vincent Massol [mailto:vmassol2@pivolis.com] > > > > I'd like to create a that depends on some property being > > defined or not. This is for putting inside the task. > > I cannot find the right combination. Here's what I'd like to do: > > > > > > > > > > ---> start here > > > > > > > > > > > > > > > > > > > > ---> stop here --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org