Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 25145 invoked from network); 10 Mar 2002 01:31:06 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 10 Mar 2002 01:31:06 -0000 Received: (qmail 27479 invoked by uid 97); 10 Mar 2002 01:31:11 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 27434 invoked by uid 97); 10 Mar 2002 01:31:10 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 27423 invoked from network); 10 Mar 2002 01:31:10 -0000 From: "Adam Murdoch" To: "Ant Developers List" Subject: RE: [myrmidon] PATCH: PropertyResolver service. Date: Sun, 10 Mar 2002 11:28:17 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <200203090304.g2934IN05531@mail008.syd.optusnet.com.au> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: Darrell DeBoer [mailto:darrell@apache.org] > Sent: Saturday, 9 March 2002 1:17 PM > To: Ant Developers List > Subject: Re: [myrmidon] PATCH: PropertyResolver service. > > > Hi, > > On Sat, 9 Mar 2002 12:02, Adam Murdoch wrote: > > Hi, > > > > Applied - thanks. > > Cool, thanks. > > > * Use Avalon's Context instead of PropertySet interface. Doesn't really > > seem worth adding yet another 'find this object by key' > interface, at least > > for the time being. Context is close enough. We need to > address the fat > > TaskContext vs a map of objects issue in a few other places as well, so > > let's hold off on PropertySet. Unless you see PropertySet evolving into > > something more than a single lookup method? > > Fair enough. I was trying to avoid having ContextExceptions being > thrown and > ignored/rethrown when the property wasn't present. And I didn't > really like > adding the rather mysterious: > public Object get( Object o ); > to DefaultTaskContext...;) > Yeah, it's a bit too general. Good enough for now, though. > > > > * ClassicPropertyResolver returns ${propname} for undefined properties, > > rather than an empty string. This is how Ant 1 behaves. > > Oops, thanks. > > I have a few questions moving forward: > * I'm starting to work on the Project and Target name validation, > basically > with a NameValidator component. > void validate( String name ) throws ????Exception > I guess we don't want a new Exception type for every component > (or at least > we don't have so far), but TaskException doesn't really fit. > Should we add a > ProjectException/AntException or something similar for these > cases? I don't think we want a global AntException. As a general plan, what might be useful is a base exception for each major reuse group (aut, myrmidon.interfaces, myrmidon.api) and a subclass of these for each API group (e.g aut.vfs, myrmidon.interfaces.deployer, etc). In the meantime, ProjectException might be good to add, to get thrown when something goes wrong building the project model. > (It looks > like ProjectBuilder just uses base java.lang.Exception, but is > this what we > really want?) > Nope. > * Continuing on with the PropertyResolution stuff, there have been some > interesting ideas on this list in the past day or 2. What are thoughts on > some things like: > > a) Syntax and behaviour for optional properties. Default behaviour is to > throw an Exception for undefined properties, but we could > possibly provide a > mechanism whereby $!{propertyName} could return null (or, say, > NULL_PROPERTY), and the configurer would simply ignore this attribute. > Yeah, possibly. I'd rather try tackling this using aspects, to keep this out of the core, and to avoid a whole bunch of cryptic property ref syntaxes. Aspects give us much greater scope for doing all kinds of stuff, on a per object basis (that includes objects nested at any depth), under the explicit control of the build-file writer. Downside will be that the syntax for doing stuff will be more verbose. That is, rather than you'd have to do something more like this: Of course, the verbose syntax gives us a bucketload more flexibility. for example, the element could have a set of nested condition elements e.g. , , , , some custom condition, etc. Or a bunch of nested resolver elements like , , , , etc. Not necessarily the kind of stuff we might include in the core, but certainly it could be made available with a quick of the appropriate antlib. > b) Now that properties are mutable by default, there are many cases where > we'll want behaviour similar to Ant1, whereby the value is only > set if the > property is undefined. I guess this can be done with a condition on the > property task, but something simple and clean would be good ( a > new task, or > option on Property task). > New task, I reckon. Let's keep the tasks bite-sized, with as few different behaviours as possible. > c) Different escaping behaviour. IMHO leaving a lone "$" sign would cause > less user confusion than silently removing it. The only time a > "$$" would be > needed would be to escape a property definition (eg "$${" or "$$!{") > +1 to this. Isn't DefaultPropertyResolver working this way already? > d) Properties scoped at the Workspace, Project and Target level. (I stole > this from "requested-features.html", but I'm sure there is a lot more to > it!). How would these be differentiated? If propX is defined at > the project > level, and then again in a target, is the project property hidden, or > modified (or is this disallowed)? > All of the above. There are valid use cases for each of these behaviours, so the trick is to come up with a model that lets the build file writer decide which behaviour is appropriate for each property usage. And to come up with a syntax that is as terse as possible, but expressive enough. We also have to decide how and fit into the model. > e) Recursive property resolution, like > srcdir="${build.${current-project}.dir}". > Not sure how useful this would be, but could always play around with it. > Looks like the code is ready to go, may as well switch it on. Adam -- To unsubscribe, e-mail: For additional commands, e-mail: