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/main/org/apache/tools/ant/taskdefs/rmic DefaultRmicAdapter.java KaffeRmic.java Rmic.java RmicAdapter.java RmicAdapterFactory.java SunRmic.java WLRmic.java
Date Wed, 06 Mar 2002 10:37:01 GMT
donaldp     02/03/06 02:37:01

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic
                        DefaultRmicAdapter.java KaffeRmic.java Rmic.java
                        RmicAdapter.java RmicAdapterFactory.java
                        SunRmic.java WLRmic.java
  Log:
  Convert Rmic to using TaskContext to log
  
  Revision  Changes    Path
  1.17      +18 -12    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
  
  Index: DefaultRmicAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DefaultRmicAdapter.java	4 Mar 2002 02:44:14 -0000	1.16
  +++ DefaultRmicAdapter.java	6 Mar 2002 10:37:00 -0000	1.17
  @@ -10,7 +10,6 @@
   import java.io.File;
   import java.util.ArrayList;
   import java.util.Random;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.FileNameMapper;
  @@ -30,7 +29,6 @@
    * @author Takashi Okamoto <tokamoto@rd.nttdata.co.jp>
    */
   public abstract class DefaultRmicAdapter
  -    extends AbstractLogEnabled
       implements RmicAdapter
   {
   
  @@ -39,8 +37,16 @@
       private Rmic attributes;
       private FileNameMapper mapper;
   
  -    public DefaultRmicAdapter()
  +    private TaskContext m_taskContext;
  +
  +    public void setTaskContext( final TaskContext context )
  +    {
  +        m_taskContext = context;
  +    }
  +
  +    protected final TaskContext getTaskContext()
       {
  +        return m_taskContext;
       }
   
       public void setRmic( Rmic attributes )
  @@ -144,11 +150,11 @@
   
           if( attributes.getIiop() )
           {
  -            getLogger().info( "IIOP has been turned on." );
  +            getTaskContext().info( "IIOP has been turned on." );
               cmd.addArgument( "-iiop" );
               if( attributes.getIiopopts() != null )
               {
  -                getLogger().info( "IIOP Options: " + attributes.getIiopopts() );
  +                getTaskContext().info( "IIOP Options: " + attributes.getIiopopts() );
                   cmd.addArgument( attributes.getIiopopts() );
               }
           }
  @@ -156,11 +162,11 @@
           if( attributes.getIdl() )
           {
               cmd.addArgument( "-idl" );
  -            getLogger().info( "IDL has been turned on." );
  +            getTaskContext().info( "IDL has been turned on." );
               if( attributes.getIdlopts() != null )
               {
                   cmd.addArgument( attributes.getIdlopts() );
  -                getLogger().info( "IDL Options: " + attributes.getIdlopts() );
  +                getTaskContext().info( "IDL Options: " + attributes.getIdlopts() );
               }
           }
   
  @@ -220,7 +226,7 @@
       {
           ArrayList compileList = attributes.getCompileList();
   
  -        getLogger().debug( "Compilation args: " + cmd.toString() );
  +        getTaskContext().debug( "Compilation args: " + cmd.toString() );
   
           StringBuffer niceSourceList = new StringBuffer( "File" );
           if( compileList.size() != 1 )
  @@ -236,7 +242,7 @@
               niceSourceList.append( "    " + arg );
           }
   
  -        getLogger().debug( niceSourceList.toString() );
  +        getTaskContext().debug( niceSourceList.toString() );
       }
   
       /**
  @@ -385,20 +391,20 @@
                   {
                       final String message = "Unable to verify class " + classname
                           + ". It could not be found.";
  -                    getLogger().warn( message );
  +                    getTaskContext().warn( message );
                   }
                   catch( NoClassDefFoundError e )
                   {
                       final String message = "Unable to verify class " + classname
                           + ". It is not defined.";
  -                    getLogger().warn( message );
  +                    getTaskContext().warn( message );
                   }
                   catch( Throwable t )
                   {
                       final String message = "Unable to verify class " + classname
                           + ". Loading caused Exception: "
                           + t.getMessage();
  -                    getLogger().warn( message );
  +                    getTaskContext().warn( message );
                   }
               }
               return target;
  
  
  
  1.6       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java
  
  Index: KaffeRmic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- KaffeRmic.java	23 Dec 2001 14:22:48 -0000	1.5
  +++ KaffeRmic.java	6 Mar 2002 10:37:00 -0000	1.6
  @@ -10,6 +10,7 @@
   import java.lang.reflect.Constructor;
   import java.lang.reflect.Method;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.tools.ant.types.Commandline;
   
   /**
  @@ -23,7 +24,7 @@
       public boolean execute()
           throws TaskException
       {
  -        getLogger().debug( "Using Kaffe rmic" );
  +        getTaskContext().debug( "Using Kaffe rmic" );
           Commandline cmd = setupRmicCommand();
   
           try
  
  
  
  1.3       +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/Rmic.java
  
  Index: Rmic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/Rmic.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Rmic.java	4 Mar 2002 02:44:14 -0000	1.2
  +++ Rmic.java	6 Mar 2002 10:37:00 -0000	1.3
  @@ -479,7 +479,7 @@
           }
   
           String compiler = getContext().getProperty( "build.rmic" ).toString();
  -        RmicAdapter adapter = RmicAdapterFactory.getRmic( compiler );
  +        RmicAdapter adapter = RmicAdapterFactory.getRmic( compiler, getContext() );
   
           // now we need to populate the compiler adapter
           adapter.setRmic( this );
  
  
  
  1.8       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapter.java
  
  Index: RmicAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RmicAdapter.java	4 Mar 2002 02:44:14 -0000	1.7
  +++ RmicAdapter.java	6 Mar 2002 10:37:00 -0000	1.8
  @@ -8,6 +8,7 @@
   package org.apache.tools.ant.taskdefs.rmic;
   
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.framework.FileNameMapper;
   import org.apache.tools.ant.types.Path;
   
  @@ -23,9 +24,9 @@
    * @author <a href="mailto:tokamoto@rd.nttdata.co.jp">Takashi Okamoto</a>
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    */
  -
   public interface RmicAdapter
   {
  +    void setTaskContext( TaskContext context );
   
       /**
        * Sets the rmic attributes, which are stored in the Rmic task.
  
  
  
  1.5       +9 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java
  
  Index: RmicAdapterFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RmicAdapterFactory.java	21 Feb 2002 09:41:55 -0000	1.4
  +++ RmicAdapterFactory.java	6 Mar 2002 10:37:00 -0000	1.5
  @@ -8,6 +8,7 @@
   package org.apache.tools.ant.taskdefs.rmic;
   
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   
   /**
    * Creates the necessary rmic adapter, given basic criteria.
  @@ -42,8 +43,15 @@
        * @throws TaskException if the rmic type could not be resolved into a rmic
        *      adapter.
        */
  -    public static RmicAdapter getRmic( String rmicType )
  +    public static RmicAdapter getRmic( final String rmicType, final TaskContext context
)
           throws TaskException
  +    {
  +        final RmicAdapter adaptor = createAdaptor( rmicType );
  +        adaptor.setTaskContext( context );
  +        return adaptor;
  +    }
  +
  +    private static RmicAdapter createAdaptor( String rmicType ) throws TaskException
       {
           if( rmicType == null )
           {
  
  
  
  1.12      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java
  
  Index: SunRmic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SunRmic.java	14 Feb 2002 11:06:36 -0000	1.11
  +++ SunRmic.java	6 Mar 2002 10:37:00 -0000	1.12
  @@ -12,6 +12,7 @@
   import java.lang.reflect.Constructor;
   import java.lang.reflect.Method;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.tools.ant.types.Commandline;
   
   /**
  @@ -25,7 +26,7 @@
       public boolean execute()
           throws TaskException
       {
  -        getLogger().debug( "Using SUN rmic compiler" );
  +        getTaskContext().debug( "Using SUN rmic compiler" );
           Commandline cmd = setupRmicCommand();
   
           // Create an instance of the rmic, redirecting output to
  
  
  
  1.6       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java
  
  Index: WLRmic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WLRmic.java	23 Dec 2001 14:22:48 -0000	1.5
  +++ WLRmic.java	6 Mar 2002 10:37:00 -0000	1.6
  @@ -9,6 +9,7 @@
   
   import java.lang.reflect.Method;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.tools.ant.types.Commandline;
   
   /**
  @@ -42,7 +43,7 @@
       public boolean execute()
           throws TaskException
       {
  -        getLogger().debug( "Using WebLogic rmic" );
  +        getTaskContext().debug( "Using WebLogic rmic" );
           Commandline cmd = setupRmicCommand( new String[]{"-noexit"} );
   
           try
  
  
  

--
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