ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Atherton <>
Subject Re: <property file="..." prefix="..."/> what to expand?
Date Fri, 18 Jun 2010 19:04:18 GMT
On 18/06/2010 7:48 AM, Dominique Devienne wrote:
> On Fri, Jun 18, 2010 at 2:47 AM, Stefan Bodewig<>  wrote:
>> On 06/17/2010 11:10 AM, Stefan Bodewig wrote:
>> Assume
>> x=x
>> y=${x}
>> and that there is no property x defined prior to
>>     <property file="..."/>
>> then ${y} will be "x".  Using
>>     <property file="..." prefix="foo"/>
>> ${foo.y} in Ant 1.8.0 is ${x} while it is "x" in 1.8.1 - the properties
>> file was able to refer to its own properties without knowledge of the
>> prefix.
> This feels "natural" to me, and ${foo.y}'s value being "${x}" surprising indeed.

I agree.

> But conversely, if property x is already defined, I'd expect that
> value to prevail, according to classic immutability rules.

I'm not sure I agree with this. If foo.x was previously defined I'd 
expect its value to prevail, but x? That doesn't make sense to me, since 
foo.y is really being set to foo.x as far as the build file is concerned.

> Can't property expansion in a property file be done "entirely" before
> the prefix is applied?

I would argue for the opposite (although I don't know how practical it 
is). Would it be possible for loadproperties to not only prefix the 
properties that are defined, but also the properties to be expanded? So 
"y=${x}" becomes "foo.y=${foo.x}"?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message