ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Adams" <>
Subject Re: over-riding properties and the concept of scope
Date Thu, 05 Jul 2001 21:26:22 GMT
Yes, it's strange.  I believe there've been discussions to this effect on the list before,
though I can't be sure (being a newbie myself).

Also, it's my impression that this is one of the things that will change in Ant 2.  Under
the "Simplicity and Understandability" heading, the Ant2 feature list states:

- add scoping rules for properties so that not all of them will be inherited by sub-builds,
only those that have been specified explicitly. Fill in details once they've been sorted out.

Any of the ant-dev team wish to comment more on this?  It would be nice if properties worked
the way cascading style-sheets do.  The inner properties override the outer ones.  But if
I read the above correctly (in it's immature form), plans are to disallow any inheritence
in subprojects, unless the property is explicitly included in the subproject.  This almost
seems as counter-intuitive as the current system.


>>> 07/05/01 04:15PM >>>
As a new user to ant setting up build files for my first (large) project, one 
thing I find very strange and counter-intuitive is the idea that you can't 
over-ride the value of properties once they are set.

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.  

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.

Why does it work like this?  Does it strike anybody else as strange?


View raw message