ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: PATCH: Attributes of Target can reference properties
Date Tue, 19 Jun 2001 06:47:40 GMT

I've proposed something like your patch back in December 2000 - see

Most people didn't have problems to expand properties for target's
attributes at parser time (that is, only properties that have been
defined at the same level as targets and be placed before this target
would be expanded) - and this is what your patch does.  But this may
not be what people expect.  Given

<target name="set">
  <property name="dep" value=", foo">

<target name="bar" depends="set ${dep}">

wouldn't resolve dep.  We cannot allow dynamic expansion of the
property as this implies we'd have to rebuild the target dependency
graph.  Even worse, we might start building a project which has an
illegal build file (dep points to a target that in turn depends on bar
- so we have a cycle in the dependency graph that we couldn't detect
before we actually try to run target bar).

But you don't want dynamic property expansion either.

The problem here is, that we have moved property expansion from parser
time to runtime in Ant 1.2 (at least for tasks) and from the users
point of view targets will be executed at some point in time, but this
is not parser time.  This may be inconsistent, or not - don't know.
It probably is just a matter of proper documentation.

Finally, you are not only expanding properties in the depends
attribute, but also for the if/unless attributes - which is fine with
me, but users will expect runtime instead of parser time here! - and
the name attribute - which I'd -1 because it doesn't add any value
(except obfuscation).

All in all, I support parser time evaluation of the depends attribute
and the if/unless attributes - the later could be runtime evaluated,
but this would make things even less consistent.


View raw message