Creating a Zipfile with AntBuilder

This is an example of the groovy antbuilder to create a zipfile.


Assuming the following directory structure:

`- stuff\
|  `- 1.doc
|  `- 1.txt
|  `- 2.doc
|  `- 2.txt
|  `- 3.doc
|  `- 3.txt
|  `- 4.txt
|  `- 5.txt
|  `- old\
|  |  `- 1.doc
|  |  `- 1.txt
|  |  `- 2.doc
|  |  `- 2.txt
|  |  `- 3.doc
|  |  `- 3.txt
|  |  `- 4.txt
|  |  `- 5.txt

This groovy snippet would only compress all *.txt files to a zipfile an exclude all *.doc.

def ant = new AntBuilder()
ant.zip(destfile: "test.zip",
basedir: "stuff",
includes: "**/*.txt",
excludes: "**/*.doc")