Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Users List »

problems with empty directories and copy task

Sascha Ernst

2010-03-01


Author LoginPost Reply
Hello,

I have a problem with a fileset/patternset and a copy task.

In the structure I'd like to copy there are (besides "normal" folders and files)

-       Empty directories

-       OS-specific folders

I'd like to copy everything (incl. the empty directories) but NOT the OS-specific folders not matching
the desired OS-architecture.

Currently my copy-task looks like this (the ignore.<os-arch>-properties tell which OS-architecture to ignore ):

          <patternset id="os.stuff.to.ignore">
           <exclude name="**/win-i386/**/*" if="ignore.win-i386" />
           <exclude name="**/win-amd64/**/*" if="ignore.win-amd64" />
           <exclude name="**/solaris-x86/**/*" if="ignore.solaris-x86" />
           <exclude name="**/solaris-amd64/**/*" if="ignore.solaris-amd64" />
           <exclude name="**/linux-i386/**/*" if="ignore.linux-i386" />
           <exclude name="**/linux-amd64/**/*" if="ignore.linux-amd64" />
           <exclude name="**/solaris-sparc/**/*" if="ignore.solaris-sparc" />
          </patternset>

          <copy todir="${bin.dir}/../.."
              overwrite="true"
                     includeEmptyDirs="true"
                     failonerror="true"
                     verbose="true">
           <fileset dir="./new">
            <include name="**/*" />
            <patternset refid="os.stuff.to.ignore"/>
           </fileset>
          </copy>

It works fine BUT does not copy empty directories :(

Can someone tell me where I missed the point?

Regards

///Sascha///
©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.