<property environment="env"/>
<property name="my.desired.prop" value="${env.WHATEVER}"/>
<property file="default.properties"/>

then define my.desired.prop in default.properties.  It will be "overridden"
(which is a weird term, when its actually being set first instead of being
overwritten).

That work for you?

    Erik


----- Original Message -----
From: "Steve Gardell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 28, 2002 2:27 PM
Subject: Overriding properties


> I would like to define default properties in a
> property file and then "override" them from the
> environment. I have found two mechanisms for
> accomplishing this. The first is to use the
> <condition> clause, the second is to use "if"
> and "unless" attributes on targets that do <property>
> tasks.
>
> Each approach is a little problematic. I have
> trouble testing the existence of a property in
> the first case (at least on windows) because
> undefined environment properties are reported
> as, for example: "env.optimize"
>
> The second approach works, but is leads to rather
> verbose log files with lots and lots of "stupid
> little" target executions.
>
> Any suggestions for doing an "if" test in the
> context of <condition> or silencing select
> target logging would be very welcome.
>
> Thanks
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to