I need to zip a collection of files from different location into one zip, keeping their initial relations. For example, I need only a1 and b2 from the following folder structure
Top -- A -- a1
-- a2
-- B -- b1
b2
and i want the zip file to look like:
Top -- A -- a1
-- B -- b2
How can I do that using AntBuilder? I've tried:
def deploymentFiles = [ "$HOME/Songs/a.tsv", "$HOME/Songs/b.tsv", ]
def ant = new AntBuilder()
def zipFile = new File("deployment_zipFile.zip")
ant.zip( destFile: "${zipFile.getAbsolutePath()}" ) { fileset( dir: "$HOME" ) { deploymentFiles.each {f -> includes: deploymentFiles.join(",") } } }
but this just zipped the entire HOME folder.