<exec> creates a new process and <env>s are passed to that process. When that has finished all environment settings are lost. There is no way to set env variables from ant ... with usual things.
Under windows is an executable called "setx" which you could try. Jan > -----Ursprüngliche Nachricht----- > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Gesendet am: Dienstag, 11. Januar 2005 16:58 > An: Ant Users List > Betreff: Environment variables > > Hi, > > I'm using ant to build visual studio solutions (simple > command line with > the <exec> task). > > We have 2 versions of visual studio .NET (unfortunately, we have to > maintain those 2 version). > > So, before running ant to build the solution, we have to set > up specific > environment variables for > the version of .NET we are using (for those who know .NET, we > just call > vsvars32.bat) > > When I integrate the call to vsvars32.bat to set the > variables (<exec> > task again), the env-vars are not persistant, meaning > that when the exec task to build the solutions is called, the > environment > variables are simply not set and > the solution would not build. we have to call vcvars32.bat > outside of ant, > and then it works. > > Is there something i am missing or why do the variables > disappear from one > exec task to the other? Can > someone suggest what can be done? > > Thanks in advance > > -- > Gilbert Jeiziner >