Hi Folks,
I want to set a property to the value of an environment variable if
that variable is set, otherwise to a different string.
I am able to do this with the following:
property environment=env /
property name=test.home.0 value=${env.TEST_HOME}/
condition
hello Kumar,
this is another alternative for the same :
property environment=env/
property name=env.TEST_HOME value=TO_BE_REPLACED/
might work.
Cheers,
Antoine
- Original Message -
From: Pankaj Kumar [EMAIL PROTECTED]
To: user@ant.apache.org
Sent: Tuesday, August 09, 2005 4:41 PM
Using the if task (from the ant-contrib project) you
can do it like this:
if
isset property=env.TEST_HOME/
then
property name=test.home
value=${env.TEST_HOME}/
/then
else
property name=test.home
value=TO_BE_REPLACED/
/else
/if
Though I am not
This will trim down the previous post
property name=test.home value=TO_BE_REPLACED/
if
isset property=env.TEST_HOME/
then
property name=test.home value=${env.TEST_HOME}/
/then
/if
-Original Message-
From: Ninju Bohra [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 09,
The second property will not work, because the property is already set
earlier. You may want to execute them in reverse order.
- Alexey.
[EMAIL PROTECTED] wrote:
This will trim down the previous post
property name=test.home value=TO_BE_REPLACED/
if
isset property=env.TEST_HOME/
Sorry, was thinking of NAnt
-Original Message-
From: Alexey N. Solofnenko [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 09, 2005 1:09 PM
To: Ant Users List
Subject: Re: How to test whether a particular environment variable is
set or not
The second property will not work, because
On 8/9/05, Antoine Levy-Lambert [EMAIL PROTECTED] wrote:
this is another alternative for the same :
property environment=env/
property name=env.TEST_HOME value=TO_BE_REPLACED/
Hi Antoine,
This works. It is also more compact and elegant (compared to my
version). Thanks.
/Pankaj.
-