How to delete an empty directory (or the directory with all contents recursively) in gradle?

前端 未结 6 1467
后悔当初
后悔当初 2020-12-15 18:10

I can\'t figure out how to delete all contents of a directory.

For cleaning out a directory, I want to remove all files and directories inside it: I want to wipe ev

6条回答
  •  清歌不尽
    2020-12-15 19:09

    At the risk of resurrecting an answered topic, there's a relatively easy way to do this.

    This task will delete all files and directories under 'src' without traversing the file tree and without removing to 'src' dir

    task deleteGraphicsAssets(type:Delete) {
        delete file('src').listFiles()
    }
    

提交回复
热议问题