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/compilers Sj.java Kjc.java Jvc.java Jikes.java JavacExternal.java Javac13.java Javac12.java Gcj.java DefaultCompilerAdapter.java
Date Wed, 06 Mar 2002 10:13:28 GMT
donaldp     02/03/06 02:13:28

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers
                        Sj.java Kjc.java Jvc.java Jikes.java
                        JavacExternal.java Javac13.java Javac12.java
                        Gcj.java DefaultCompilerAdapter.java
  Log:
  Convert Javac to using TaskContext to log
  
  Revision  Changes    Path
  1.5       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Sj.java
  
  Index: Sj.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Sj.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Sj.java	23 Dec 2001 14:22:44 -0000	1.4
  +++ Sj.java	6 Mar 2002 10:13:28 -0000	1.5
  @@ -8,6 +8,7 @@
   package org.apache.tools.ant.taskdefs.compilers;
   
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.tools.ant.types.Commandline;
   
   /**
  @@ -29,7 +30,7 @@
       public boolean execute()
           throws TaskException
       {
  -        getLogger().debug( "Using symantec java compiler" );
  +        getTaskContext().debug( "Using symantec java compiler" );
   
           Commandline cmd = setupJavacCommand();
           cmd.setExecutable( "sj" );
  
  
  
  1.10      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java
  
  Index: Kjc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Kjc.java	20 Jan 2002 02:11:42 -0000	1.9
  +++ Kjc.java	6 Mar 2002 10:13:28 -0000	1.10
  @@ -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;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.util.FileUtils;
  @@ -25,7 +26,7 @@
       public boolean execute()
           throws TaskException
       {
  -        getLogger().debug( "Using kjc compiler" );
  +        getTaskContext().debug( "Using kjc compiler" );
           Commandline cmd = setupKjcCommand();
   
           try
  
  
  
  1.8       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java
  
  Index: Jvc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Jvc.java	20 Jan 2002 02:11:42 -0000	1.7
  +++ Jvc.java	6 Mar 2002 10:13:28 -0000	1.8
  @@ -8,6 +8,7 @@
   package org.apache.tools.ant.taskdefs.compilers;
   
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.util.FileUtils;
  @@ -28,7 +29,7 @@
       public boolean execute()
           throws TaskException
       {
  -        getLogger().debug( "Using jvc compiler" );
  +        getTaskContext().debug( "Using jvc compiler" );
   
           Path classpath = new Path();
   
  
  
  
  1.13      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java
  
  Index: Jikes.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Jikes.java	6 Feb 2002 13:38:21 -0000	1.12
  +++ Jikes.java	6 Mar 2002 10:13:28 -0000	1.13
  @@ -8,6 +8,7 @@
   package org.apache.tools.ant.taskdefs.compilers;
   
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.util.FileUtils;
  @@ -40,7 +41,7 @@
       public boolean execute()
           throws TaskException
       {
  -        getLogger().debug( "Using jikes compiler" );
  +        getTaskContext().debug( "Using jikes compiler" );
   
           Path classpath = new Path();
   
  
  
  
  1.5       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java
  
  Index: JavacExternal.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JavacExternal.java	23 Dec 2001 14:22:44 -0000	1.4
  +++ JavacExternal.java	6 Mar 2002 10:13:28 -0000	1.5
  @@ -8,6 +8,7 @@
   package org.apache.tools.ant.taskdefs.compilers;
   
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.tools.ant.types.Commandline;
   
   /**
  @@ -27,7 +28,7 @@
       public boolean execute()
           throws TaskException
       {
  -        getLogger().debug( "Using external javac compiler" );
  +        getTaskContext().debug( "Using external javac compiler" );
   
           Commandline cmd = new Commandline();
           cmd.setExecutable( getJavac().getJavacExecutable() );
  
  
  
  1.6       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java
  
  Index: Javac13.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Javac13.java	23 Dec 2001 14:22:44 -0000	1.5
  +++ Javac13.java	6 Mar 2002 10:13:28 -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;
   
   /**
  @@ -32,7 +33,7 @@
       public boolean execute()
           throws TaskException
       {
  -        getLogger().debug( "Using modern compiler" );
  +        getTaskContext().debug( "Using modern compiler" );
           Commandline cmd = setupModernJavacCommand();
   
           // Use reflection to be able to build on all JDKs >= 1.1:
  
  
  
  1.11      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
  
  Index: Javac12.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Javac12.java	14 Feb 2002 11:03:59 -0000	1.10
  +++ Javac12.java	6 Mar 2002 10:13:28 -0000	1.11
  @@ -11,6 +11,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;
   
   /**
  @@ -29,7 +30,7 @@
       public boolean execute()
           throws TaskException
       {
  -        getLogger().debug( "Using classic compiler" );
  +        getTaskContext().debug( "Using classic compiler" );
           Commandline cmd = setupJavacCommand( true );
   
           try
  
  
  
  1.9       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java
  
  Index: Gcj.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Gcj.java	20 Jan 2002 02:11:42 -0000	1.8
  +++ Gcj.java	6 Mar 2002 10:13:28 -0000	1.9
  @@ -8,6 +8,7 @@
   package org.apache.tools.ant.taskdefs.compilers;
   
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.util.FileUtils;
  @@ -32,7 +33,7 @@
           throws TaskException
       {
           Commandline cmd;
  -        getLogger().debug( "Using gcj compiler" );
  +        getTaskContext().debug( "Using gcj compiler" );
           cmd = setupGCJCommand();
   
           int firstFileName = cmd.size();
  
  
  
  1.34      +25 -11    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  
  Index: DefaultCompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- DefaultCompilerAdapter.java	3 Mar 2002 06:40:11 -0000	1.33
  +++ DefaultCompilerAdapter.java	6 Mar 2002 10:13:28 -0000	1.34
  @@ -15,6 +15,8 @@
   import org.apache.avalon.excalibur.io.IOUtil;
   import org.apache.avalon.excalibur.util.StringUtil;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.logger.Logger;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.Execute;
   import org.apache.tools.ant.types.Commandline;
  @@ -33,7 +35,7 @@
    * @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
    */
   public abstract class DefaultCompilerAdapter
  -    extends AbstractLogEnabled
  +//    extends AbstractLogEnabled
       implements CompilerAdapter
   {
       protected boolean m_debug;
  @@ -63,6 +65,18 @@
       protected Path src;
       protected String target;
   
  +    private TaskContext m_taskContext;
  +
  +    public void setTaskContext( final TaskContext context )
  +    {
  +        m_taskContext = context;
  +    }
  +
  +    protected final TaskContext getTaskContext()
  +    {
  +        return m_taskContext;
  +    }
  +
       public void setJavac( Javac attributes )
       {
           m_attributes = attributes;
  @@ -130,7 +144,7 @@
               if( !m_attributes.isForkedJavac() )
               {
                   final String message = "Since fork is false, ignoring memoryInitialSize
setting.";
  -                getLogger().warn( message );
  +                getTaskContext().warn( message );
               }
               else
               {
  @@ -143,7 +157,7 @@
               if( !m_attributes.isForkedJavac() )
               {
                   final String message = "Since fork is false, ignoring memoryMaximumSize
setting.";
  -                getLogger().warn( message );
  +                getTaskContext().warn( message );
               }
               else
               {
  @@ -358,12 +372,12 @@
                   commandArray = args;
               }
   
  -                final ExecManager execManager = (ExecManager)m_attributes.getService( ExecManager.class
);
  -                final Execute exe = new Execute( execManager );
  -                exe.setWorkingDirectory( m_baseDir );
  -                final String[] commandline = commandArray;
  -                exe.setCommandline( new Commandline( commandline ) );
  -                return exe.execute();
  +            final ExecManager execManager = (ExecManager)m_attributes.getService( ExecManager.class
);
  +            final Execute exe = new Execute( execManager );
  +            exe.setWorkingDirectory( m_baseDir );
  +            final String[] commandline = commandArray;
  +            exe.setCommandline( new Commandline( commandline ) );
  +            return exe.execute();
           }
           finally
           {
  @@ -382,7 +396,7 @@
        */
       protected void logAndAddFilesToCompile( Commandline cmd )
       {
  -        getLogger().debug( "Compilation args: " + cmd.toString() );
  +        getTaskContext().debug( "Compilation args: " + cmd.toString() );
   
           StringBuffer niceSourceList = new StringBuffer( "File" );
           if( m_compileList.length != 1 )
  @@ -400,7 +414,7 @@
               niceSourceList.append( "    " + arg + StringUtil.LINE_SEPARATOR );
           }
   
  -        getLogger().debug( niceSourceList.toString() );
  +        getTaskContext().debug( niceSourceList.toString() );
       }
   
       /**
  
  
  

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