ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Vernum <>
Subject RE: Two issues
Date Tue, 20 Feb 2001 06:15:52 GMT

> > There is no such thing as "local properties".
> > Properties to not have scope.
> > They are set when the <property> tag is met, and not changed again.

> That is strange, because that is not the bahavior that I am seeing.

I think it is.
Either you misunderstanding me, or I'm misunderstading you (or both)

>  As I stated in
> the original message, everything was working fine except for when I had a dependency
> among components.

It works find if you only call one target, because then you only set the property once.
But if you call two targets, then the propery is set in the first target, and NOT changed
in the second target.

> So, I set the property ${} in each component target and each one was
> generated correctly with its corresponding name. 

Yes, because you only executed *one* of those targets, and so the property worked correctly.

> The only time it was not generated
> correctly is when one component depended upon another, in that case the property was
> set to the first one that it came to.

Which is the correct behaviour as of Ant 1.2
Properties are set when the "<property>" tag is first "executed"
If the property tag is at the project level then it is set before any target is executed.
If the property is at the target level, then it is set (and retained) once that target is

> If there is no such thing as a local property, I wouldn't expect it to work at all.

There is no SCOPE on properties.
There is a time at which they are undefined, and then a time at which they are defined, and
nothing else.
They do not lose their definition, and they do not change their value.

> IMO, it doesn't make sense to have properties specified in a target if they are not
> scoped by the target...

Well MO is otherwise.
It makes a lot of sense to be able to set properties within targets.

>but I can live with that design decision, but it doesn't make
>sense at all to me to have partially working local properties.

The are not "partially working" they are completely working, they just don't behave the way
you expect.

View raw message