ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: over-riding properties and the concept of scope
Date Fri, 06 Jul 2001 05:56:52 GMT
On Thu, 5 Jul 2001, <pdw@dowman.net> wrote:

> I have set up a project with some sub-projects that could be
> stand-alone, but can also be a called from a "meta" build-file that
> builds all sub-projects.  If I have variables with the same name in
> the main build-file they will over-ride the variable in the
> sub-build-file.

Yes, this has been identified as a problem of current Ant (one of
many, to be honest).  Ant2 will provide more control over which
properties are going to be passed to the subbuild - and maybe we'll
even have a backwards compatible solution for this problem in the Ant1
series.

> I find this to be counter-intuitive because it's exactly the
> opposite of the way variable scope normally works-- normally "inner"
> declarations override "outer" declarations.

Consider properties to be constants, just that it doesn't cause an
error when you try to change them.

The main reason for the current precedence rules (first definition
wins) was that properties specified on the command line should
override any later definition IIRC.

Stefan

Mime
View raw message