I again tried to set PATH and INCLUDE env variables. But when I echo the env
variables after modifying the variables, changes are not reflected in the log
file.
My ANT script change is:
property environment="env"/>
<exec executable="cmd">
<env key="include" path="${new.includepath}"/>
</exec>
<echo message ="include=${env.include}"/>
Similarly I have tried for Path env variable. But it is not working.
If there is any other way to set variables, please let me know. Due to this
issue, it is hampering my work.........
Note: Forwarded message attached
-- Original Message --
From: Ninju Bohra <[EMAIL PROTECTED]>
To: Ant Users List <user@ant.apache.org>
Subject: Re: Re: Settting environment variables
--- Begin Message ---
Hello,
Sorry about that...for <exec> the setting of evironment variables is done with
the <env> element...please read the documentation
(http://ant.apache.org/manual/CoreTasks/exec.html) for specific details.
Thanx
----- Original Message ----
From: query <[EMAIL PROTECTED]>
To: Ant Users List <user@ant.apache.org>
Cc: Ninju Bohra <[EMAIL PROTECTED]>
Sent: Friday, April 20, 2007 2:21:38 AM
Subject: Re: Re: Settting environment variables
When I tried to use <sysproperty> in <javac> and <exec> task, build
compilation is failing with the following errors.
javac doesn't support the nested "sysproperty" element.
exec doesn't support the nested "sysproperty" element.
It looks like that element is supported only with <java>.
But I want to set env variables for <javac> and <exec >tasks. Can anyone help
me ???????
On Thu, 19 Apr 2007 Ninju Bohra wrote :
>Hello,
>
>By the time ANT starts, the PATH and INCLUDE environment variables values are
>set (by the ant.bat or OS command script) and can not be altered.
>
>However if one you target needs to start seperate process (<exec>, <javac>,
><java>, etc...) you can control the value of the enviroment variables that the
>child process will have...use the <sysproperty> sub element to correct that.
>
>Hope that make sense????
>
>Ninju
>
>
>
>----- Original Message ----
> From: query <[EMAIL PROTECTED]>
>To: ant <user@ant.apache.org>
>Sent: Thursday, April 19, 2007 9:25:39 AM
>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?
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam? Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--- End Message ---
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]