Bug 32632 - pattern / nested patternset in filterset
Summary: pattern / nested patternset in filterset
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2004-12-10 14:06 UTC by Holger Engels
Modified: 2008-02-22 12:18 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Holger Engels 2004-12-10 14:06:08 UTC
filters / filterchains / filterreaders should all allow for patterns and nested

<copy todir="${deploy.dir}">
  <fileset refid="webapp"/>
    <filter token="DATE" value="${TODAY}"/>
    <patternset id="sources">
      <include name="**/*.xml"/>

This should apply the filters of the filterset only to files of the fileset
matching the patterns of the patternset.
Comment 1 Matt Benson 2004-12-10 17:10:58 UTC
You can do this with multiple copy tasks.
Comment 2 Holger Engels 2004-12-13 08:29:09 UTC
(In reply to comment #1)
> You can do this with multiple copy tasks.

I can use multiple coüpy tasks only, if I am the one, who defines the fileset.
Unfortunately, I'm not. The fileset is an artifact, exported by another module.

The documentation of filtersets says "copy operations will typically corrupt
binary files". But there's no straight forward way to avoid that. Imagine you
write a deploy target, that copies filesets to a deployment directory and
thereby weaves the configuration into the deployables. From the perspective of
the target, filesets are logical units. The target should be unconcerned about
the fileset's internals.

.. just wanted to state my thoughts. I won't reopen the issue again.
Comment 3 Matt Benson 2004-12-13 16:52:22 UTC
It still sounds as though you could work around this using multiple copy
operations if you had the ability to use an existing fileset as a template for a
more-specific fileset, per your other bug report, correct?
Comment 4 Holger Engels 2004-12-14 10:43:56 UTC
Correct. Then I could write something like:

<copy todir="${deploy.dir}">
  <fileset inherit="webapp">
    <include name="**/*.xml"/>
    <filter token="DATE" value="${TODAY}"/>
<copy todir="${deploy.dir}">
  <fileset inherit="webapp">
    <exclude name="**/*.xml"/>