How to make deleting .svn directories work using a

2019-05-04 15:28发布

问题:

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. :(

回答1:

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>


回答2:

Try with the following lines:

<delete includeemptydirs="true">
   <dirset dir="./" defaultexcludes="false">
      <include name="**/.svn/**" />
   </dirset>
</delete>


标签: svn ant