ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r358653 - in /ant/core/trunk/src: etc/testcases/taskdefs/delete.xml main/org/apache/tools/ant/taskdefs/Delete.java testcases/org/apache/tools/ant/taskdefs/DeleteTest.java
Date Thu, 22 Dec 2005 23:28:25 GMT
Author: mbenson
Date: Thu Dec 22 15:28:16 2005
New Revision: 358653

URL: http://svn.apache.org/viewcvs?rev=358653&view=rev
Log:
fix failonerror="false" includeemptydirs="true"; reported by Alexey.

Modified:
    ant/core/trunk/src/etc/testcases/taskdefs/delete.xml
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java
    ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java

Modified: ant/core/trunk/src/etc/testcases/taskdefs/delete.xml
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/etc/testcases/taskdefs/delete.xml?rev=358653&r1=358652&r2=358653&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/delete.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/delete.xml Thu Dec 22 15:28:16 2005
@@ -115,6 +115,20 @@
     </delete>
   </target>
 
+  <target name="test12">
+    <delete failonerror="false" includeemptydirs="true">
+      <fileset dir="thisdenotesadirectorythatwillneverexistblah" />
+    </delete>
+  </target>
+
+  <target name="test13" depends="init">
+    <delete includeemptydirs="true">
+      <fileset dir="${dir}" />
+      <fileset dir="${dir}" />
+    </delete>
+    <expectabsent />
+  </target>
+
   <target name="cleanup" depends="test4" />
 
 </project>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java?rev=358653&r1=358652&r2=358653&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java Thu Dec 22 15:28:16
2005
@@ -552,12 +552,12 @@
         for (int i = 0; i < filesets.size(); i++) {
             FileSet fs = (FileSet) filesets.get(i);
             resourcesToDelete.add(fs);
-            if (includeEmpty) {
+            if (includeEmpty && fs.getDir().isDirectory()) {
               filesetDirs.add(new ReverseDirs(fs.getDir(),
                   fs.getDirectoryScanner().getIncludedDirectories()));
             }
         }
-        if (usedMatchingTask && dir != null) {
+        if (usedMatchingTask && dir != null && dir.isDirectory()) {
             //add the files from the default fileset:
             FileSet implicit = getImplicitFileSet();
             resourcesToDelete.add(implicit);

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java?rev=358653&r1=358652&r2=358653&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java Thu Dec 22
15:28:16 2005
@@ -67,4 +67,10 @@
     public void test11() {
         executeTarget("test11");
     }
+    public void test12() {
+        executeTarget("test12");
+    }
+    public void test13() {
+        executeTarget("test13");
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message