Bug 45819 - [FilterSet] allow inclusion / exclusion patterns on filterset
Summary: [FilterSet] allow inclusion / exclusion patterns on filterset
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2008-09-16 00:53 UTC by Remie Bolte
Modified: 2008-09-16 00:53 UTC (History)
0 users

Filtering, and beyond! (122.18 KB, image/png)
2008-09-16 00:53 UTC, Remie Bolte

Note You need to log in before you can comment on or make changes to this bug.
Description Remie Bolte 2008-09-16 00:53:07 UTC
Created attachment 22589 [details]
Filtering, and beyond!

It would be nice if it is possible to add a pattern to a filterset to define which files should be processed, or omitted.

For instance, the following task will copy all contents from directory srcDir to directory destDir, replacing all instances of someToken:

<copy failonerror="false" todir="${destDir}">
  <fileset dir="${srcDir}" />
    <filter token="${someToken}" value=""/>

Now, in my real life scenario, this fileset includes resources like images which actually contain someToken, making the images look like an 80s arcade console (see attachment).

This forces me to do the following:

<copy failonerror="false" todir="${destDir}">
  <fileset dir="${srcDir}" includes="**/*.html/>
    <filter token="${someToken}" value=""/>

<copy failonerror="false" todir="${destDir}">
  <fileset dir="${srcDir}" excludes="**/*.html/>
    <filter token="${someToken}" value=""/>

This seems odd, for the inclusion pattern lies not on the copy task (I want all files to go in the same destination directory. I simply do not want the filter to be applied to all files. An inclusion / exclusion flag on the filterset would be appropriate here.