ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <umag...@rediffmail.com>
Subject Creating Filesets based on file contents
Date Mon, 15 Oct 2001 02:53:56 GMT

I have hacked some code so that we would be able to
create a patternset/fileset based on the contents of
the file.  For example, we can do:

<copy todir="/tmp">
  <fileset dir=".">
    <patternset id="foobar" >
      <include name="*.txt">
        <contains text="foo" ignorecase="no"/>
        <notcontains text="bar" ignorecase="yes"/>
      </include>
    </patternset>
  </fileset>
</copy>

I have also ensured that adding contains and/or
notcontains doesn't break backwards compatibility.

In what I have, the text that is to be searched for can
only be represented by the text itself and not a regexp 
pattern.  I think having a regexp pattern matcher would 
be more useful, but this will at least be a start.

Is this a nice way to create a fileset based on contents?
If not, where can we improve it?

Let me know if you want me to send across the patch.

Thanks,
Magesh
 


Mime
View raw message