ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/listeners DefaultProjectListener.java ProjectListener.java
Date Tue, 29 May 2001 06:56:23 GMT
donaldp     01/05/28 23:56:23

  Modified:    proposal/myrmidon/src/java/org/apache/ant Main.java
               proposal/myrmidon/src/java/org/apache/ant/project
                        DefaultProjectEngine.java
                        LogTargetToListenerAdapter.java ProjectEngine.java
                        ProjectListenerSupport.java
  Added:       proposal/myrmidon/src/java/org/apache/myrmidon/listeners
                        DefaultProjectListener.java ProjectListener.java
  Removed:     proposal/myrmidon/src/java/org/apache/ant/project
                        DefaultProjectListener.java ProjectListener.java
  Log:
  Migrates ProjectListeners to separate package
  
  Revision  Changes    Path
  1.18      +2 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/Main.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Main.java	2001/05/29 06:16:56	1.17
  +++ Main.java	2001/05/29 06:56:18	1.18
  @@ -25,7 +25,7 @@
   import org.apache.myrmidon.model.Project;
   import org.apache.ant.project.ProjectBuilder;
   import org.apache.ant.project.ProjectEngine;
  -import org.apache.ant.project.ProjectListener;
  +import org.apache.myrmidon.listeners.ProjectListener;
   import org.apache.myrmidon.components.embeddor.Embeddor;
   import org.apache.myrmidon.components.embeddor.MyrmidonEmbeddor;
   import org.apache.myrmidon.api.JavaVersion;
  @@ -70,7 +70,7 @@
       protected final static String  DEFAULT_FILENAME          = "build.ant";
   
       protected final static String  DEFAULT_LISTENER          =
  -        "org.apache.ant.project.DefaultProjectListener";
  +        "org.apache.myrmidon.listeners.DefaultProjectListener";
   
       //defines for the Command Line options
       private static final int       HELP_OPT                  = 'h';
  
  
  
  1.13      +1 -0      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/DefaultProjectEngine.java
  
  Index: DefaultProjectEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/DefaultProjectEngine.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DefaultProjectEngine.java	2001/05/29 06:17:00	1.12
  +++ DefaultProjectEngine.java	2001/05/29 06:56:19	1.13
  @@ -24,6 +24,7 @@
   import org.apache.myrmidon.api.DefaultTaskContext;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.components.executor.Executor;
  +import org.apache.myrmidon.listeners.ProjectListener;
   import org.apache.myrmidon.model.Project;
   import org.apache.myrmidon.model.Target;
   
  
  
  
  1.5       +1 -0      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/LogTargetToListenerAdapter.java
  
  Index: LogTargetToListenerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/LogTargetToListenerAdapter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LogTargetToListenerAdapter.java	2001/05/28 10:27:54	1.4
  +++ LogTargetToListenerAdapter.java	2001/05/29 06:56:20	1.5
  @@ -9,6 +9,7 @@
   
   import org.apache.log.LogEvent;
   import org.apache.log.LogTarget;
  +import org.apache.myrmidon.listeners.ProjectListener;
   
   /**
    * Adapter between Avalon LogKit and Project listener interfaces.
  
  
  
  1.10      +4 -3      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/ProjectEngine.java
  
  Index: ProjectEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/ProjectEngine.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ProjectEngine.java	2001/05/29 06:17:01	1.9
  +++ ProjectEngine.java	2001/05/29 06:56:20	1.10
  @@ -8,15 +8,16 @@
   package org.apache.ant.project;
   
   import org.apache.ant.AntException;
  -import org.apache.myrmidon.api.TaskContext;
   import org.apache.avalon.framework.component.Component;
  +import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.listeners.ProjectListener;
   import org.apache.myrmidon.model.Project;
   
   /**
    * This is the interface between ProjectEngine and rest of the system.
  - * This is the interface that tasks/frontends must use to interact with 
  + * This is the interface that tasks/frontends must use to interact with
    * project execution.
  - * 
  + *
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
   public interface ProjectEngine
  
  
  
  1.4       +2 -0      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/ProjectListenerSupport.java
  
  Index: ProjectListenerSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/ProjectListenerSupport.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProjectListenerSupport.java	2001/05/28 10:27:55	1.3
  +++ ProjectListenerSupport.java	2001/05/29 06:56:21	1.4
  @@ -7,6 +7,8 @@
    */
   package org.apache.ant.project;
   
  +import org.apache.myrmidon.listeners.ProjectListener;
  +
   /**
    * Support for the project listener event dispatching.
    *
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/DefaultProjectListener.java
  
  Index: DefaultProjectListener.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.myrmidon.listeners;
  
  import org.apache.avalon.framework.ExceptionUtil;
  
  /**
   * Default listener that emulates the old ant listener notifications.
   *
   * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
   */
  public class DefaultProjectListener
      implements ProjectListener
  {
      private String        m_prefix;
  
      /**
       * Notify listener of projectStarted event.
       */
      public void projectStarted()
      {
      }
  
      /**
       * Notify listener of projectFinished event.
       */
      public void projectFinished()
      {
      }
  
      /**
       * Notify listener of targetStarted event.
       *
       * @param targetName the name of target
       */
      public void targetStarted( final String targetName )
      {
          output( targetName + ":\n" );
      }
  
      /**
       * Notify listener of targetFinished event.
       */
      public void targetFinished()
      {
      }
  
      /**
       * Notify listener of taskStarted event.
       *
       * @param taskName the name of task
       */
      public void taskStarted( final String taskName )
      {
          setPrefix( taskName );
      }
  
      /**
       * Notify listener of taskFinished event.
       */
      public void taskFinished()
      {
          setPrefix( null );
      }
  
      /**
       * Notify listener of log message event.
       *
       * @param message the message
       */
      public void log( String message )
      {
          output( message );
      }
  
      /**
       * Notify listener of log message event.
       *
       * @param message the message
       * @param throwable the throwable
       */
      public void log( String message, Throwable throwable )
      {
          output( message + "\n" + ExceptionUtil.printStackTrace( throwable, 5, true ) );
      }
  
      /**
       * Utility class to output data.
       * Overide in sub-classes to direct to a different destination.
       *
       * @param data the data
       */
      protected void output( final String data )
      {
          if( null != getPrefix() ) System.out.println( "\t[" + getPrefix() + "] " + data
);
          else System.out.println( data );
      }
  
      protected final String getPrefix()
      {
          return m_prefix;
      }
  
      protected final void setPrefix( final String prefix )
      {
          m_prefix = prefix;
      }
  }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/ProjectListener.java
  
  Index: ProjectListener.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.myrmidon.listeners;
  
  /**
   * The interface to implement if you want to receive
   * notification of project status.
   *
   * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
   */
  public interface ProjectListener
  {
      /**
       * Notify listener of projectStarted event.
       */
      void projectStarted();
  
      /**
       * Notify listener of projectFinished event.
       */
      void projectFinished();
  
      /**
       * Notify listener of targetStarted event.
       *
       * @param targetName the name of target
       */
      void targetStarted( String targetName );
  
      /**
       * Notify listener of targetFinished event.
       */
      void targetFinished();
  
      /**
       * Notify listener of taskStarted event.
       *
       * @param taskName the name of task
       */
      void taskStarted( String taskName );
  
      /**
       * Notify listener of taskFinished event.
       */
      void taskFinished();
  
      /**
       * Notify listener of log message event.
       *
       * @param message the message
       */
      void log( String message );
  
      /**
       * Notify listener of log message event.
       *
       * @param message the message
       * @param throwable the throwable
       */
      void log( String message, Throwable throwable );
  }
  
  
  

Mime
View raw message