ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: override
Date Fri, 01 Aug 2003 15:14:31 GMT
> -----Original Message-----
> From: Conor MacNeill [mailto:conor@cortexebusiness.com.au]
> 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.

Me too. Should be an error, forcing the user of the imported files to
explicitly resolve the conflicts, thanks to renaming. Might be a little more
work, but tons more predictable, and will not surprise anyone.

> 
> <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?

I agree with Nicola Ken that using <antcall> is wasteful resource-wise, and
that what it should really be is:

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

I'm also starting to think that targets from a and b that do not conflict
should *not* be renamed, and that renamed targets from a and b should not be
call-able directly from the command line, but only from within the build
file itself, to compose them as shown above.

I already wrote about this, but I'll say again that nobody should be aware
of the renaming taking place but the build file that does the
importing/renaming.

> 
> Conor

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message