I was just thinking the same thing. Actually, java.lang.Runtime's exec method is overloaded to take a string array with the environment vars set in name=value syntax. I've used this before.
Unfortuately, the Exec taskdef doesn't make use of this facility. Since many environment variables are pathnames, it would be very handy if ant used it's pathname conversion stuff to ensure paths worked on all platforms. Malcolm > -----Original Message----- > From: Julien Couvreur [mailto:[EMAIL PROTECTED] > Sent: 14 July 2000 22:30 > To: [EMAIL PROTECTED] Org > Subject: Controling the environment for exec tasks > > > > Hi, > > Somebody posted a message saying what he greatly enjoyed with Ant was the > possibility of not depending on the system environment (ie CLASSPATH > especially). > > You may want to call third-party scripts from ant, and these may > (and often) > need to run in a special environment. So it would be nice if exec could > specify env variables for the program that we exec. > > Unfortunately, maybe Java doesn't support changing environment > variables (it > only allows reading, via System.getXxx()). Would there still be a way of > doing this env variable setting ? > > > Julien Couvreur > RedCart, Enabling Digital Marketplaces. > http://www.redcart.com >
