ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Douglas Kramer <Douglas.Kra...@Sun.COM>
Subject Ant: copy all but exclude one directory
Date Tue, 08 Feb 2005 21:11:07 GMT
I haven't gotten a reply yet, so I'll try again.

Does anyone see any syntax or logic mistakes in this fileset?

I have this structure:


How would I recursively copy all files and dirs below ${WORKDIR}
except BACKUP into BACKUP itself?  This fileset doesn't seem to
exclude BACKUP:

       <mkdir       dir="${WORKDIR}/BACKUP" />
       <copy      todir="${WORKDIR}/BACKUP" preservelastmodified="true">
           <fileset dir="${WORKDIR}">
               <include name="**/*" />
               <exclude name="BACKUP" />

This creates:

        |  +------+-BACKUP
        +-DIR1    +-DIR1
        +-DIR2    +-DIR2
        +-file1   +-file1
        +-file2   +-file2

when I want:

        |  +------+-DIR1
        +-DIR1    +-DIR2
        +-DIR2    +-file2
        +-file1   +-file2

P.S. I can't find the documentation on <include> and <exclude>
(only examples) in the Ant manual.  They're not really documented
on the <fileset> page, as they are not attributes.  For example,
it doesn't state if "name" can be a filename or directory name.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message