ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <>
Subject Re: Immutability improvement patch
Date Mon, 03 Dec 2001 13:05:39 GMT
----- Original Message -----
From: "Peter Donald" <>
> > How about making Project have another constructor that takes a Hashtable
> > properties to initialize it with?  This would require some refactoring
> > Ant.initializeProject() so that it builds a temporary Hashtable of
> > properties and constructs (although the re-working of things might cause
> > some issues, not sure) the Project object using the properties
> > instead of the empty one.
> that sounds good to me ... but then again I am not the most familiar with
> this - Stefan ? Conor ?

Actually this turns out to be a bit of a mess.  I started digging into
making these changes.  Let me try to summarize what I've found:

- <ant>/<antcall> use the Property task internally to set properties to the
the new Project instance.

- To set the properties as user properties, they take advantage of
Project.setUserProperty - which I deprecated in my patch.

- We still need the rich features that the Property task gives us within the
context of <ant>/<antcall>, and we still need to be able to define those
properties as user properties on the new Project instance.

How do we get a Project initialized with user properties without going
through a deprecated API?

Project.setUserProperty is still the same.

Here are some thoughts on how to proceed:

- Un-deprecate the piece in Property.addProperty where it calls

- Keep setUserProperty deprecated (perhaps even remove it since only
<ant>/<antcall> relied on it, and it was never documented).

- Add a constructor: Property(boolean userProperty) - this would get called
from Ant.createProperty. - this would allow Property to set user properties,
but only if the boolean argument constructor argument was called with
"true" - not something that could be done with a build file <property>.

It seems that I stumbled upon some other roadblocks in this, but I can't
recall them at the moment.  Let me know if you think the above modifications
will do the trick.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message