Nicola Ken Barozzi <[EMAIL PROTECTED]> wrote on 07/11/2002 05:00:18 PM:
As you may have seen, the import tag patch now supports redefining targets :-)
Suppose this target:
<target name="mytarget" depends="a,b,c"><dostuff/></target>
is in a file that is imported by my buildfile.
With the patch I can redefine it as follows:
<target name="mytarget"> <dostuff1/> <antcall target="super.mytarget"/>
Is super.mytarget a 'special' keyword? Given that you're 'redefining' that target (mytarget), what does antcalling it do? This is confusing IMHO for an end user.
Hmmm... It works like in java.
super. is a special prefix.
If I redefine mycooltarget two times I can call the first version via super.super.mycooltarget , and the second version super.mycooltarget .
Any suggestions on how it can be made better?
<dostuff2/> </target>
Now, mytarget currently does *not* inherit dependencies, although, having used the same name, it will effectively replace the old version in the graph.
Not inheriting dependencies vs inheriting them should really be a non issue. Either it replaces the old one completely or it doesn't, would be my take.
? It replaces it for sure, but dependencies are part of the old behaviour.
Other targets see the new one as the old one (replaces), but the new one doesn't automatically depend on the targets the old one depended on.
This is the order in which the targets are called, also with the outcome in case we enable dependency inheritance:
1 original mytarget: a->b->c->dostuff 2 redefined mytarget: dostuff1->a->b->c->dostuff->dostuff2
Makes sense.
3 dependency inherit: a->b->c->dostuff1->dostuff->dostuff2
Doesn't make sense.
I think so too.
IMHO (2) would be the outcome that users think comes out.
What do you think?
Yip.
:-D
--
Nicola Ken Barozzi [EMAIL PROTECTED]
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
