tags:

views:

254

answers:

1

I tried the example in the manual:

<delete includeemptydirs="true">
  <fileset dir="${DIR}" includes="**/.svn" defaultexcludes="false"/>
</delete>

(where DIR is set to some directory) and it does nothing. How can this be made to work? I'm using ant 1.7.0.

FYI: I've tried lots of different combinations of nested elements, dirset instead of fileset and it still doesn't work. :(

+4  A: 

Why don't you just use svn export instead?

Anyway, looks like ( from here ) the following should work:

<echo level="info">Remove svn-files...</echo>
<delete includeemptydirs="true" >
    <fileset dir="${checkout.dir}" defaultexcludes="false" >
      <include name="**/.svn/" />
    </fileset>
</delete>
Brian Gianforcaro
I'm not using svn export because I simply need to copy some files from dir1 to dir2 that may include built products; svn export will not copy files that are not under version control.
Paul J. Lucas
Anyway, your example works; however, the nested include is not necessary. The difference that makes it work is the trailing / in "**/.svn/". So, apparently, the ant manual is wrong.
Paul J. Lucas