Browse Source

Zip task did not create tasks when there are only empty directories in the selection

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-ffa450edef68
master
Antoine Levy-Lambert 21 years ago
parent
commit
12f1e22e1f
3 changed files with 15 additions and 0 deletions
  1. +2
    -0
      WHATSNEW
  2. +7
    -0
      src/etc/testcases/taskdefs/zip.xml
  3. +6
    -0
      src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java

+ 2
- 0
WHATSNEW View File

@@ -80,6 +80,8 @@ Fixed bugs:

* 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
===================================



+ 7
- 0
src/etc/testcases/taskdefs/zip.xml View File

@@ -128,6 +128,12 @@
<zip destfile="test3.zip" basedir="ziptest" whenempty="skip"/>
</target>

<!-- Bugzilla Report 30365 -->
<target name="zipEmptyDir">
<mkdir dir="empty/empty2"/>
<zip destfile="test3.zip" basedir="empty" update="true"/>
</target>

<target name="cleanup">
<delete file="test3.zip"/>
<delete file="test4.zip"/>
@@ -140,5 +146,6 @@
<delete file="zipgroupfileset.zip"/>
<delete file="../dummyfile" />
<delete dir="ziptest"/>
<delete dir="empty"/>
</target>
</project>

+ 6
- 0
src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java View File

@@ -133,4 +133,10 @@ public class ZipTest extends BuildFileTest {
assertTrue("archive should get skipped",
!getProject().resolveFile("test3.zip").exists());
}
// Bugzilla Report 30365
public void testZipEmptyDir() {
executeTarget("zipEmptyDir");
assertTrue("archive should be created",
getProject().resolveFile("test3.zip").exists());
}
}

Loading…
Cancel
Save