ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: Is there a way to set environment variables inside ANT?
Date Thu, 22 Jan 2004 02:14:37 GMT
On Thu, 22 Jan 2004 12:15 pm, Matt Reason wrote:
> Is there an ant equivalent of:
> set PATH=%PATH%;C:\Program Files\TortoiseCVS
>
> I'm trying to do a CVS checkout in ANT on a windows machine.  CVS is not
> in my path.  I'd really like to add CVS to my path in the build.xml and
> not need to wrap the build.xml with a batch file.
>
> I would like to do something like this:
>
>   <exec executable="echo" newenvironment="true">
>    <env key="Path" Path="${myenv.Path};C:\Program Files\TortoiseCVS"/>
>   </exec>
>   <echoproperties/>
>
> But that does not work.  

The mechanism shoud be fine but your example probably doesn't work because 
echo is not a command - it is a builtin of the Windows cmd.exe shell. Also 
the path setting will only affect the command being executed. It does not 
"change" the path setting for other execs. IOW, I'm not sure what the 
echoproperties task is there for but it won't do much.

You should use the Path when you try to execute TortoiseCVS's command, or 
better still, if you know where it is, just execute it directly (this depends 
on whether TortoiseCVS requires the path to be set, of course).

Conor


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


Mime
View raw message