ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stan Rosenberg" <ale...@mindspring.com>
Subject RE: Environment Property
Date Sun, 27 Jan 2002 06:16:30 GMT
Viraf,

What version of Ant are you running? Please, make sure that the environment
variable you are
trying to 'echo' is really contained in the environment and maybe remove the
dot in <property environment="env." /> so that it reads <property
environment="env" />

I tested this on Ant 1.4.1, and it works fine.

Cheers,

Stan

-----Original Message-----
From: Viraf Bankwalla [mailto:viraf_bankwalla@yahoo.com]
Sent: Sunday, January 27, 2002 12:22 AM
To: ant-user@jakarta.apache.org
Subject: Environment Property


Hi,

How do I test for the existence of an environment
variable ?  How do I take an action if a the variable
is defined ?

I assumed that:

  <property environment="env." />
  <property name="isdefined" value="${env.VARNAME}" />
  <echo message="isdefined: ${isdefined}" />

would disply

   isdefined:

however it displays

   isdefined: ${env.VARNAME}

If this is not the desired behaviour, the fix lies in
ProjectHelper::replaceProperties.

    fragment = (keys.containsKey(propertyName)) ?
(String) keys.get(propertyName)
       : "${" + propertyName + "}";


Thanks.

- viraf

__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message