diff --git a/WHATSNEW b/WHATSNEW index 8b3c011c8..52e5e1288 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -33,6 +33,10 @@ Other changes: * A new base class DispatchTask has been added to facilitate elegant creation of tasks with multiple actions. +* has a new ignoremissing attribute (default true for BC) + which will allow nonexistent files specified via s to + be passed to the executable. Bugzilla Report 29585. + Changes from Ant 1.6.1 to current Ant 1.6 CVS version ===================================================== @@ -229,6 +233,8 @@ Other changes: * Add deleteonexit attribute to . +* Added Target.getIf/Unless(). Bugzilla Report 29320. + Changes from Ant 1.6.0 to Ant 1.6.1 ============================================= diff --git a/docs/manual/CoreTasks/apply.html b/docs/manual/CoreTasks/apply.html index 7dd142c4d..3ad6a03be 100644 --- a/docs/manual/CoreTasks/apply.html +++ b/docs/manual/CoreTasks/apply.html @@ -248,6 +248,12 @@ to send input to it is via the input and inputstring attributes.

Defaults to false. Since Ant 1.6. No + + ignoremissing + Whether to ignore nonexistent files specified + via filelists. Since Ant 1.7. + No, default is true +

Parameters specified as nested elements

fileset

diff --git a/src/etc/testcases/taskdefs/exec/apply.xml b/src/etc/testcases/taskdefs/exec/apply.xml index 6af64438a..dad2950e1 100755 --- a/src/etc/testcases/taskdefs/exec/apply.xml +++ b/src/etc/testcases/taskdefs/exec/apply.xml @@ -303,6 +303,47 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java index 77d0bf09e..d75341c24 100644 --- a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java +++ b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java @@ -71,6 +71,7 @@ public class ExecuteOn extends ExecTask { private int maxParallel = -1; private boolean addSourceFile = true; private boolean verbose = false; + private boolean ignoreMissing = true; /** * Has <srcfile> been specified before <targetfile> @@ -182,6 +183,15 @@ public class ExecuteOn extends ExecTask { verbose = b; } + /** + * Whether to ignore nonexistent files from filelists. + * + * @since Ant 1.7 + */ + public void setIgnoremissing(boolean b) { + ignoreMissing = b; + } + /** * Marker that indicates where the name of the source file should * be put on the command line. @@ -354,10 +364,10 @@ public class ExecuteOn extends ExecTask { for (int j = 0; j < names.length; j++) { File f = new File(base, names[j]); - if ((f.isFile() && !"dir".equals(type)) + if ((!ignoreMissing) || (f.isFile() && !"dir".equals(type)) || (f.isDirectory() && !"file".equals(type))) { - if (f.isFile()) { + if (ignoreMissing || f.isFile()) { totalFiles++; } else { totalDirs++; diff --git a/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java b/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java index d42cfa098..8fda02663 100755 --- a/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java +++ b/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java @@ -550,6 +550,10 @@ public class ExecuteOnTest extends BuildFileTest { assertNull("unexpected redirector.err content", getFileString("redirector.err")); } + public void testIgnoreMissing() { + executeTarget("ignoremissing"); + } + //borrowed from TokenFilterTest private String getFileString(String filename) throws IOException { String result = null;