Browse Source

Use Execute2 abstraction

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270561 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
df0a7e7358
2 changed files with 12 additions and 18 deletions
  1. +6
    -9
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  2. +6
    -9
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java

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

@@ -14,10 +14,8 @@ import java.io.PrintWriter;
import org.apache.avalon.excalibur.util.StringUtil;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Javac;
import org.apache.tools.ant.taskdefs.exec.Execute;
import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
import org.apache.tools.ant.taskdefs.exec.Execute2;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.Path;

@@ -53,7 +51,7 @@ public abstract class DefaultCompilerAdapter
protected boolean m_includeJavaRuntime;
protected String m_memoryInitialSize;
protected String m_memoryMaximumSize;
protected Project m_project;
protected File m_baseDir;

/*
* jdg - TODO - all these attributes are currently protected, but they
@@ -78,7 +76,7 @@ public abstract class DefaultCompilerAdapter
m_extdirs = attributes.getExtdirs();
m_compileList = attributes.getFileList();
m_compileClasspath = attributes.getClasspath();
m_project = attributes.getProject();
m_baseDir = attributes.getBaseDirectory();
m_includeAntRuntime = attributes.getIncludeantruntime();
m_includeJavaRuntime = attributes.getIncludejavaruntime();
m_memoryInitialSize = attributes.getMemoryInitialSize();
@@ -391,10 +389,9 @@ public abstract class DefaultCompilerAdapter

try
{
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( m_attributes.hackGetLogger(), false ) );
exe.setError( new LogOutputStream( m_attributes.hackGetLogger(), true ) );
exe.setWorkingDirectory( m_project.getBaseDir() );
final Execute2 exe = new Execute2();
setupLogger( exe );
exe.setWorkingDirectory( m_baseDir );
exe.setCommandline( commandArray );
return exe.execute();
}


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

@@ -14,10 +14,8 @@ import java.io.PrintWriter;
import org.apache.avalon.excalibur.util.StringUtil;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Javac;
import org.apache.tools.ant.taskdefs.exec.Execute;
import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
import org.apache.tools.ant.taskdefs.exec.Execute2;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.Path;

@@ -53,7 +51,7 @@ public abstract class DefaultCompilerAdapter
protected boolean m_includeJavaRuntime;
protected String m_memoryInitialSize;
protected String m_memoryMaximumSize;
protected Project m_project;
protected File m_baseDir;

/*
* jdg - TODO - all these attributes are currently protected, but they
@@ -78,7 +76,7 @@ public abstract class DefaultCompilerAdapter
m_extdirs = attributes.getExtdirs();
m_compileList = attributes.getFileList();
m_compileClasspath = attributes.getClasspath();
m_project = attributes.getProject();
m_baseDir = attributes.getBaseDirectory();
m_includeAntRuntime = attributes.getIncludeantruntime();
m_includeJavaRuntime = attributes.getIncludejavaruntime();
m_memoryInitialSize = attributes.getMemoryInitialSize();
@@ -391,10 +389,9 @@ public abstract class DefaultCompilerAdapter

try
{
final Execute exe = new Execute();
exe.setOutput( new LogOutputStream( m_attributes.hackGetLogger(), false ) );
exe.setError( new LogOutputStream( m_attributes.hackGetLogger(), true ) );
exe.setWorkingDirectory( m_project.getBaseDir() );
final Execute2 exe = new Execute2();
setupLogger( exe );
exe.setWorkingDirectory( m_baseDir );
exe.setCommandline( commandArray );
return exe.execute();
}


Loading…
Cancel
Save