ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <>
Subject Re: setting task attributes from properties
Date Thu, 29 Mar 2007 14:13:20 GMT
On 3/29/07, Steve Loughran <> wrote:
> Vladimir Egorov wrote:
> > I would like to change the value of a task attribute on the fly, without
> > editing Ant xml file, by setting a runtime system property like this:
> > [...]
> > Do Ant Users feel this would be useful to have in core Ant? Has anyone
> > asked for this? Is there an extension mechanism in Ant that can be used
> > to do this? Is there a property-to-xml convention that would take care
> > of the nested elements?
> Occasionally there are some 'magic' switches to change behaviour of
> javac, but otherwise they are left alone
> [...]
> 1. I see the value in the idea -we use it at work
> 2. I also think its very dangerous

Yes, this has been asked in the past Vladimir. And like Steve, I agree
that it would be a powerful tool, yet I'm not much in favor of it, at
least in the current state of Ant. Too make 2 analogies, what you are
asking for is a bit like (1) aspect oriented programming, where you
inject something into a class from the outside (attribute values into
tasks here), and like (2) CSS which allows to configure HTML elements
outside those elements.

If we could provide better traceability of properties in Ant, to know
where a property comes from, and which one were ignored (and from
where), then why not. Then we'd need to decide  which syntax to use to
inject properties in the right places only (XPath-like or CSS-like or
else?). I wouldn't want a naming convention on property names to do
that. Then it has to work ;-)

That's a lot of work, and even if we had all the above, I'd still
think it's dangerous, because then you can't know what the build will
do just looking at the build file, since part of the build is
somewhere else (the runtime effective config info). It's partly true
today with external property files, yet you can see explicitly in the
build file when a property is expected (that's one reason I never
really liked <presetdef>).

In short, I see the changes of such a mechanism going into Ant slim. --DD

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

View raw message