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 Javac12.java
Date Thu, 14 Feb 2002 11:03:59 GMT
donaldp     02/02/14 03:03:59

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit
                        JUnitTask.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers
                        Javac12.java
  Log:
  Write to system.out by default because that gets redirectted to task anyhow
  
  Revision  Changes    Path
  1.39      +4 -16     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- JUnitTask.java	14 Feb 2002 09:34:27 -0000	1.38
  +++ JUnitTask.java	14 Feb 2002 11:03:59 -0000	1.39
  @@ -10,7 +10,6 @@
   import java.io.File;
   import java.io.FileOutputStream;
   import java.io.IOException;
  -import java.io.OutputStream;
   import java.net.URL;
   import java.net.URLClassLoader;
   import java.util.ArrayList;
  @@ -20,11 +19,10 @@
   import java.util.Properties;
   import java.util.Random;
   import org.apache.aut.nativelib.ExecManager;
  -import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.TaskContext;
  -import org.apache.tools.ant.Task;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.Execute;
  -import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
  +import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.Argument;
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.CommandlineJava;
  @@ -400,16 +398,6 @@
       }
   
       /**
  -     * Get the default output for a formatter.
  -     *
  -     * @return The DefaultOutput value
  -     */
  -    protected OutputStream getDefaultOutput()
  -    {
  -        return new LogOutputStream( getLogger(), false );
  -    }
  -
  -    /**
        * Merge all individual tests from the batchtest with all individual tests
        * and return an enumeration over all <tt>JUnitTest</tt> .
        *
  @@ -713,7 +701,7 @@
                   SummaryJUnitResultFormatter f =
                       new SummaryJUnitResultFormatter();
                   f.setWithOutAndErr( "withoutanderr".equalsIgnoreCase( summaryValue ) );
  -                f.setOutput( getDefaultOutput() );
  +                f.setOutput( System.out );
                   runner.addFormatter( f );
               }
   
  @@ -728,7 +716,7 @@
                   }
                   else
                   {
  -                    fe.setOutput( getDefaultOutput() );
  +                    fe.setOutput( System.out );
                   }
                   runner.addFormatter( fe.createFormatter() );
               }
  
  
  
  1.10      +1 -16     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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Javac12.java	6 Jan 2002 01:55:30 -0000	1.9
  +++ Javac12.java	14 Feb 2002 11:03:59 -0000	1.10
  @@ -7,12 +7,10 @@
    */
   package org.apache.tools.ant.taskdefs.compilers;
   
  -import java.io.IOException;
   import java.io.OutputStream;
   import java.lang.reflect.Constructor;
   import java.lang.reflect.Method;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
   import org.apache.tools.ant.types.Commandline;
   
   /**
  @@ -34,14 +32,13 @@
           getLogger().debug( "Using classic compiler" );
           Commandline cmd = setupJavacCommand( true );
   
  -        OutputStream logstr = new LogOutputStream( getLogger(), true );
           try
           {
               // Create an instance of the compiler, redirecting output to
               // the project log
               Class c = Class.forName( "sun.tools.javac.Main" );
               Constructor cons = c.getConstructor( new Class[]{OutputStream.class, String.class}
);
  -            Object compiler = cons.newInstance( new Object[]{logstr, "javac"} );
  +            Object compiler = cons.newInstance( new Object[]{System.out, "javac"} );
   
               // Call the compile() method
               Method compile = c.getMethod( "compile", new Class[]{String[].class} );
  @@ -63,18 +60,6 @@
               else
               {
                   throw new TaskException( "Error starting classic compiler: ", ex );
  -            }
  -        }
  -        finally
  -        {
  -            try
  -            {
  -                logstr.close();
  -            }
  -            catch( IOException e )
  -            {
  -                // plain impossible
  -                throw new TaskException( "Error", e );
               }
           }
       }
  
  
  

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