ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu Bentot <mben...@arantech.com>
Subject RE: [ant] could/should <ant> task allow passing references?
Date Thu, 22 Nov 2001 11:42:14 GMT
> > Then every reference that's left from the parent project is copied
> > as is in the child, unless a reference with that name already exists
> > there.
> 
> This only works because Ant1 evaluates all id attributes while parsing
> the file - it would probably become difficult to maintain that
> functionality for Ant2.  At least an approach like this should look
> at the inheritall flag IMHO.
> 
Yeah, know that. Convenient in that case. I take it Ant2 will use a more
lazy approach (I don't know anything about ant2, I'm new here).
Anyway, I "added" support for inheritAll: if it's false, only the specified
references are passed.

> > I realize this is inconsistent with the way properties are handled,
> 
> But making it consistent with properties in the inheritall="true" case
> would certainly break a lot of build files (i.e. overwrite the child's
> class.path <path> with the one defined in the parent that has the same
> name).
> 
True.

Okay, patch file and test scripts. They generate the following output (any
way I can make it not fail for not having a refid in pathconvert?):

Buildfile: build.xml

echo:
     [echo] Calling subproject...
Overriding previous definition of reference to libpath2

echoInherit:
     [echo] subbuild.xml (inheritAll=true):
     [echo]   libpath0 (from build.xml)=/export/home/mattb/anttest/build.xml
     [echo]   libpath1 (already exists in
subbuild.xml)=/export/home/mattb/anttest/subbuild.xml
     [echo]   libpath2 (overriden by
build.xml)=/export/home/mattb/anttest/build.xml
     [echo]   libpath3 (parent
renamed)=/export/home/mattb/anttest/subbuild.xml
     [echo]   libpath4 (renamed from
build.xml)=/export/home/mattb/anttest/build.xml
     [echo] Calling subproject...
Overriding previous definition of reference to libpath2

echoNoInherit:
     [echo] subbuild.xml (inheritAll=false):
     [echo]   libpath1 (already exists in
subbuild.xml)=/export/home/mattb/anttest/subbuild.xml
     [echo]   libpath2 (overriden by
build.xml)=/export/home/mattb/anttest/build.xml
     [echo]   libpath3 (parent
renamed)=/export/home/mattb/anttest/subbuild.xml
     [echo]   libpath4 (renamed from
build.xml)=/export/home/mattb/anttest/build.xml
     [echo] Checking references in parent...
     [echo] libpath0 (implicitely passed to
subbuild.xml)=/export/home/mattb/anttest/build.xml
     [echo] libpath1 (already existed in
subbuild.xml)=/export/home/mattb/anttest/build.xml
     [echo] libpath2 (was overriden for
subbuild.xml)=/export/home/mattb/anttest/build.xml
     [echo] libpath3 (also existed in subbuild.xml,
renamed)=/export/home/mattb/anttest/build.xml

BUILD SUCCESSFUL

Total time: 1 second

Cheers,

Matthieu


 


Mime
View raw message