ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Ant Environment
Date Thu, 18 Mar 2010 10:06:43 GMT
You are right: you cannot change the values from Ant.
You could use the "setx" system command, so NEW processes will get the new values.
I dont know any possibility to change the environment for RUNNING processes.
Maybe via PowerShell, WindowsManagementInstrumentation, ... a la
   for(Projess p : allRunningProcesses) 
     p.setEnv(key, newValue) 


Jan

> -----Ursprüngliche Nachricht-----
> Von: Maurer Philipp [mailto:philipp.maurer@rheinmetall-ad.com] 
> Gesendet: Donnerstag, 18. März 2010 08:18
> An: user@ant.apache.org
> Betreff: Ant Environment
> 
> Hello,
> 
>  
> 
> I'd like to make ant modify my current shell environment on Windows
> maschines. 
> 
> 
> Example:
> 
> I'd like something like an 'ant set' (target 'set') that sets some
> 'foo=bar'. Calling that target should have the same effect 
> than calling
> 'set foo=bar'. 
> 
>  
> 
> I tried some stuff: calling python scripts, generating and executing
> batch files, using setx, using cmd /C set. 
> 
>  
> 
> I think this is a more general problem and I think it is not 
> possible at
> all (maybe someone could confirm this):  
> 
> All processes are forked or run in a separate shell and so in 
> a separate
> environment. Changing this environment does not affect the environment
> from which I'm calling ant.
> 
>  
> 
> Any ideas ? Windows-System calls ? Python calls ? 
> 
>  
> 
> Thanks,
> 
> Philipp
> 
>  
> 
>  
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message