Gradle task to create a zip archive of a directory

后端 未结 2 1684
孤街浪徒
孤街浪徒 2020-12-24 13:05

I have a gradle task to create a zip archive of a directory. The gradle task is:

task archiveReports(type: Zip) {
   from \'/projects/Reports/*\'
   archiveN         


        
2条回答
  •  时光取名叫无心
    2020-12-24 13:40

    Adding to the accepted answer, with Gradle 6.7,

    task packageDistribution(type: Zip) {
        archiveFileName = "my-distribution.zip"
        destinationDirectory = file("$buildDir/dist")
    
        from "$buildDir/toArchive"
    }
    

    archiveName is deprected.

提交回复
热议问题