Removing svn checkout with NAnt

I am trying to delete the folder which is the svn checkout of my project so that I can do a new check. The problem is that whenever I try to delete this folder using the nant delete task, I keep getting the following error:

[delete] Deleting directory 'C:\projects\my_project\Trunk'.

BUILD FAILED

c:\Projects\my_project\default.build(63,4):
Cannot delete directory 'C:\projects\my_project\Trunk\SomeFolder\AnotherFolder'.
    The directory is not empty.

Is there a trick to deleting a working copy with nant here? I tried to remove only the .svn directories, but nant didn’t delete them all for any reason. Here is the task I used for this, but it did not work:

    <delete>
        <fileset basedir="myproject\trunk">
            <include name="\**\.svn" />
        </fileset>
    </delete>

Any ideas would be greatly appreciated!

+3
source share
2 answers

@jitter, you were very close

At first there is no dirset, I got an error when trying to use this. that's what really worked

<delete>
  <fileset basedir="myproject\trunk" defaultexcludes="false">
    <include name="**/.svn" />
    <include name="**/.svn/**/*" />
  </fileset>
</delete>

, . , d efaultexcludes="false"

**/.svn/**/*

.svn-.

!

+3

<delete dir="myproject/trunk" />

, <include ... /> , .

, .svn

<delete>
    <dirset basedir="myproject\trunk" defaultexcludes="false">
        <include name="**/.svn" />
    </dirset>
</delete>

dirset, , fileset . , " , .svn" defaultexcludes="false" <fileset documentation>, defaultexcludes (, **/.svn , )

+2
source

Source: https://habr.com/ru/post/1710842/


All Articles