ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/service ExecService.java
Date Tue, 09 Apr 2002 12:23:53 GMT
conor       02/04/09 05:23:53

  Modified:    proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution
                        BuildEventSupport.java CoreExecService.java
                        Frame.java
               proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system
                        Ant.java AntBase.java AntCall.java
               proposal/mutant/src/java/common/org/apache/ant/common/antlib
                        AbstractTask.java Task.java
               proposal/mutant/src/java/common/org/apache/ant/common/service
                        ExecService.java
  Log:
  More output management
  
  Revision  Changes    Path
  1.9       +13 -8     jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/BuildEventSupport.java
  
  Index: BuildEventSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/BuildEventSupport.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- BuildEventSupport.java	7 Apr 2002 14:38:06 -0000	1.8
  +++ BuildEventSupport.java	9 Apr 2002 12:23:53 -0000	1.9
  @@ -63,6 +63,7 @@
   import org.apache.ant.common.model.ModelElement;
   import org.apache.ant.common.util.DemuxOutputReceiver;
   import org.apache.ant.common.event.MessageLevel;
  +import org.apache.ant.common.util.ExecutionException;
   
   /**
    * BuildEventSupport is used by classes which which to send build events to
  @@ -230,16 +231,20 @@
        */
       public void threadOutput(String line, boolean isError) {
           Task task = (Task) threadTasks.get(Thread.currentThread());
  -        if (task == null) {
  -            fireMessageLogged(this, line, 
  -                isError ? MessageLevel.MSG_ERR : MessageLevel.MSG_INFO);
  -        } else {
  +        if (task != null) {
  +            try {
               if (isError) {
                   task.handleSystemErr(line);
               } else {
                   task.handleSystemOut(line);
               }
  +                return;
  +            } catch (ExecutionException e) {
  +                // ignore just log normally
           }
  +        }
  +        fireMessageLogged(this, line, 
  +            isError ? MessageLevel.MSG_ERR : MessageLevel.MSG_INFO);
       }
   }
   
  
  
  
  1.9       +21 -12    jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java
  
  Index: CoreExecService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- CoreExecService.java	9 Apr 2002 11:42:40 -0000	1.8
  +++ CoreExecService.java	9 Apr 2002 12:23:53 -0000	1.9
  @@ -152,18 +152,12 @@
   
   
       /**
  -     * Handle subbuild output.
  +     * Gets the Frame for a subbuild based on the key
        *
  -     * @param subbuildKey the core's key for managing the subbuild.
  -     * @param line the content produce by the current thread.
  -     * @param isErr true if this content is from the thread's error stream.
  +     * @param key Description of the Parameter
  +     * @return the subbuild's Frame
  +     * @exception ExecutionException if the build cannot be found.
        */
  -    public void handleBuildOutput(Object subbuildKey, String line,
  -                                  boolean isErr) throws ExecutionException {
  -        getSubbuildFrame(subbuildKey).threadOutput(line, isErr);                      
               
  -    }
  -
  -
       private Frame getSubbuildFrame(Object key) throws ExecutionException {
           Frame subFrame = (Frame) subBuilds.get(key);
   
  @@ -174,6 +168,21 @@
           return subFrame;
       }
       
  +
  +    /**
  +     * Handle subbuild output.
  +     *
  +     * @param subbuildKey the core's key for managing the subbuild.
  +     * @param line the content produce by the current thread.
  +     * @param isErr true if this content is from the thread's error stream.
  +     * @exception ExecutionException if the subbuild cannot be found.
  +     */
  +    public void handleBuildOutput(Object subbuildKey, String line,
  +                                  boolean isErr) throws ExecutionException {
  +        getSubbuildFrame(subbuildKey).threadOutput(line, isErr);
  +    }
  +
  +
       /**
        * Run a build which have been previously setup
        *
  
  
  
  1.16      +9 -9      jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Frame.java
  
  Index: Frame.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Frame.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -w -u -r1.15 -r1.16
  
  
  
  1.8       +0 -1      jakarta-ant/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/Ant.java
  
  Index: Ant.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/Ant.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -w -u -r1.7 -r1.8
  --- Ant.java	9 Apr 2002 11:42:40 -0000	1.7
  +++ Ant.java	9 Apr 2002 12:23:53 -0000	1.8
  @@ -53,7 +53,6 @@
    */
   package org.apache.ant.antlib.system;
   import java.io.File;
  -import org.apache.ant.common.service.ExecService;
   import org.apache.ant.common.util.ExecutionException;
   import org.apache.ant.common.service.MagicProperties;
   import org.apache.ant.common.util.FileUtils;
  
  
  
  1.6       +6 -2      jakarta-ant/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/AntBase.java
  
  Index: AntBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/AntBase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -w -u -r1.5 -r1.6
  --- AntBase.java	9 Apr 2002 11:42:40 -0000	1.5
  +++ AntBase.java	9 Apr 2002 12:23:53 -0000	1.6
  @@ -325,11 +325,13 @@
        * System.err, directly or indirectly.
        *
        * @param line The line of error info produce by the task
  +     * @exception ExecutionException if the output cannot be handled.
        */
  -    public void handleSystemErr(String line) {
  +    public void handleSystemErr(String line) throws ExecutionException {
           if (subbuildKey == null) {
               super.handleSystemErr(line);
           } else {
  +            execService.handleBuildOutput(subbuildKey, line, true);
           }
       }
   
  @@ -341,11 +343,13 @@
        * or indirectly.
        *
        * @param line The line of content produce by the task
  +     * @exception ExecutionException if the output cannot be handled.
        */
  -    public void handleSystemOut(String line) {
  +    public void handleSystemOut(String line) throws ExecutionException {
           if (subbuildKey == null) {
               super.handleSystemOut(line);
           } else {
  +            execService.handleBuildOutput(subbuildKey, line, false);
           }
       }
   
  
  
  
  1.7       +0 -1      jakarta-ant/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/AntCall.java
  
  Index: AntCall.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/AntCall.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -u -r1.6 -r1.7
  --- AntCall.java	9 Apr 2002 11:42:40 -0000	1.6
  +++ AntCall.java	9 Apr 2002 12:23:53 -0000	1.7
  @@ -52,7 +52,6 @@
    * <http://www.apache.org/>.
    */
   package org.apache.ant.antlib.system;
  -import org.apache.ant.common.service.ExecService;
   import org.apache.ant.common.util.ExecutionException;
   import org.apache.ant.common.service.MagicProperties;
   
  
  
  
  1.6       +5 -2      jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/antlib/AbstractTask.java
  
  Index: AbstractTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/antlib/AbstractTask.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -w -u -r1.5 -r1.6
  --- AbstractTask.java	18 Mar 2002 02:44:27 -0000	1.5
  +++ AbstractTask.java	9 Apr 2002 12:23:53 -0000	1.6
  @@ -53,6 +53,7 @@
    */
   package org.apache.ant.common.antlib;
   import org.apache.ant.common.event.MessageLevel;
  +import org.apache.ant.common.util.ExecutionException;
   
   /**
    * Abstract implementation of the Task interface
  @@ -89,8 +90,9 @@
        * directly or indirectly.
        *
        * @param line The line of content produce by the task
  +     * @exception ExecutionException if the output cannot be handled.
        */
  -    public void handleSystemOut(String line) {
  +    public void handleSystemOut(String line) throws ExecutionException {
           // default behaviout is to log at INFO level
           log(line, MessageLevel.MSG_INFO);
       }
  @@ -102,8 +104,9 @@
        * System.err, directly or indirectly.
        *
        * @param line The line of error info produce by the task
  +     * @exception ExecutionException if the output cannot be handled.
        */
  -    public void handleSystemErr(String line) {
  +    public void handleSystemErr(String line) throws ExecutionException {
           // default behaviout is to log at WARN level
           log(line, MessageLevel.MSG_WARN);
       }
  
  
  
  1.5       +4 -2      jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/antlib/Task.java
  
  Index: Task.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/antlib/Task.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -u -r1.4 -r1.5
  --- Task.java	18 Mar 2002 02:44:27 -0000	1.4
  +++ Task.java	9 Apr 2002 12:23:53 -0000	1.5
  @@ -89,8 +89,9 @@
        * directly or indirectly.
        *
        * @param line The line of content produce by the task
  +     * @exception ExecutionException if the output cannot be handled.
        */
  -    void handleSystemOut(String line);
  +    void handleSystemOut(String line) throws ExecutionException;
   
       /**
        * Handle error information produced by the task. When a task prints to
  @@ -99,7 +100,8 @@
        * System.err, directly or indirectly.
        *
        * @param line The line of error info produce by the task
  +     * @exception ExecutionException if the output cannot be handled.
        */
  -    void handleSystemErr(String line);
  +    void handleSystemErr(String line) throws ExecutionException;
   }
   
  
  
  
  1.7       +3 -0      jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/service/ExecService.java
  
  Index: ExecService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/service/ExecService.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -u -r1.6 -r1.7
  --- ExecService.java	9 Apr 2002 11:42:40 -0000	1.6
  +++ ExecService.java	9 Apr 2002 12:23:53 -0000	1.7
  @@ -93,6 +93,7 @@
        *
        * @param properties the initiali properties to be used in the build
        * @exception ExecutionException if the subbuild cannot be setup
  +     * @return a key to the build allowing it to be executed and managed
        */
       Object setupBuild(Map properties)
            throws ExecutionException;
  @@ -136,6 +137,8 @@
        * @param subbuildKey the core's key for managing the subbuild.
        * @param line the content produce by the current thread.
        * @param isErr true if this content is from the thread's error stream.
  +     *
  +     * @exception ExecutionException if the subbuild cannot be found.
        */
       void handleBuildOutput(Object subbuildKey, String line, boolean isErr) 
           throws ExecutionException;
  
  
  

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


Mime
View raw message