ant-dev mailing list archives

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

On Mon, 15 Oct 2001 19:08, Jesse Glick wrote:
[snip]
> <copy todir="...">
>    <fileset dir="...">
>        <include name="..."/>
>        <selector type="org.netbeans.nbbuild.CvsFileSet"
>                  criterion="text"/>
>    </fileset>
></copy>
[snip]

If I interpret this right, you create a fileset using 
includes and excludes and then apply a selector on the 
resultant set as a whole.  What I am suggesting is we
do something of a much finer granularity:  We should be
able to apply a selector at every include/exclude level
like in:

<copy todir="...">
  <fileset dir="...">
    <include name="**/*.txt">
        <contains text="foo" ignorecase="no"/>
        <contains text="oof" ignorecase="yes"/>
        <notcontains text="bar" ignorecase="yes"/>
    </include>
    <include name="**/*.java">
        <contains text="abc" ignorecase="no"/>
        <notcontains text="def" ignorecase="no"/>
        <notcontains text="ghi" ignorecase="yes"/>
    </include>
    <exclude name="**/Test*.java">
        <contains text="xyz" ignorecase="yes"/>
    </exclude>
  </fileset>
</copy>

This lets you -form- your fileset itself instead of 
applying the selector on the resultant fileset as a 
whole.

I did look at the Culler proposal.  To the limited 
extent I read, I think it is similar to what Jesse has, but not as fine grained as what I
am suggesting (at 
least in this context).

I also didn't subclass FileSet as I wasn't trying to 
create a special type of fileset as in your case - I 
made some additions/alterations to PatternSet, DirectoryScanner and a couple of lines in FileSet

(mainly to ensure it is backwards compatible).

Thanks,
Magesh
 


Mime
View raw message