I have simply added a testcase, the code was already fixed by Matt Benson in Zip.java revision 1.128 PR: 30365 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276804 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -80,6 +80,8 @@ Fixed bugs: | |||||
| * FTP task, getTimeDiff method was returning wrong value. Bugzilla 30595. | * FTP task, getTimeDiff method was returning wrong value. Bugzilla 30595. | ||||
| * Zip task was not zipping when only empty directories were found. Bugzilla 30365. | |||||
| Changes from Ant 1.6.1 to Ant 1.6.2 | Changes from Ant 1.6.1 to Ant 1.6.2 | ||||
| =================================== | =================================== | ||||
| @@ -128,6 +128,12 @@ | |||||
| <zip destfile="test3.zip" basedir="ziptest" whenempty="skip"/> | <zip destfile="test3.zip" basedir="ziptest" whenempty="skip"/> | ||||
| </target> | </target> | ||||
| <!-- Bugzilla Report 30365 --> | |||||
| <target name="zipEmptyDir"> | |||||
| <mkdir dir="empty/empty2"/> | |||||
| <zip destfile="test3.zip" basedir="empty" update="true"/> | |||||
| </target> | |||||
| <target name="cleanup"> | <target name="cleanup"> | ||||
| <delete file="test3.zip"/> | <delete file="test3.zip"/> | ||||
| <delete file="test4.zip"/> | <delete file="test4.zip"/> | ||||
| @@ -140,5 +146,6 @@ | |||||
| <delete file="zipgroupfileset.zip"/> | <delete file="zipgroupfileset.zip"/> | ||||
| <delete file="../dummyfile" /> | <delete file="../dummyfile" /> | ||||
| <delete dir="ziptest"/> | <delete dir="ziptest"/> | ||||
| <delete dir="empty"/> | |||||
| </target> | </target> | ||||
| </project> | </project> | ||||
| @@ -133,4 +133,10 @@ public class ZipTest extends BuildFileTest { | |||||
| assertTrue("archive should get skipped", | assertTrue("archive should get skipped", | ||||
| !getProject().resolveFile("test3.zip").exists()); | !getProject().resolveFile("test3.zip").exists()); | ||||
| } | } | ||||
| // Bugzilla Report 30365 | |||||
| public void testZipEmptyDir() { | |||||
| executeTarget("zipEmptyDir"); | |||||
| assertTrue("archive should be created", | |||||
| getProject().resolveFile("test3.zip").exists()); | |||||
| } | |||||
| } | } | ||||