ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koegel, Michael" <>
Subject AW: Setting Properties for Scripts
Date Thu, 14 Feb 2002 15:51:48 GMT
I use the script task, so this is not gonna help me as <env ...> is not
available in script.


-----Urspr√ľngliche Nachricht-----
Von: Dominique Devienne []
Gesendet am: Donnerstag, 14. Februar 2002 16:43
An: 'Ant Users List'
Betreff: RE: Setting Properties for Scripts

Well, I don't think you can change the environment of the java process
running ANT by forking a child process running cmd.exe /c set name=value
(which is what would need to happen for your echo task to give the result
your hoping). What you can do an the other hand is change the environment of
the child process your start from ANT using <env> sub-elements of the <exec>
task. Below is an example that sets the Path (Note that the case is
important. Using PATH doesn't work on W2K and other Windows version I
suppose, and I banged my head on this one!), and other variables before
starting MS Visual Studio.

Also note that you should rely on the Path (that you adjust yourself in the
<env> element to find your executable, instead of specifying the absolute
path to it in the executable attribute, because in case that absolute path
contains a space, it doesn't work (ANT bug???).

I hope this helps. --DD

    <exec executable="msdev.exe"

      <arg value="/USEENV" />
      <arg value="build/msdev/MoWI.dsw" />

      <env key="Path"    path="${mowi.msdev.PATH};${env.Path}" />
      <env key="LIB"     path="${mowi.msdev.LIB}" />
      <env key="INCLUDE" path="${mowi.msdev.INCLUDE}" />

      <env key="DS_HOME"   file="${tahoe.home}" />
      <env key="JAVA_HOME" file="${java-dev-kit.home}" />


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message