ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject New import tag update
Date Wed, 10 Jul 2002 13:56:22 GMT
I've modified the import tag to be able to override targets, and I'm 
writing the part in which it can call a "super" target, ie the version 
it's redefining.

I was thinking of something like this:

Suppose this target:

<target name="mytarget" depends="a,b,c">...</target>

in an xsl-like syntax it would be like:

<target name="mytarget">
   <dostuff1/>
   <apply-import/>
   <dostuff2/>
</target>

but I was thinking of reusing antcall and do:

<target name="mytarget">
   <dostuff1/>
   <antcall target="super.mytarget"/>
   <dostuff2/>
</target>


Apart from the fact that a naming rule is good or not, I had to look in 
CallTarget.java, and I find this:

     public void execute() throws BuildException {

         ...

         callee.setDir(getProject().getBaseDir());
         callee.setAntfile(getProject().getProperty("ant.file"));
         callee.setTarget(subTarget);
         callee.setInheritAll(inheritAll);
         callee.setInheritRefs(inheritRefs);
         callee.execute();
     }

I'm creating a new Project just to run a target?
Why? Is it really necessary?

Can't I just do

  subTarget.execute();

?

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


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


Mime
View raw message