You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by query <se...@rediffmail.com> on 2007/04/19 15:25:39 UTC

Settting environment variables

  
 
Hi,

I am having a set of ANT build files. I want to change "Path" and "include" environment variables only in build file.
I tried the following options to reset "include" variable in the build file.

<property environment="env"/>     
1.<exec executable="cmd">
     <env key="include" path="${new.includepath}"/>
  </exec>
  
2.<property name="${env.include}" value="${new.includepath}"/>

3.<property name="env.include" value="${new.includepath}"/>

4.<property name="env.${include}" value="${new.includepath}"/>


When I tried to echo "include" variable in the same build file, it is still showing the default old settings.

Is there any other way to modify the environment variables only for some instance and not for other? 

Re: Settting environment variables

Posted by Martin Gainty <mg...@hotmail.com>.
true ..the immutable property primary contribution was in file property 
expansion and the ability for the value of an environment var to propagate 
to 'property'

If you're looking for the ability to change (a variable) in build.xml take 
look at ant-contrib 'variable'
http://ant-contrib.sourceforge.net/tasks/tasks/variable_task.html

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: <Ka...@thomson.com>
To: <us...@ant.apache.org>
Cc: <se...@rediffmail.com>
Sent: Thursday, April 19, 2007 10:11 AM
Subject: RE: Settting environment variables


Propertys in Ant are immutable, so you can't reset the value (with vanilla 
Ant - ant-contrib may let you).

Depending on what you need the system property for, though, you may be able 
to use <sysproperty>.

Kajsa

-----Original Message-----
From: query [mailto:search2006@rediffmail.com]
Sent: Thursday, April 19, 2007 8:26 AM
To: ant
Subject: Settting environment variables



Hi,

I am having a set of ANT build files. I want to change "Path" and "include" 
environment variables only in build file.
I tried the following options to reset "include" variable in the build file.

<property environment="env"/>
1.<exec executable="cmd">
     <env key="include" path="${new.includepath}"/>
  </exec>

2.<property name="${env.include}" value="${new.includepath}"/>

3.<property name="env.include" value="${new.includepath}"/>

4.<property name="env.${include}" value="${new.includepath}"/>


When I tried to echo "include" variable in the same build file, it is still 
showing the default old settings.

Is there any other way to modify the environment variables only for some 
instance and not for other?

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



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


RE: Settting environment variables

Posted by Ka...@thomson.com.
Propertys in Ant are immutable, so you can't reset the value (with vanilla Ant - ant-contrib may let you). 

Depending on what you need the system property for, though, you may be able to use <sysproperty>.

Kajsa

-----Original Message-----
From: query [mailto:search2006@rediffmail.com] 
Sent: Thursday, April 19, 2007 8:26 AM
To: ant
Subject: Settting environment variables

  
 
Hi,

I am having a set of ANT build files. I want to change "Path" and "include" environment variables only in build file.
I tried the following options to reset "include" variable in the build file.

<property environment="env"/>     
1.<exec executable="cmd">
     <env key="include" path="${new.includepath}"/>
  </exec>
  
2.<property name="${env.include}" value="${new.includepath}"/>

3.<property name="env.include" value="${new.includepath}"/>

4.<property name="env.${include}" value="${new.includepath}"/>


When I tried to echo "include" variable in the same build file, it is still showing the default old settings.

Is there any other way to modify the environment variables only for some instance and not for other? 

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