You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2003/09/19 10:31:06 UTC

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Execute.java ExecuteOn.java

bodewig     2003/09/19 01:31:06

  Modified:    src/main/org/apache/tools/ant/taskdefs Execute.java
                        ExecuteOn.java
  Log:
  Restart stream reading and writing for each execution in <apply>.
  
  PR: 22446
  
  Revision  Changes    Path
  1.68      +8 -2      ant/src/main/org/apache/tools/ant/taskdefs/Execute.java
  
  Index: Execute.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Execute.java,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- Execute.java	18 Sep 2003 14:21:41 -0000	1.67
  +++ Execute.java	19 Sep 2003 08:31:06 -0000	1.68
  @@ -348,10 +348,16 @@
        */
       public Execute(ExecuteStreamHandler streamHandler,
                      ExecuteWatchdog watchdog) {
  -        this.streamHandler = streamHandler;
  +        setStreamHandler(streamHandler);
           this.watchdog = watchdog;
       }
   
  +    /**
  +     * @since Ant 1.6
  +     */
  +    public void setStreamHandler(ExecuteStreamHandler streamHandler) {
  +        this.streamHandler = streamHandler;
  +    }
   
       /**
        * Returns the commandline used to create a subprocess.
  
  
  
  1.46      +16 -1     ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- ExecuteOn.java	3 Sep 2003 16:47:17 -0000	1.45
  +++ ExecuteOn.java	19 Sep 2003 08:31:06 -0000	1.46
  @@ -333,6 +333,11 @@
                           log(Commandline.describeCommand(command),
                               Project.MSG_VERBOSE);
                           exe.setCommandline(command);
  +                        if (haveExecuted) {
  +                            // need to reset the stream handler to restart
  +                            // reading of pipes
  +                            exe.setStreamHandler(createHandler());
  +                        }
                           runExecute(exe);
                           haveExecuted = true;
                       }
  @@ -376,6 +381,11 @@
                           log(Commandline.describeCommand(command),
                               Project.MSG_VERBOSE);
                           exe.setCommandline(command);
  +                        if (haveExecuted) {
  +                            // need to reset the stream handler to restart
  +                            // reading of pipes
  +                            exe.setStreamHandler(createHandler());
  +                        }
                           runExecute(exe);
                           haveExecuted = true;
                       }
  @@ -595,6 +605,11 @@
                   String[] command = getCommandline(cs, cb);
                   log(Commandline.describeCommand(command), Project.MSG_VERBOSE);
                   exe.setCommandline(command);
  +                if (currentOffset > 0) {
  +                    // need to reset the stream handler to restart
  +                    // reading of pipes
  +                    exe.setStreamHandler(createHandler());
  +                }
                   runExecute(exe);
   
                   stillToDo -= currentAmount;
  @@ -615,4 +630,4 @@
               return new String[] {"file", "dir", "both"};
           }
       }
  -}
  \ No newline at end of file
  +}
  
  
  

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