Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
How to refer PATH environment variable in <exec > Ant task

How to refer PATH environment variable in <exec > Ant task

2006-12-03       - By peter reilly
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

On 12/2/06, Dominique Devienne <ddevienne@(protected)> wrote:
> On 12/2/06, Peter Reilly <peter.kitt.reilly@(protected)> wrote:
> > Perhaps we could add an attribute to property
> > to force the env names to be uppercasized:
> > <property environment="env" upcase="yes"/>
> >
> > so <echo>${env.PATH}</echo>
> > will always give the correct value
>
> This solves only one half of the problem however.
> One still needs to specify the path in <exec> using
> the correct case for the var name on Windows.
>
the other half is solved by the <env key being case
insensitive for ant 1.7 so:
<property environment="env" upcasekeys="yes"/>

..
..
 <exec ...>
     <env key="PATH" value="${env.PATH}${path.separator}${my_extra_path}"/>
...

would always work.

> We could I guess create properties with the names
> of the environment vars (using the env.NAME'sname
> convention, so one would do ${env.PATH's name} to
> get the actual name of the upper-cased PATH env. var),
> but that's a clunky, no?
Yep it is clunky..

Peter

>
> Maybe we need explicit <path> and <libpath> elements
> in <exec> to deal with such issues. --DD
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.