I have exactly the same approach.
The proposed task works also for several type of file (JAVA, JSP).
In this case we don't need to provide the value for the replacement. So we
do not care about the token value for the beginning, the end or even for the
line.
It is designed to add or remove a line/block comment.
It is a wrapping of this idea for a more general usage.
For this FAQ:
<!-- Activate the Cactus web.xml configuration -->
<copy todir="${admin.build.dir}/WEB-INF"
file="web/admin/WEB-INF/web.xml"
overwrite="yes">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.CommentOut"/>
</filterchain>
</copy>
<!-- Begin Cactus Configuration -->
<!-- @IF_BLOCK@ cactus.config
...
@IF_END@ cactus.config-->
<!-- End Cactus Configuration -->
It has for effect to disable the "cactus.config" condition.
Stephane.
-----Original Message-----
From: Erik Hatcher [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 14, 2002 11:55 AM
To: Ant Developers List
Subject: Re: [SUBMIT] FilterReader for compilation directives
How about this technique instead?
http://jakarta.apache.org/cactus/faq.html#faq2
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>