diff --git a/WHATSNEW b/WHATSNEW
index 6b7580d54..2ea890d1a 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -188,6 +188,9 @@ Other changes:
* Added a comment attribute to the zip task.
Bugzilla report 22793.
+* Made the dest attribute of the apply task optional; mapped target
+ filenames will be interpreted as absolute pathnames when dest is omitted.
+
Fixed bugs:
-----------
diff --git a/src/etc/testcases/taskdefs/exec/apply.xml b/src/etc/testcases/taskdefs/exec/apply.xml
index 0d5540ed6..019a57ce5 100755
--- a/src/etc/testcases/taskdefs/exec/apply.xml
+++ b/src/etc/testcases/taskdefs/exec/apply.xml
@@ -406,6 +406,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
index a15fbf41b..0444079da 100644
--- a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
+++ b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
@@ -277,16 +277,15 @@ public class ExecuteOn extends ExecTask {
throw new BuildException("no filesets and no filelists specified",
getLocation());
}
- if (targetFilePos != null || mapperElement != null
- || destDir != null) {
-
- if (mapperElement == null) {
- throw new BuildException("no mapper specified", getLocation());
- }
- if (destDir == null) {
- throw new BuildException("no dest attribute specified",
- getLocation());
- }
+ if (targetFilePos != null && mapperElement == null) {
+ throw new BuildException("targetfile specified without mapper",
+ getLocation());
+ }
+ if (destDir != null && mapperElement == null) {
+ throw new BuildException("dest specified without mapper",
+ getLocation());
+ }
+ if (mapperElement != null) {
mapper = mapperElement.getImplementation();
}
}
diff --git a/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java b/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java
index 8939bdfa2..ae7dcd9ba 100755
--- a/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java
+++ b/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java
@@ -558,6 +558,10 @@ public class ExecuteOnTest extends BuildFileTest {
executeTarget("force");
}
+ public void testNoDest() {
+ executeTarget("testNoDest");
+ }
+
//borrowed from TokenFilterTest
private String getFileString(String filename) throws IOException {
String result = null;