Groovy File.deletedirs can't delete folder with "."


I’m using Groovy File.deletedirs(). Looks like it can’t delete directory start with “.”, like “.git”. Any idea?

There’s lots of file helper methods available on the Project object which act relative to the current project directory. Methods in your build.gradle will delegate to the project object instance so you can call file(Object) and delete(Object) etc.

I’m not trying to delete project directory. I’m trying to delete a directory in file system. Thanks!