You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Tim Ellison <t....@gmail.com> on 2006/03/06 17:58:08 UTC

using environment vars in Ant (was: Re: [jira] Created: (HARMONY-152) Security module native build incorrectly use PATH variable)

Matt Benson wrote:
> --- Alexey Petrenko <al...@gmail.com>
> wrote:
> 
>> 2006/3/3, Tim Ellison <t....@gmail.com>:
>>> How about we just remove references to ENV from
>> the Ant scripts ;-) ?
>>> That sounds like a very strange 'feature' of Ant
>> Why not use environment if it needed and accessible?
>> Even in ant... :)
> 
> Chiming in here to be sure there are no
> misunderstandings RE Ant's inclusion of environment
> variables... Your comment, Tim, sounds as though you
> thought ENV.* were automagically populated.  In fact,
> you must explicitly request this in your buildfile
> [1], and it doesn't matter if you prefix them as ENV.*
> or foobarbaz.* ... :)

Yep, I got that

> Finally, a common workaround (which I would suggest
> using should this issue recur):
> 
> <property environment="ENV" />
> <property name="ENV.PATH" value="${ENV.Path}" />

good idea.

> --if ENV.PATH already exists, it won't be overwritten.
>  If ENV.Path exists, it follows that ENV.PATH does
> not, so the contents of ENV.Path will be assigned to
> ENV.PATH and with one line we have alleviated the W2K
> problem.

I'm kinda allergic to environment vars in build scripts anyways, I'd
much prefer that the scripts were standalone as far as possible.

> HTH,
> Matt

Thanks
Tim

> http://ant.apache.org/manual/CoreTasks/property.html
> 
>> --
>> Alexey A. Petrenko
>> Intel Middleware Products Division
>>
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.