ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject [ant2] Propertys and strategies to deal with them
Date Sun, 17 Jun 2001 07:11:40 GMT

I was just wondering on how people think we should handle properties. 
Specifically there is a few interacting features that have to be decided 
before any property system could be built into Ant2. These are

1. How do we scope properties?
2. Are properties mutable or immutable?
3. Is there a difference between passed in parameters (via or 
CLI) and build file specified properties?
4. Should we allow declaration of variables without assignment?

By (1) I mean, are proeprties defined inside targets (or ContainerTasks) 
local to that target (or ContainerTask). There would still be some mechanism 
to set properties of "higher" level scopes but in general properties would be 
target specific.

By (2) I am asking whether we allow properties to be altered after being set 

(4) is not something that has been discussed much but it was something 
mentioned in requirements gathering phase but never really explored. 
Essentially what this means is that you could "declare" a variable at top 
level of project scope but set it at lower level scopes. 

>From my experiements I like the idea of scoping but found it impractical 
unless something like (4) is implemented (or some attribute allows you to 
"push" variable assignments up). Immutability is also something that would be 
good *but* it is impractical as done in Ant1 as can be seen by our own 
"distributions" target ;) It *could* work with something like (4) implemented 
(ie declaration of name is immutable and can only be assigned once) thought I 
am really not sure.

I would like to make "user" properties somehow different from "project" 
properties aswell. Essentially the difference would be when setting them. If 
a project property is set but a user property with same name exists then the 
project proeprty is silently ignored. (This would hold even if we assume 
immutable properties. In which case all other cases where a varaible is reset 
would raise an exception).



| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |

View raw message