ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: New import tag update
Date Wed, 10 Jul 2002 14:26:22 GMT
Now we're getting somewhere!  :))

I'm still thinking the syntax and such is not quite ideal, but certainly
there are constraints that you need to work within to get it into the Ant1.x
API.  This is where I think the API needs refactoring, so that its the API
that supports these concepts directly, and the syntax on top is just icing.

Thanks Nicola... nice stuff.

    Erik

----- Original Message -----
From: "Nicola Ken Barozzi" <nicolaken@apache.org>
To: "Ant Developers List" <ant-dev@jakarta.apache.org>
Sent: Wednesday, July 10, 2002 9:56 AM
Subject: New import tag update


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


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