Looks interesting.
Cheers,
Antoine

----- Original Message -----
From: "Conor MacNeill" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to