I have been watching this thread with interest since we use a modified ant
to provide an override feature.  I would love to get back to using the main
branch ant.  Ant is not nearly as useful to us without an override
functionality.

I modified the ant target to copy targets in parent build into the target
hash in the child build.  Of course same-name targets would get replaced.
This is okay with us since (1) we control all the build files and (2) we use
psuedo-namespace target and property names. (i.e. <target
name=org.apache.ant.compile>)  We just define a normal target in the "super"
build file and it automatically overrides "sub" build targets with the same
name.

I think we could migrate our modified ant to this override solution fairly
easily by making the first part of our target name the prefix.

One question about imports:  when would ant try to import the files.  When
our build process kicks off not all of the "sub" builds are necessarily
available.  Normally our sub projects are extracted or updated from cvs
during the build process.  Can the import be postponed to when the build
file is available?


P.S. Just want to thank all the developers for creating a great build tool.
Keep up the good work.

-----Original Message-----
From: Conor MacNeill [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 9:24 AM
To: Ant Developers List
Subject: Re: override


On Fri, 1 Aug 2003 10:47 pm, Nicola Ken Barozzi wrote:
> How can this thing be done while shielding interactions?
>

You make the renaming optional. 

<import file="a.xml"/>
<import file="b.xml"/>

All of a's and b's targets go unprefixed. If those builds use targets which 
are provided by the main build, or by the other, unprefixed, import then 
there is no problem. This situation thus allows the cross-interactions. We 
need to decide a few issues. Is mutliple definitions of a target considered 
an error or does one definition win. If one wins, which one - the first or 
the last. I prefer to have this as an error.

<import file="a.xml" prefix="a"/>
<import file="b.xml" prefix="b"/>

In this case each import's targets are prefixed and thus will not collide. 
Specific overriding in the build could make desired connections.

<override target="a.init">
        <antcall target="b.init"/>
</override>

Thoughts?

Conor



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to