ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.che...@ascentialsoftware.com
Subject RE: Perl5 substitution task
Date Mon, 03 Dec 2001 15:27:48 GMT
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:bodewig@apache.org]
Sent: Monday, December 03, 2001 2:57 AM
To: ant-dev@jakarta.apache.org
Subject: Re: Perl5 substitution task


On Sun, 02 Dec 2001, Mathias Herberts <Mathias.Herberts@iroise.net>
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:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message