On 2012-07-28, Nicolas Lalevée wrote:

> I start to like what I am doing which the AntDSL so I would like to
> modify a little bit the Ant API so I can avoid doing so work around.

Sorry, I haven't found the time to play with it.

> In AntDSL, I have introduced an expression language so do some basic
> computing: some math, some logical computation and string manipulation
> for now. It is intended to replace the property expansion in strings.

> Actually, the logical computation is already implemented in Ant: the
> Conditions tasks. So I have used them for the if/unless attributes of
> the target. I would like to take it back into Ant: [1]. I don't intend
> to replace the existing if/unless, just offer new Java API to Target.

I think the props Antlib can already do quite a bit of this.

> I would also like to be able to have expressions in task
> attributes. But Ant assumes these are always Strings. As far as I can
> tell, there are two places where it is assumed and it would be
> changed: RuntimeConfigurable and IntrospectionHelper. I have been able
> to work around RuntimeConfigurable and provide my own
> implementation. But IntrospectionHelper is final.

AFAIR this is not totally true, PropertyHelpers can return Objects and
they get picked up in the approriate places.  It is true that
PropertyHelpers are the only way to generate non-String values outside
of IntrospectionHelper, though.  This is rather limiting.

> I have not a patch to suggest, but I think the change would probably
> be about introducing an interface Evaluable, change everywhere from
> String to Object, and when we try to get the value of the attribute,
> if Evaluable call eval(), otherwise call .toString().

Do you see any chance to unify this with PropertyHelpers?

> The changes I suggest should obviously be backward compatible.

Not so obvious to me.  Aren't there any APIs that return String but
would return Object with your changes?

> [1] 
> http://svn.apache.org/repos/asf/ant/sandbox/antdsl/trunk/org.apache.ant.antdsl/src/org/apache/ant/antdsl/Target.java

I promise to take a closer look.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to