Home > Mobile >  Delete directory content from Gradle
Delete directory content from Gradle

Time:04-07

I use this Gradle configuration to copy generated asciidoc files.

But I need to delete old outdated files also.

task copyDocument(type: Copy) {
    dependsOn bootJar

    from file("build/docs/asciidoc/")
    into file("src/main/resources/static/")
}

How I can delete the content of directory src/main/resources/static/ before I paste the new generated files?

CodePudding user response:

task copyDocument(type: Copy) {
    dependsOn bootJar

    from file("build/docs/asciidoc/")
    into file("src/main/resources/static/")
    doFirst {
        delete "build/folder"
    }
}
  • Related