How to copy files into a zip file using ANT script?

ant, ant-contrib

Solution

Straight from the documentation of the zip task:

The update parameter controls what happens if the ZIP file already exists. When set to yes, the ZIP file is updated with the files specified. (New files are added; old files are replaced with the new versions.)

Problem

I want to copy few files into an existing zip file using ANT script. Is there any task available for that? Or do I need to unzip the zip file then copy the needed files and zip again?

Original source