ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject Re: Immutability improvement patch
Date Mon, 03 Dec 2001 23:34:15 GMT
From: "Erik Hatcher" <jakarta-ant@ehatchersolutions.com>

> 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.
> 

I agree the functionality needs to be maintained.

> 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
> setUserProperty.
> 

-1

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

Humm, what do we do with people that cut and paste from <ant> code :-(

> - 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>.
> 

-1, this would allow developers to write tasks that modify properties
which is exactly what we want to avoid.

> 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.
> 

If I recall properly, we need to be able to construct a list of properties
based on the merge of any user properties in the calling Project and
any new properties defined in the invocation.

This may require having a constructor with a signature like:

    public Project(Project caller, Hashtable userProps);

This constructor will take into account both set of properties.
Then the code as today can set any other properties that may be inherited.

What do you think?

Jose Alberto



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message