Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 84771 invoked from network); 15 Oct 2004 13:10:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 15 Oct 2004 13:10:20 -0000 Received: (qmail 26807 invoked by uid 500); 15 Oct 2004 13:09:21 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 26666 invoked by uid 500); 15 Oct 2004 13:09:17 -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 26586 invoked by uid 99); 15 Oct 2004 13:09:15 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=EXTRA_MPART_TYPE,HTML_60_70,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [209.226.175.74] (HELO tomts20-srv.bellnexxia.net) (209.226.175.74) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 15 Oct 2004 06:09:14 -0700 Received: from athlon ([64.231.167.220]) by tomts20-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with SMTP id <20041015130910.JKFG25820.tomts20-srv.bellnexxia.net@athlon> for ; Fri, 15 Oct 2004 09:09:10 -0400 Message-ID: <007501c4b2b8$29f11ad0$0d02a8c0@athlon> From: "Rhino" To: "ant-user" Subject: Perform different target depending on *value* of property Date: Fri, 15 Oct 2004 09:09:11 -0400 MIME-Version: 1.0 Content-Type: multipart/related; type="multipart/alternative"; boundary="----=_NextPart_000_0071_01C4B296.A2BADBD0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0071_01C4B296.A2BADBD0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0072_01C4B296.A2BADBD0" ------=_NextPart_001_0072_01C4B296.A2BADBD0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I want to revise an existing script so that it does a different target = for each of several different *values* of a property. For example, if the property, which is named 'server' has a value of = "foo", I want the script to execute a target called "foo-upload". If the = value of 'server' is "bar", I want the script to execute a target called = "bar-upload". If the value of 'server' is "test", I want the script to = execute a target called "test-upload". Actually, although the target names begin with the server name, that is = more convenience than necessity; it isn't critical that the target names = start with the server name so I don't insist on that. I am running Ant 1.6.1 but would be willing to upgrade to a newer = version to accomplish this. I would also like to stay "pure Ant" if = possible but would still be interested in seeing solutions using = optional tasks or ant-contrib. I know that 'if' and 'unless' are the normal mechanisms for enabling = conditional execution of tasks but they only seem to work on the basis = of if a property is enabled or not, rather than on the VALUE of the = property. Rhino --- rhino1 AT sympatico DOT ca "There are two ways of constructing a software design. One way is to = make it so simple that there are obviously no deficiencies. And the = other way is to make it so complicated that there are no obvious = deficiencies." - C.A.R. Hoare ------=_NextPart_001_0072_01C4B296.A2BADBD0 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
I want to revise an existing script so that it does a different = target for=20 each of several different *values* of a property.
 
For example, if the property, which is named 'server' has a = value of=20 "foo", I want the script to execute a target called "foo-upload". If the = value=20 of 'server' is "bar", I want the script to execute a target called = "bar-upload".=20 If the value of 'server' is "test", I want the script to execute a = target called=20 "test-upload".
 
Actually, although the target names begin with the server name, = that is=20 more convenience than necessity; it isn't critical that the target names = start=20 with the server name so I don't insist on that.
 
I am running Ant 1.6.1 but would be willing to upgrade to a newer = version=20 to accomplish this. I would also like to stay "pure Ant" if possible but = would=20 still be interested in seeing solutions using optional tasks or=20 ant-contrib.
 
I know that 'if' and 'unless' are the normal mechanisms for = enabling=20 conditional execution of tasks but they only seem to work on the basis = of if a=20 property is enabled or not, rather than on the VALUE of the = property.
 
Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways = of=20 constructing a software design. One way is to make it so simple that = there are=20 obviously no deficiencies. And the other way is to make it so = complicated that=20 there are no obvious deficiencies." - C.A.R. Hoare
------=_NextPart_001_0072_01C4B296.A2BADBD0-- ------=_NextPart_000_0071_01C4B296.A2BADBD0--