Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 93655 invoked from network); 24 Jan 2006 22:17:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Jan 2006 22:17:48 -0000 Received: (qmail 51018 invoked by uid 500); 24 Jan 2006 22:17:43 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 50967 invoked by uid 500); 24 Jan 2006 22:17:43 -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 50956 invoked by uid 99); 24 Jan 2006 22:17:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jan 2006 14:17:43 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [143.165.201.19] (HELO maplee.tiaa-cref.org) (143.165.201.19) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jan 2006 14:17:42 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Again: Checking for non-existence of environment variable Date: Tue, 24 Jan 2006 17:17:12 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Again: Checking for non-existence of environment variable Thread-Index: AcYhMdmtTnqDh9EKQpm3gK94JdFKZgAAeJ4w From: "Burgess, Benjamin" To: "Ant Users List" X-OriginalArrivalTime: 24 Jan 2006 22:17:13.0591 (UTC) FILETIME=[ED5BE870:01C62133] X-Loop-Check: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N You keep adding the ${} when only the property name is required. I assure you that all you need is this - just copy and paste it and test: Ben -----Original Message----- From: Sergei Dubov [mailto:sdubov@gmail.com]=20 Sent: Tuesday, January 24, 2006 5:02 PM To: Ant Users List Subject: Again: Checking for non-existence of environment variable I think this is finally what I've been struggling with. It doesn't seem=20 to work when the env variable actually exists. Here is my macro: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D ${env.DAVINCI_EXT} Cause: DAVINCI_EXT environment variable has not been set! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D And here is what I get trying to invoke it from basic task: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D serge@velocity ~/work/davinci-dev/davinci-master $ echo $DAVINCI_EXT serge serge@velocity ~/work/davinci-dev/davinci-master $ ant -f setup-user.xml setup-home Buildfile: setup-user.xml setup-home: [echo] serge BUILD FAILED C:\Documents and Settings\serge\My=20 Documents\work\davinci-dev\davinci-master\setup-user.xml:91: The=20 following error occurred while executing this line: C:\Documents and Settings\serge\My=20 Documents\work\davinci-dev\davinci-master\setup-user.xml:201: Cause: DAVINCI_EXT environment variable has not been set! Total time: 0 seconds =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I am using Cygwin on WinXP. Ant is 1.6.5. Any ideas would be really appreciated. Thanks again, -Serge Matt Benson wrote: > uh... no. Try it. Then reread > http://ant.apache.org/manual/CoreTasks/fail.html . >=20 > -Matt >=20 > --- Sergei Dubov wrote: >=20 >=20 >>The whole point is that ${env.NO_VALUE} will return >>${env.NO_VALUE} as=20 >>its value if it doesn't exist... >> >>-Serge. >> >>Burgess, Benjamin wrote: >> >>>Will work for you? >>> >>>Ben >>> >>>-----Original Message----- >>>From: Sergei Dubov [mailto:sdubov@gmail.com]=20 >>>Sent: Tuesday, January 24, 2006 3:48 PM >>>To: user@ant.apache.org >>>Subject: Checking for non-existence of environment >> >>variable >> >>>Hi guys, >>> >>>I am sure this question has been asked before. But >> >>I did my research and >> >>>found no answers whatsoever. >>> >>>Basically I am trying to check for existence of an >> >>environment variable. >> >>>And if it is not defined I want the script to >> >>fail. >> >>>> >>default=3D"echo-env"> >> >>> >>> >>> >>> ${env.NO_VALUE} >>> >>> >>> >>>Basically this will return "${env.NO_VALUE}". >>> >>>And potential check will think it >> >>actually HAS value. Is=20 >> >>>there any way to make Ant recognize that >> >>System.getenv("NO_VALUE")=20 >> >>>returns null? >>> >>>Thank you very much beforehand, >>> >>>Serge. >>> >>> >> > --------------------------------------------------------------------- >=20 >>>To unsubscribe, e-mail: >> >>user-unsubscribe@ant.apache.org >> >>>For additional commands, e-mail: >> >>user-help@ant.apache.org >> >>> >>> >>> > ************************************************************** >=20 >>>This message, including any attachments, contains >> >>confidential information intended for a specific >>individual and purpose, and is protected by law. If >>you are not the intended recipient, please contact >>sender immediately by reply e-mail and destroy all >>copies. You are hereby notified that any >>disclosure, copying, or distribution of this >>message, or the taking of any action based on it, is >>strictly prohibited. >> >>>TIAA-CREF >>> >> > ************************************************************** >=20 >>> >>> > --------------------------------------------------------------------- >=20 >>>To unsubscribe, e-mail: >> >>user-unsubscribe@ant.apache.org >> >>>For additional commands, e-mail: >> >>user-help@ant.apache.org >> >>> >> > --------------------------------------------------------------------- >=20 >>To unsubscribe, e-mail: >>user-unsubscribe@ant.apache.org >>For additional commands, e-mail: >>user-help@ant.apache.org >> >> >=20 >=20 >=20 > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around=20 > http://mail.yahoo.com=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org ************************************************************** This message, including any attachments, contains confidential information = intended for a specific individual and purpose, and is protected by law. I= f you are not the intended recipient, please contact sender immediately by = reply e-mail and destroy all copies. You are hereby notified that any disc= losure, copying, or distribution of this message, or the taking of any acti= on based on it, is strictly prohibited. TIAA-CREF ************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org