I did the same kind of thing recently (I sent a couple of emails to this
mailing list).
I was currently trying to implement it as a FilteredOutputStream as
suggested by Peter Donald.
I did not extend the MatchingTask (I missed it, I will look at it as well as
looking at replaceregexp).
I inspired myself a lot from the copy task to have support for fileset and
mapper.
Here are some examples of what I did:
<perlfilter file="test.run.out" tofile="test.out" overwrite="true"
verbose="true">
<subst pattern=".*t" replacement="rr" />
</perlfilter>
<perlfilter tofile="test12.out" verbose="true" overwrite="true">
<fileset dir=".">
<include name="test.run1.out" />
<include name="test.run2.out" />
</fileset>
<subst pattern="/" replacement="\\" delimiter="#" />
</perlfilter>
<perlfilter todir="." verbose="true" overwrite="true">
<fileset dir=".">
<include name="test.run1.out" />
<include name="test.run2.out" />
</fileset>
<mapper type="merge" to="test.out" />
<subst pattern="/" replacement="\\" delimiter="#" />
<subst pattern=".*t" replacement="rr" />
</perlfilter>
Thomas
-----Original Message-----
From: Stefan Bodewig [mailto:[EMAIL PROTECTED]
Sent: Monday, December 03, 2001 2:57 AM
To: [EMAIL PROTECTED]
Subject: Re: Perl5 substitution task
On Sun, 02 Dec 2001, Mathias Herberts <[EMAIL PROTECTED]>
wrote:
> I was wondering if such a task had already been done and if not I
> would be willing to donate it to the Jakarta project for general
> use.
Take a look at the replaceregexp task in Ant's CVS - it uses an
abstraction on top of the regexp machine, so that you can chose (at
least) between ORO, Jakarta-Regexp and JDK 1.4.
It doesn't do all the things you've described, but could be modified
to do so (patches are welcome 8-).
Stefan
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>