Browse Source

Update to use new format of LogOutputStream where you pass in a Logger

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270408 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
5205e1bb54
46 changed files with 186 additions and 160 deletions
  1. +2
    -2
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Patch.java
  2. +4
    -4
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  3. +2
    -2
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/ExecTask.java
  4. +5
    -3
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute.java
  5. +5
    -5
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/Javadoc.java
  6. +13
    -10
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/JavadocOutputStream.java
  7. +2
    -2
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java
  8. +5
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ccm/Continuus.java
  9. +2
    -2
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java
  10. +2
    -3
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
  11. +2
    -2
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
  12. +4
    -4
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  13. +3
    -3
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  14. +3
    -3
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAudit.java
  15. +3
    -3
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetrics.java
  16. +6
    -3
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java
  17. +4
    -3
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
  18. +2
    -2
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java
  19. +7
    -9
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java
  20. +9
    -7
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java
  21. +2
    -2
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
  22. +2
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java
  23. +4
    -4
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix/Rpm.java
  24. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Patch.java
  25. +4
    -4
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  26. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/exec/ExecTask.java
  27. +5
    -3
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/exec/Execute.java
  28. +5
    -5
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/javadoc/Javadoc.java
  29. +13
    -10
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/javadoc/JavadocOutputStream.java
  30. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ANTLR.java
  31. +5
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ccm/Continuus.java
  32. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java
  33. +2
    -3
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
  34. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
  35. +4
    -4
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  36. +3
    -3
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  37. +3
    -3
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/metamata/MAudit.java
  38. +3
    -3
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/metamata/MMetrics.java
  39. +6
    -3
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java
  40. +4
    -3
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
  41. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java
  42. +7
    -9
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java
  43. +9
    -7
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java
  44. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
  45. +2
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/rmic/SunRmic.java
  46. +4
    -4
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/unix/Rpm.java

+ 2
- 2
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Patch.java View File

@@ -143,8 +143,8 @@ public class Patch extends Task
}

Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );
exe.setCommandline( toExecute.getCommandline() );
try
{


+ 4
- 4
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java View File

@@ -179,7 +179,7 @@ public abstract class DefaultCompilerAdapter
// as well as "bootclasspath" and "extdirs"
if( Project.getJavaVersion().startsWith( "1.1" ) )
{
Path cp = new Path( m_project );
Path cp = new Path();
/*
* XXX - This doesn't mix very well with build.systemclasspath,
*/
@@ -324,7 +324,7 @@ public abstract class DefaultCompilerAdapter
protected Path getCompileClasspath()
throws TaskException
{
Path classpath = new Path( m_project );
Path classpath = new Path();

// add dest dir to classpath so that previously compiled and
// untouched classes are on classpath
@@ -438,8 +438,8 @@ public abstract class DefaultCompilerAdapter
try
{
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( m_attributes, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( m_attributes, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( m_attributes.hackGetLogger(), false ) );
exe.setError( new LogOutputStream( m_attributes.hackGetLogger(), true ) );
exe.setWorkingDirectory( m_project.getBaseDir() );
exe.setCommandline( commandArray );
return exe.execute();


+ 2
- 2
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/ExecTask.java View File

@@ -308,8 +308,8 @@ public class ExecTask extends Task
}
else
{
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );
}
}



+ 5
- 3
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute.java View File

@@ -18,6 +18,7 @@ import org.apache.myrmidon.framework.exec.ExecMetaData;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Commandline;
import org.apache.avalon.framework.logger.Logger;

/**
* Runs an external program.
@@ -65,10 +66,11 @@ public class Execute
{
try
{
task.hackGetLogger().debug( Commandline.toString( cmdline ) );
final Logger logger = task.hackGetLogger();
logger.debug( Commandline.toString( cmdline ) );
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( task, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( task, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( logger, false ) );
exe.setError( new LogOutputStream( logger, true ) );

exe.setCommandline( cmdline );
int retval = exe.execute();


+ 5
- 5
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/Javadoc.java View File

@@ -512,7 +512,7 @@ public class Javadoc
{
if( m_bootclasspath == null )
{
m_bootclasspath = new Path( getProject() );
m_bootclasspath = new Path();
}
return m_bootclasspath.createPath();
}
@@ -522,7 +522,7 @@ public class Javadoc
{
if( m_classpath == null )
{
m_classpath = new Path( getProject() );
m_classpath = new Path();
}
return m_classpath.createPath();
}
@@ -552,7 +552,7 @@ public class Javadoc
{
if( m_sourcePath == null )
{
m_sourcePath = new Path( getProject() );
m_sourcePath = new Path();
}
return m_sourcePath.createPath();
}
@@ -838,8 +838,8 @@ public class Javadoc

getLogger().info( "Javadoc execution" );

JavadocOutputStream out = new JavadocOutputStream( this, Project.MSG_INFO );
JavadocOutputStream err = new JavadocOutputStream( this, Project.MSG_WARN );
final JavadocOutputStream out = new JavadocOutputStream( getLogger(), false );
final JavadocOutputStream err = new JavadocOutputStream( getLogger(), true );
Execute exe = new Execute();
exe.setOutput( out );
exe.setError( err );


+ 13
- 10
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/JavadocOutputStream.java View File

@@ -10,30 +10,29 @@ package org.apache.tools.ant.taskdefs.javadoc;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
import org.apache.avalon.framework.logger.Logger;

class JavadocOutputStream
extends LogOutputStream
{

//
// Override the logging of output in order to filter out Generating
// messages. Generating messages are set to a priority of VERBOSE
// unless they appear after what could be an informational message.
//
private String m_queuedLine;

JavadocOutputStream( Task javadoc, int level )
JavadocOutputStream( final Logger logger, final boolean isError )
{
super( javadoc, level );
super( logger, isError );
}

protected void processLine( String line, int messageLevel )
protected void processLine( final String line )
{
if( messageLevel == Project.MSG_INFO && line.startsWith( "Generating " ) )
if( !isError() && line.startsWith( "Generating " ) )
{
if( m_queuedLine != null )
{
super.processLine( m_queuedLine, Project.MSG_VERBOSE );
getLogger().debug( m_queuedLine );
}
m_queuedLine = line;
}
@@ -42,12 +41,16 @@ class JavadocOutputStream
if( m_queuedLine != null )
{
if( line.startsWith( "Building " ) )
super.processLine( m_queuedLine, Project.MSG_VERBOSE );
{
getLogger().debug( m_queuedLine );
}
else
super.processLine( m_queuedLine, Project.MSG_INFO );
{
getLogger().info( m_queuedLine );
}
m_queuedLine = null;
}
super.processLine( line, messageLevel );
getLogger().warn( line );
}
}
}

+ 2
- 2
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java View File

@@ -225,8 +225,8 @@ public class ANTLR extends Task
throws TaskException
{
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );

if( workingdir != null )
{


+ 5
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ccm/Continuus.java View File

@@ -14,6 +14,7 @@ import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.exec.Execute;
import org.apache.tools.ant.taskdefs.exec.ExecuteStreamHandler;
import org.apache.tools.ant.taskdefs.exec.LogStreamHandler;
import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
import org.apache.tools.ant.types.Commandline;

/**
@@ -127,6 +128,9 @@ public abstract class Continuus
protected int run( final Commandline cmd )
throws TaskException
{
return run( cmd, new LogStreamHandler( this, Project.MSG_VERBOSE, Project.MSG_WARN ) );
final LogOutputStream output = new LogOutputStream( getLogger(), false );
final LogOutputStream error = new LogOutputStream( getLogger(), true );
final LogStreamHandler handler = new LogStreamHandler( output, error );
return run( cmd, handler );
}
}

+ 2
- 2
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java View File

@@ -109,8 +109,8 @@ public abstract class ClearCase extends Task
try
{
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );
exe.setWorkingDirectory( getBaseDirectory() );
exe.setCommandline( cmd.getCommandline() );
return exe.execute();


+ 2
- 3
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java View File

@@ -11,7 +11,6 @@ import java.io.File;
import java.io.IOException;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.exec.Execute;
import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
@@ -202,8 +201,8 @@ public class NetCommand
// default directory to the project's base directory
File dir = _owner.getBaseDirectory();
_exe = new Execute();
_exe.setOutput( new LogOutputStream( _owner, Project.MSG_INFO ) );
_exe.setError( new LogOutputStream( _owner, Project.MSG_WARN ) );
_exe.setOutput( new LogOutputStream( _owner.hackGetLogger(), false ) );
_exe.setError( new LogOutputStream( _owner.hackGetLogger(), true ) );
_exe.setWorkingDirectory( dir );
}
}

+ 2
- 2
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java View File

@@ -185,8 +185,8 @@ public class JJTree extends Task
arg.setValue( "-Dinstall.root=" + javaccHome.getAbsolutePath() );

final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), false ) );

getLogger().debug( cmdl.toString() );
exe.setCommandline( cmdl.getCommandline() );


+ 4
- 4
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java View File

@@ -205,7 +205,7 @@ public class JDependTask extends Task
{
if( _compileClasspath == null )
{
_compileClasspath = new Path( getProject() );
_compileClasspath = new Path();
}
return _compileClasspath.createPath();
}
@@ -232,7 +232,7 @@ public class JDependTask extends Task
{
if( _sourcesPath == null )
{
_sourcesPath = new Path( getProject() );
_sourcesPath = new Path();
}
return _sourcesPath.createPath();
}
@@ -328,8 +328,8 @@ public class JDependTask extends Task
}

final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );

exe.setCommandline( commandline.getCommandline() );
if( getDir() != null )


+ 3
- 3
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java View File

@@ -405,7 +405,7 @@ public class JUnitTask extends Task
*/
protected OutputStream getDefaultOutput()
{
return new LogOutputStream( this, Project.MSG_INFO );
return new LogOutputStream( getLogger(), false );
}

/**
@@ -650,8 +650,8 @@ public class JUnitTask extends Task
}

final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );

exe.setCommandline( cmd.getCommandline() );
if( dir != null )


+ 3
- 3
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAudit.java View File

@@ -135,7 +135,7 @@ public class MAudit extends AbstractMetamataTask
{
if( searchPath == null )
{
searchPath = new Path( getProject() );
searchPath = new Path();
}
return searchPath;
}
@@ -226,8 +226,8 @@ public class MAudit extends AbstractMetamataTask
// if we didn't specify a file, then use a screen report
if( outFile == null )
{
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );
}
else
{


+ 3
- 3
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetrics.java View File

@@ -114,7 +114,7 @@ public class MMetrics extends AbstractMetamataTask
{
if( path == null )
{
path = new Path( getProject() );
path = new Path();
}
return path;
}
@@ -226,8 +226,8 @@ public class MMetrics extends AbstractMetamataTask
*/
protected void setupStreamHandler( final Execute exe )
{
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), false ) );
}

protected void execute0( ExecuteStreamHandler handler )


+ 6
- 3
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java View File

@@ -18,6 +18,7 @@ import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.exec.Execute;
import org.apache.tools.ant.taskdefs.exec.ExecuteStreamHandler;
import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
import org.apache.tools.ant.taskdefs.exec.LogStreamHandler;
import org.apache.tools.ant.types.Argument;
import org.apache.tools.ant.types.CommandlineJava;
@@ -150,7 +151,7 @@ public class MParse extends Task
{
if( classpath == null )
{
classpath = new Path( getProject() );
classpath = new Path();
}
return classpath;
}
@@ -174,7 +175,7 @@ public class MParse extends Task
{
if( sourcepath == null )
{
sourcepath = new Path( getProject() );
sourcepath = new Path();
}
return sourcepath;
}
@@ -385,7 +386,9 @@ public class MParse extends Task
*/
protected ExecuteStreamHandler createStreamHandler()
{
return new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_INFO );
final LogOutputStream output = new LogOutputStream( getLogger(), false );
final LogOutputStream error = new LogOutputStream( getLogger(), false );
return new LogStreamHandler( output, error );
}

/**


+ 4
- 3
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java View File

@@ -365,7 +365,8 @@ public class Pvcs extends org.apache.tools.ant.Task
tmp = new File( "pvcs_ant_" + rand.nextLong() + ".log" );
tmp2 = new File( "pvcs_ant_" + rand.nextLong() + ".log" );
getLogger().debug( "Executing " + commandLine.toString() );
result = runCmd( commandLine, new FileOutputStream( tmp ), new LogOutputStream( this, Project.MSG_WARN ) );
result = runCmd( commandLine, new FileOutputStream( tmp ),
new LogOutputStream( getLogger(), true ) );
if( result != 0 && !ignorerc )
{
String msg = "Failed executing: " + commandLine.toString();
@@ -407,8 +408,8 @@ public class Pvcs extends org.apache.tools.ant.Task
commandLine.createArgument().setValue( "@" + tmp2.getAbsolutePath() );
getLogger().info( "Getting files" );
getLogger().debug( "Executing " + commandLine.toString() );
final LogOutputStream output = new LogOutputStream( this, Project.MSG_INFO );
final LogOutputStream error = new LogOutputStream( this, Project.MSG_WARN );
final LogOutputStream output = new LogOutputStream( getLogger(), false );
final LogOutputStream error = new LogOutputStream( getLogger(), true );
result = runCmd( commandLine, output, error );

if( result != 0 && !ignorerc )


+ 2
- 2
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java View File

@@ -116,8 +116,8 @@ public class CovMerge extends Task
cmdl.createArgument().setValue( "-jp_paramfile=" + paramfile.getAbsolutePath() );

final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );
getLogger().debug( cmdl.toString() );
exe.setCommandline( cmdl.getCommandline() );



+ 7
- 9
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java View File

@@ -203,7 +203,7 @@ public class CovReport extends Task
{
if( coveragePath == null )
{
coveragePath = new Path( getProject() );
coveragePath = new Path();
}
return coveragePath.createPath();
}
@@ -221,7 +221,7 @@ public class CovReport extends Task
{
if( sourcePath == null )
{
sourcePath = new Path( getProject() );
sourcePath = new Path();
}
return sourcePath.createPath();
}
@@ -243,8 +243,8 @@ public class CovReport extends Task

// use the custom handler for stdin issues
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );
getLogger().debug( cmdl.toString() );
exe.setCommandline( cmdl.getCommandline() );
int exitValue = exe.execute();
@@ -291,7 +291,7 @@ public class CovReport extends Task
// as a default -sourcepath use . in JProbe, so use project .
if( sourcePath == null )
{
sourcePath = new Path( getProject() );
sourcePath = new Path();
sourcePath.createPath().setLocation( getBaseDirectory() );
}
v.add( "-sourcepath=" + sourcePath );
@@ -301,9 +301,7 @@ public class CovReport extends Task
v.add( "-inc_src_text=" + ( includeSource ? "on" : "off" ) );
}

String[] params = new String[ v.size() ];
v.copyInto( params );
return params;
return (String[])v.toArray( new String[ v.size() ] );
}

/**
@@ -365,7 +363,7 @@ public class CovReport extends Task
{
if( classPath == null )
{
classPath = new Path( CovReport.this.getProject() );
classPath = new Path();
}
return classPath.createPath();
}


+ 9
- 7
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java View File

@@ -20,6 +20,7 @@ import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.exec.Execute;
import org.apache.tools.ant.taskdefs.exec.LogStreamHandler;
import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
import org.apache.tools.ant.types.Argument;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.CommandlineJava;
@@ -294,7 +295,9 @@ public class Coverage extends Task
cmdl.createArgument().setValue( "-jp_input=" + paramfile.getAbsolutePath() );

// use the custom handler for stdin issues
LogStreamHandler handler = new CoverageStreamHandler( this );
final LogOutputStream output = new LogOutputStream( getLogger(), false );
final LogOutputStream error = new LogOutputStream( getLogger(), true );
final LogStreamHandler handler = new CoverageStreamHandler( output, error );
Execute exec = new Execute( handler );
getLogger().debug( cmdl.toString() );
exec.setCommandline( cmdl.getCommandline() );
@@ -383,9 +386,7 @@ public class Coverage extends Task
params.add( args[ i ] );
}

String[] array = new String[ params.size() ];
params.copyInto( array );
return array;
return (String[])params.toArray( new String[ params.size() ] );
}

/**
@@ -540,11 +541,12 @@ public class Coverage extends Task
/**
* specific pumper to avoid those nasty stdin issues
*/
static class CoverageStreamHandler extends LogStreamHandler
static class CoverageStreamHandler
extends LogStreamHandler
{
CoverageStreamHandler( Task task )
CoverageStreamHandler( OutputStream output, OutputStream error )
{
super( task, Project.MSG_INFO, Project.MSG_WARN );
super( output, error );
}

/**


+ 2
- 2
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java View File

@@ -206,8 +206,8 @@ public abstract class MSVSS extends Task
try
{
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );

// If location of ss.ini is specified we need to set the
// environment-variable SSDIR to this value


+ 2
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java View File

@@ -32,7 +32,8 @@ public class SunRmic extends DefaultRmicAdapter

// Create an instance of the rmic, redirecting output to
// the project log
LogOutputStream logstr = new LogOutputStream( getRmic(), Project.MSG_WARN );
LogOutputStream logstr =
new LogOutputStream( getRmic().hackGetLogger(), true );

try
{


+ 4
- 4
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix/Rpm.java View File

@@ -146,8 +146,8 @@ public class Rpm extends Task

if( error == null && output == null )
{
outputstream = new LogOutputStream( this, Project.MSG_INFO );
errorstream = new LogOutputStream( this, Project.MSG_WARN );
outputstream = new LogOutputStream( getLogger(), false );
errorstream = new LogOutputStream( getLogger(), true );
}
else
{
@@ -164,7 +164,7 @@ public class Rpm extends Task
}
else
{
outputstream = new LogOutputStream( this, Project.MSG_INFO );
outputstream = new LogOutputStream( getLogger(), false );
}
if( error != null )
{
@@ -179,7 +179,7 @@ public class Rpm extends Task
}
else
{
errorstream = new LogOutputStream( this, Project.MSG_WARN );
errorstream = new LogOutputStream( getLogger(), true );
}
}



+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Patch.java View File

@@ -143,8 +143,8 @@ public class Patch extends Task
}

Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );
exe.setCommandline( toExecute.getCommandline() );
try
{


+ 4
- 4
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java View File

@@ -179,7 +179,7 @@ public abstract class DefaultCompilerAdapter
// as well as "bootclasspath" and "extdirs"
if( Project.getJavaVersion().startsWith( "1.1" ) )
{
Path cp = new Path( m_project );
Path cp = new Path();
/*
* XXX - This doesn't mix very well with build.systemclasspath,
*/
@@ -324,7 +324,7 @@ public abstract class DefaultCompilerAdapter
protected Path getCompileClasspath()
throws TaskException
{
Path classpath = new Path( m_project );
Path classpath = new Path();

// add dest dir to classpath so that previously compiled and
// untouched classes are on classpath
@@ -438,8 +438,8 @@ public abstract class DefaultCompilerAdapter
try
{
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( m_attributes, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( m_attributes, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( m_attributes.hackGetLogger(), false ) );
exe.setError( new LogOutputStream( m_attributes.hackGetLogger(), true ) );
exe.setWorkingDirectory( m_project.getBaseDir() );
exe.setCommandline( commandArray );
return exe.execute();


+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/exec/ExecTask.java View File

@@ -308,8 +308,8 @@ public class ExecTask extends Task
}
else
{
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );
}
}



+ 5
- 3
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/exec/Execute.java View File

@@ -18,6 +18,7 @@ import org.apache.myrmidon.framework.exec.ExecMetaData;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Commandline;
import org.apache.avalon.framework.logger.Logger;

/**
* Runs an external program.
@@ -65,10 +66,11 @@ public class Execute
{
try
{
task.hackGetLogger().debug( Commandline.toString( cmdline ) );
final Logger logger = task.hackGetLogger();
logger.debug( Commandline.toString( cmdline ) );
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( task, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( task, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( logger, false ) );
exe.setError( new LogOutputStream( logger, true ) );

exe.setCommandline( cmdline );
int retval = exe.execute();


+ 5
- 5
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/javadoc/Javadoc.java View File

@@ -512,7 +512,7 @@ public class Javadoc
{
if( m_bootclasspath == null )
{
m_bootclasspath = new Path( getProject() );
m_bootclasspath = new Path();
}
return m_bootclasspath.createPath();
}
@@ -522,7 +522,7 @@ public class Javadoc
{
if( m_classpath == null )
{
m_classpath = new Path( getProject() );
m_classpath = new Path();
}
return m_classpath.createPath();
}
@@ -552,7 +552,7 @@ public class Javadoc
{
if( m_sourcePath == null )
{
m_sourcePath = new Path( getProject() );
m_sourcePath = new Path();
}
return m_sourcePath.createPath();
}
@@ -838,8 +838,8 @@ public class Javadoc

getLogger().info( "Javadoc execution" );

JavadocOutputStream out = new JavadocOutputStream( this, Project.MSG_INFO );
JavadocOutputStream err = new JavadocOutputStream( this, Project.MSG_WARN );
final JavadocOutputStream out = new JavadocOutputStream( getLogger(), false );
final JavadocOutputStream err = new JavadocOutputStream( getLogger(), true );
Execute exe = new Execute();
exe.setOutput( out );
exe.setError( err );


+ 13
- 10
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/javadoc/JavadocOutputStream.java View File

@@ -10,30 +10,29 @@ package org.apache.tools.ant.taskdefs.javadoc;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
import org.apache.avalon.framework.logger.Logger;

class JavadocOutputStream
extends LogOutputStream
{

//
// Override the logging of output in order to filter out Generating
// messages. Generating messages are set to a priority of VERBOSE
// unless they appear after what could be an informational message.
//
private String m_queuedLine;

JavadocOutputStream( Task javadoc, int level )
JavadocOutputStream( final Logger logger, final boolean isError )
{
super( javadoc, level );
super( logger, isError );
}

protected void processLine( String line, int messageLevel )
protected void processLine( final String line )
{
if( messageLevel == Project.MSG_INFO && line.startsWith( "Generating " ) )
if( !isError() && line.startsWith( "Generating " ) )
{
if( m_queuedLine != null )
{
super.processLine( m_queuedLine, Project.MSG_VERBOSE );
getLogger().debug( m_queuedLine );
}
m_queuedLine = line;
}
@@ -42,12 +41,16 @@ class JavadocOutputStream
if( m_queuedLine != null )
{
if( line.startsWith( "Building " ) )
super.processLine( m_queuedLine, Project.MSG_VERBOSE );
{
getLogger().debug( m_queuedLine );
}
else
super.processLine( m_queuedLine, Project.MSG_INFO );
{
getLogger().info( m_queuedLine );
}
m_queuedLine = null;
}
super.processLine( line, messageLevel );
getLogger().warn( line );
}
}
}

+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ANTLR.java View File

@@ -225,8 +225,8 @@ public class ANTLR extends Task
throws TaskException
{
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );

if( workingdir != null )
{


+ 5
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ccm/Continuus.java View File

@@ -14,6 +14,7 @@ import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.exec.Execute;
import org.apache.tools.ant.taskdefs.exec.ExecuteStreamHandler;
import org.apache.tools.ant.taskdefs.exec.LogStreamHandler;
import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
import org.apache.tools.ant.types.Commandline;

/**
@@ -127,6 +128,9 @@ public abstract class Continuus
protected int run( final Commandline cmd )
throws TaskException
{
return run( cmd, new LogStreamHandler( this, Project.MSG_VERBOSE, Project.MSG_WARN ) );
final LogOutputStream output = new LogOutputStream( getLogger(), false );
final LogOutputStream error = new LogOutputStream( getLogger(), true );
final LogStreamHandler handler = new LogStreamHandler( output, error );
return run( cmd, handler );
}
}

+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java View File

@@ -109,8 +109,8 @@ public abstract class ClearCase extends Task
try
{
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );
exe.setWorkingDirectory( getBaseDirectory() );
exe.setCommandline( cmd.getCommandline() );
return exe.execute();


+ 2
- 3
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java View File

@@ -11,7 +11,6 @@ import java.io.File;
import java.io.IOException;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.exec.Execute;
import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
@@ -202,8 +201,8 @@ public class NetCommand
// default directory to the project's base directory
File dir = _owner.getBaseDirectory();
_exe = new Execute();
_exe.setOutput( new LogOutputStream( _owner, Project.MSG_INFO ) );
_exe.setError( new LogOutputStream( _owner, Project.MSG_WARN ) );
_exe.setOutput( new LogOutputStream( _owner.hackGetLogger(), false ) );
_exe.setError( new LogOutputStream( _owner.hackGetLogger(), true ) );
_exe.setWorkingDirectory( dir );
}
}

+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java View File

@@ -185,8 +185,8 @@ public class JJTree extends Task
arg.setValue( "-Dinstall.root=" + javaccHome.getAbsolutePath() );

final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), false ) );

getLogger().debug( cmdl.toString() );
exe.setCommandline( cmdl.getCommandline() );


+ 4
- 4
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java View File

@@ -205,7 +205,7 @@ public class JDependTask extends Task
{
if( _compileClasspath == null )
{
_compileClasspath = new Path( getProject() );
_compileClasspath = new Path();
}
return _compileClasspath.createPath();
}
@@ -232,7 +232,7 @@ public class JDependTask extends Task
{
if( _sourcesPath == null )
{
_sourcesPath = new Path( getProject() );
_sourcesPath = new Path();
}
return _sourcesPath.createPath();
}
@@ -328,8 +328,8 @@ public class JDependTask extends Task
}

final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );

exe.setCommandline( commandline.getCommandline() );
if( getDir() != null )


+ 3
- 3
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java View File

@@ -405,7 +405,7 @@ public class JUnitTask extends Task
*/
protected OutputStream getDefaultOutput()
{
return new LogOutputStream( this, Project.MSG_INFO );
return new LogOutputStream( getLogger(), false );
}

/**
@@ -650,8 +650,8 @@ public class JUnitTask extends Task
}

final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );

exe.setCommandline( cmd.getCommandline() );
if( dir != null )


+ 3
- 3
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/metamata/MAudit.java View File

@@ -135,7 +135,7 @@ public class MAudit extends AbstractMetamataTask
{
if( searchPath == null )
{
searchPath = new Path( getProject() );
searchPath = new Path();
}
return searchPath;
}
@@ -226,8 +226,8 @@ public class MAudit extends AbstractMetamataTask
// if we didn't specify a file, then use a screen report
if( outFile == null )
{
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );
}
else
{


+ 3
- 3
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/metamata/MMetrics.java View File

@@ -114,7 +114,7 @@ public class MMetrics extends AbstractMetamataTask
{
if( path == null )
{
path = new Path( getProject() );
path = new Path();
}
return path;
}
@@ -226,8 +226,8 @@ public class MMetrics extends AbstractMetamataTask
*/
protected void setupStreamHandler( final Execute exe )
{
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), false ) );
}

protected void execute0( ExecuteStreamHandler handler )


+ 6
- 3
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java View File

@@ -18,6 +18,7 @@ import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.exec.Execute;
import org.apache.tools.ant.taskdefs.exec.ExecuteStreamHandler;
import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
import org.apache.tools.ant.taskdefs.exec.LogStreamHandler;
import org.apache.tools.ant.types.Argument;
import org.apache.tools.ant.types.CommandlineJava;
@@ -150,7 +151,7 @@ public class MParse extends Task
{
if( classpath == null )
{
classpath = new Path( getProject() );
classpath = new Path();
}
return classpath;
}
@@ -174,7 +175,7 @@ public class MParse extends Task
{
if( sourcepath == null )
{
sourcepath = new Path( getProject() );
sourcepath = new Path();
}
return sourcepath;
}
@@ -385,7 +386,9 @@ public class MParse extends Task
*/
protected ExecuteStreamHandler createStreamHandler()
{
return new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_INFO );
final LogOutputStream output = new LogOutputStream( getLogger(), false );
final LogOutputStream error = new LogOutputStream( getLogger(), false );
return new LogStreamHandler( output, error );
}

/**


+ 4
- 3
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java View File

@@ -365,7 +365,8 @@ public class Pvcs extends org.apache.tools.ant.Task
tmp = new File( "pvcs_ant_" + rand.nextLong() + ".log" );
tmp2 = new File( "pvcs_ant_" + rand.nextLong() + ".log" );
getLogger().debug( "Executing " + commandLine.toString() );
result = runCmd( commandLine, new FileOutputStream( tmp ), new LogOutputStream( this, Project.MSG_WARN ) );
result = runCmd( commandLine, new FileOutputStream( tmp ),
new LogOutputStream( getLogger(), true ) );
if( result != 0 && !ignorerc )
{
String msg = "Failed executing: " + commandLine.toString();
@@ -407,8 +408,8 @@ public class Pvcs extends org.apache.tools.ant.Task
commandLine.createArgument().setValue( "@" + tmp2.getAbsolutePath() );
getLogger().info( "Getting files" );
getLogger().debug( "Executing " + commandLine.toString() );
final LogOutputStream output = new LogOutputStream( this, Project.MSG_INFO );
final LogOutputStream error = new LogOutputStream( this, Project.MSG_WARN );
final LogOutputStream output = new LogOutputStream( getLogger(), false );
final LogOutputStream error = new LogOutputStream( getLogger(), true );
result = runCmd( commandLine, output, error );

if( result != 0 && !ignorerc )


+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java View File

@@ -116,8 +116,8 @@ public class CovMerge extends Task
cmdl.createArgument().setValue( "-jp_paramfile=" + paramfile.getAbsolutePath() );

final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );
getLogger().debug( cmdl.toString() );
exe.setCommandline( cmdl.getCommandline() );



+ 7
- 9
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java View File

@@ -203,7 +203,7 @@ public class CovReport extends Task
{
if( coveragePath == null )
{
coveragePath = new Path( getProject() );
coveragePath = new Path();
}
return coveragePath.createPath();
}
@@ -221,7 +221,7 @@ public class CovReport extends Task
{
if( sourcePath == null )
{
sourcePath = new Path( getProject() );
sourcePath = new Path();
}
return sourcePath.createPath();
}
@@ -243,8 +243,8 @@ public class CovReport extends Task

// use the custom handler for stdin issues
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );
getLogger().debug( cmdl.toString() );
exe.setCommandline( cmdl.getCommandline() );
int exitValue = exe.execute();
@@ -291,7 +291,7 @@ public class CovReport extends Task
// as a default -sourcepath use . in JProbe, so use project .
if( sourcePath == null )
{
sourcePath = new Path( getProject() );
sourcePath = new Path();
sourcePath.createPath().setLocation( getBaseDirectory() );
}
v.add( "-sourcepath=" + sourcePath );
@@ -301,9 +301,7 @@ public class CovReport extends Task
v.add( "-inc_src_text=" + ( includeSource ? "on" : "off" ) );
}

String[] params = new String[ v.size() ];
v.copyInto( params );
return params;
return (String[])v.toArray( new String[ v.size() ] );
}

/**
@@ -365,7 +363,7 @@ public class CovReport extends Task
{
if( classPath == null )
{
classPath = new Path( CovReport.this.getProject() );
classPath = new Path();
}
return classPath.createPath();
}


+ 9
- 7
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java View File

@@ -20,6 +20,7 @@ import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.exec.Execute;
import org.apache.tools.ant.taskdefs.exec.LogStreamHandler;
import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
import org.apache.tools.ant.types.Argument;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.CommandlineJava;
@@ -294,7 +295,9 @@ public class Coverage extends Task
cmdl.createArgument().setValue( "-jp_input=" + paramfile.getAbsolutePath() );

// use the custom handler for stdin issues
LogStreamHandler handler = new CoverageStreamHandler( this );
final LogOutputStream output = new LogOutputStream( getLogger(), false );
final LogOutputStream error = new LogOutputStream( getLogger(), true );
final LogStreamHandler handler = new CoverageStreamHandler( output, error );
Execute exec = new Execute( handler );
getLogger().debug( cmdl.toString() );
exec.setCommandline( cmdl.getCommandline() );
@@ -383,9 +386,7 @@ public class Coverage extends Task
params.add( args[ i ] );
}

String[] array = new String[ params.size() ];
params.copyInto( array );
return array;
return (String[])params.toArray( new String[ params.size() ] );
}

/**
@@ -540,11 +541,12 @@ public class Coverage extends Task
/**
* specific pumper to avoid those nasty stdin issues
*/
static class CoverageStreamHandler extends LogStreamHandler
static class CoverageStreamHandler
extends LogStreamHandler
{
CoverageStreamHandler( Task task )
CoverageStreamHandler( OutputStream output, OutputStream error )
{
super( task, Project.MSG_INFO, Project.MSG_WARN );
super( output, error );
}

/**


+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java View File

@@ -206,8 +206,8 @@ public abstract class MSVSS extends Task
try
{
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( this, Project.MSG_INFO ) );
exe.setError( new LogOutputStream( this, Project.MSG_WARN ) );
exe.setOutput( new LogOutputStream( getLogger(), false ) );
exe.setError( new LogOutputStream( getLogger(), true ) );

// If location of ss.ini is specified we need to set the
// environment-variable SSDIR to this value


+ 2
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/rmic/SunRmic.java View File

@@ -32,7 +32,8 @@ public class SunRmic extends DefaultRmicAdapter

// Create an instance of the rmic, redirecting output to
// the project log
LogOutputStream logstr = new LogOutputStream( getRmic(), Project.MSG_WARN );
LogOutputStream logstr =
new LogOutputStream( getRmic().hackGetLogger(), true );

try
{


+ 4
- 4
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/unix/Rpm.java View File

@@ -146,8 +146,8 @@ public class Rpm extends Task

if( error == null && output == null )
{
outputstream = new LogOutputStream( this, Project.MSG_INFO );
errorstream = new LogOutputStream( this, Project.MSG_WARN );
outputstream = new LogOutputStream( getLogger(), false );
errorstream = new LogOutputStream( getLogger(), true );
}
else
{
@@ -164,7 +164,7 @@ public class Rpm extends Task
}
else
{
outputstream = new LogOutputStream( this, Project.MSG_INFO );
outputstream = new LogOutputStream( getLogger(), false );
}
if( error != null )
{
@@ -179,7 +179,7 @@ public class Rpm extends Task
}
else
{
errorstream = new LogOutputStream( this, Project.MSG_WARN );
errorstream = new LogOutputStream( getLogger(), true );
}
}



Loading…
Cancel
Save