On Thu, 5 Jul 2001, <[EMAIL PROTECTED]> 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

Reply via email to