It works on XP.

--- rant.bat

setlocal
set foo=bar
call ant
echo on
Endlocal

--- build.xml

<project>
   <property environment="env"/>
   <echo>env.foo is ${env.foo}</echo>
</project>

--- output

C:\Projects\My Tools>rant

C:\Projects\My Tools>setlocal

C:\Projects\My Tools>set foo=bar

C:\Projects\My Tools>call ant
Buildfile: build.xml
     [echo] env.foo is bar

BUILD SUCCESSFUL
Total time: 0 seconds

C:\Projects\My Tools>endlocal

C:\Projects\My Tools>



-----Original Message-----
From: Jason [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 27, 2005 2:34 PM
To: user@ant.apache.org
Subject: Problem with Environment Variables on Win2000


Hello,

I've written an ant script on Linux and I'm now in the
process of trying to run it on windows and I've hit a
snag.  My general strategy is to launch ant on linux
from a shell script in which I set several environment
variables like so:

export MY_VAR=foo

I than access these values through ant using the
<property environment="env"/> mechanism.  On linux
things work fine but when I port my shell script to a
bat file there are problems.  I am unable to access
the value of (for example) MY_VAR even though I've set
it in the bat file like so:  SET MY_VAR=foo.  I've
noticed that I am able to access 'standard'
environment variables (eg, Path) but the ones I set
explicity in the bat file which launches ant aren't
recongised.  Should this work?  Is there some work
around?  If anyone could set me straight, I'd
appreciate it.

-jason


                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to