user86834
user86834

Reputation: 5645

Back up folder in Groovy

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

Answers (1)

tim_yates
tim_yates

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

Related Questions