Reputation: 5645
Using the AntBuilder
seems to be the best way to create a backup zip file in Groovy. There are lots of solutions on this site that use methods like copy
and zip
but I can't see those methods the AntBuilder
class in Groovy 2.1.5. Do I need to install an additional Jar?
new AntBuilder().zip(
destfile: "mydir/myzip.zip") {
fileset(dir: "mydir/myFile.txt")
}
Upvotes: 0
Views: 301
Reputation: 171124
The methods in AntBuilder
are dynamic and depend on the installed ant tasks.
Did you try zipping a folder with it before asking here?
If you try, you should see it works
Zip specific files with AntBuilder
Zip files/Directories in Groovy with AntBuilder
Upvotes: 1