ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <>
Subject Re: references: backwards compatibility
Date Mon, 16 Oct 2006 14:34:18 GMT
On 10/16/06, Dominique Devienne <> wrote:
> > I think some kind of property ant.policy.references.inline or something
> > could be set to turn on old behaviour
> We've somehow never done it, but maybe we should have a version
> attribute on <project>, and increment it whenever we introduce a BC
> breaking change?
> I'm not sure it's practical to provide both the old and new behavior
> when Ant changes some fundametal. Imagine having to support 1.5-style
> mix of parse-time and run-time element processing, instead of all UE a
> la 1.6?
> Something that we could do maybe in this case is gather at parse-time
> a list of all ids, and on using an unknown id, consult this list, and
> if finding a match, issue a more informative error message? Not great,
> but keeping the old and new behavior, especially when the old one was
> wrong, I'm not a bug fan of. --DD

I am at the moment working on a solution along this lines:

have an IdReferences that keeps track of the ids.
if an id cannot be resolved when using project.getReference(id),
check the id references and resolve it the old - fashioned way
with a warning:

<project default="x">
  <target name="y">
    <fileset dir="." id="y"/>
  <target name="x">
    <pathconvert property="myPath">
      <fileset refid="y"/>
    <echo>y is ${myPath}</echo>


WARNING: reference y has not been set, attempting to resolve

     [echo] y is C:\Documents and Settings\reilly\learning\a\refs\build.xml

The code is simple, except for the usually silliness around <*ant*>


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

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

View raw message