Bug 20485 - The <sync> task doesn't support the nested "filterset" element
Summary: The <sync> task doesn't support the nested "filterset" element
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.7.0
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2003-06-04 21:08 UTC by Gu Dev
Modified: 2008-11-24 03:57 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Gu Dev 2003-06-04 21:08:45 UTC
My buildfile used to <copy> the scripts files to the
dist directory. After changing the file names
in my scripts dir, the old file were not
deleted when I build. I want to use the <sync> task but 
it doesn't support <filterset> which I use in the <copy>.
I can't use the <filter> task as well since <sync> doesn't
support the filtering attribute.

Here is my dist target:

    <target name="dist" depends="pack"
            description="--> Make a lite-dist of the project">

        <!-- Distribute the lib directory -->
        <mkdir dir="${dist.lib.dir}"/>
        <sync todir="${dist.lib.dir}">
            <fileset dir="${build.lib.dir}"/>

        <!-- Distribute the bin directory -->
        <mkdir dir="${dist.bin.dir}"/>
        <pathconvert targetos="windows" 
            <map from="${basedir}\${dist.lib.dir}" to="..\lib"/>
        <sync todir="${dist.bin.dir}">
            <fileset dir="${scripts.dir}"/>
                <filter token="SERVERCP" value="${server.rt.classpath.text}"/>
                <filter token="SERVERMAIN" value="${server.main.class}"/>


- Gu
Comment 1 Dominique Devienne 2003-06-04 21:55:16 UTC
Sorry, but this was by design...

I thought at the time that supporting <filterset> would force keeping track of 
the info used to do replacements, otherwise that info could change, and <sync> 
wouldn't know about it, so stale files would exist in the target directory (not 

OTOH, <copy> is probably already affected with this behavior...

So I guess it comes down to: I needed <sync>, but not with replacement. It 
wasn't my itch ;-)

If it's yours, I invite you to contribute a patch ;-) --DD