ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <anto...@antbuild.com>
Subject Re: override
Date Thu, 31 Jul 2003 12:11:03 GMT
Looks interesting.
Cheers,
Antoine

----- Original Message -----
From: "Conor MacNeill" <conor@cortexebusiness.com.au>
To: <dev@ant.apache.org>
Sent: Thursday, July 31, 2003 2:07 PM
Subject: override


> I'd like to take a slightly different angle on the <import> issue by
getting
> some thoughts on this little experimental task I wrote. I haven't cleaned
it
> up at all (lots of unused imports, inner classes etc). Anyway it lets you
> override any target in the build. e.g. This build file
>
> <project name="override" default="test">
>
>   <taskdef name="override"
> classname="org.apache.tools.ant.taskdefs.Override"/>
>   <taskdef name="super"
> classname="org.apache.tools.ant.taskdefs.Override$Super"/>
>
>   <override target="test">
>     <echo message="pre"/>
>     <super/>
>     <echo message="post"/>
>   </override>
>
>   <override target="test">
>     <echo message="pre2"/>
>     <super/>
>     <echo message="post2"/>
>   </override>
>
>   <target name="test">
>     <echo message="test"/>
>   </target>
>
> </project>
>
> produces the following output
> Buildfile: build.xml
>
> test:
>      [echo] pre2
>      [echo] pre
>      [echo] test
>      [echo] post
>      [echo] post2
>
> BUILD SUCCESSFUL
>
> :-)
>
> I think with a renaming <import> task this would let you override any part
of
> the build easily.
>
> BTW, note that simple renaming of targets is not enough. Any use of a
target
> name needs to be updated too (e.g. <antcall>). Can be done (at time of
use)
> but may require tasks knowing their import prefix. The import task will
need
> this to do cascade renaming.
>
> Anyway, just thought I'd throw it out there. Override might even be useful
in
> an entity includes approach.
>
> Comments?
>
> Conor
>


----------------------------------------------------------------------------
----


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



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


Mime
View raw message