diff --git a/WHATSNEW b/WHATSNEW index 754e1f502..48bd2fc65 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -110,6 +110,11 @@ Fixed bugs: to the toString invocation already. Bugzilla Report 49588. + * in parallel mode didn't work together with a nested + if maxparallel was <= 0 (the default) or no source + files matched. + Bugzilla Report 49594. + Other changes: -------------- diff --git a/docs/manual/Tasks/apply.html b/docs/manual/Tasks/apply.html index b6df73260..ca4d8d58e 100644 --- a/docs/manual/Tasks/apply.html +++ b/docs/manual/Tasks/apply.html @@ -391,6 +391,9 @@ file mapping will take place with each iteration. This grants the user the capacity to receive input from, and send output to, different files for each sourcefile.

+

In parallel-mode the redirector will be reset for each batch + of executions (with maxparallel > 0) and null will be used + a source file just like it is in the case of exec.

Examples

 <apply executable="ls">
diff --git a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
index 56d596397..b8f0c24f9 100644
--- a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
+++ b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
@@ -708,6 +708,11 @@ public class ExecuteOn extends ExecTask {
             String[] command = getCommandline(s, b);
             log(Commandline.describeCommand(command), Project.MSG_VERBOSE);
             exe.setCommandline(command);
+            if (redirectorElement != null) {
+                setupRedirector();
+                redirectorElement.configure(redirector, null);
+                exe.setStreamHandler(redirector.createHandler());
+            }
             runExecute(exe);
         } else {
             int stillToDo = fileNames.size();
diff --git a/src/tests/antunit/taskdefs/exec/apply-test.xml b/src/tests/antunit/taskdefs/exec/apply-test.xml
index 02273ce8a..1b5a661a3 100644
--- a/src/tests/antunit/taskdefs/exec/apply-test.xml
+++ b/src/tests/antunit/taskdefs/exec/apply-test.xml
@@ -756,4 +756,37 @@
     
   
 
+  
+    
+      
+      
+      
+      
+      
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+