git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271119 13f79535-47bb-0310-9956-ffa450edef68master
@@ -15,6 +15,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Task to interact with a CVS repository. | * Task to interact with a CVS repository. | ||||
@@ -147,7 +148,8 @@ public class Cvs | |||||
final Commandline command = buildCommandline(); | final Commandline command = buildCommandline(); | ||||
final Properties env = buildEnvironment(); | final Properties env = buildEnvironment(); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
if( m_dest == null ) { | if( m_dest == null ) { | ||||
m_dest = getBaseDirectory(); | m_dest = getBaseDirectory(); | ||||
@@ -11,6 +11,7 @@ import java.io.File; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.util.Properties; | import java.util.Properties; | ||||
import org.apache.aut.nativelib.Os; | import org.apache.aut.nativelib.Os; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.apache.avalon.excalibur.i18n.ResourceManager; | import org.apache.avalon.excalibur.i18n.ResourceManager; | ||||
import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
import org.apache.myrmidon.api.AbstractTask; | import org.apache.myrmidon.api.AbstractTask; | ||||
@@ -171,7 +172,8 @@ public class Exec | |||||
logExecDetails( environment ); | logExecDetails( environment ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setTimeout( m_timeout ); | exe.setTimeout( m_timeout ); | ||||
exe.setWorkingDirectory( m_dir ); | exe.setWorkingDirectory( m_dir ); | ||||
@@ -12,6 +12,7 @@ import org.apache.myrmidon.api.AbstractTask; | |||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Generates a key. | * Generates a key. | ||||
@@ -120,7 +121,8 @@ public class GenerateKey | |||||
getLogger().info( message ); | getLogger().info( message ); | ||||
final Commandline cmd = createCommand(); | final Commandline cmd = createCommand(); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
exe.setWorkingDirectory( getBaseDirectory() ); | exe.setWorkingDirectory( getBaseDirectory() ); | ||||
exe.setCommandline( cmd ); | exe.setCommandline( cmd ); | ||||
try | try | ||||
@@ -20,6 +20,7 @@ import org.apache.tools.ant.types.Commandline; | |||||
import org.apache.tools.ant.types.DirectoryScanner; | import org.apache.tools.ant.types.DirectoryScanner; | ||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
import org.apache.tools.ant.types.ScannerUtil; | import org.apache.tools.ant.types.ScannerUtil; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Sign a archive. | * Sign a archive. | ||||
@@ -294,7 +295,8 @@ public class SignJar | |||||
getLogger().info( message ); | getLogger().info( message ); | ||||
final Commandline cmd = buildCommand( jarTarget, jarSource ); | final Commandline cmd = buildCommand( jarTarget, jarSource ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setCommandline( cmd ); | exe.setCommandline( cmd ); | ||||
try | try | ||||
@@ -19,6 +19,7 @@ import org.apache.tools.ant.types.Commandline; | |||||
import org.apache.tools.ant.types.CommandlineJava; | import org.apache.tools.ant.types.CommandlineJava; | ||||
import org.apache.tools.ant.types.EnvironmentVariable; | import org.apache.tools.ant.types.EnvironmentVariable; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* This task acts as a loader for java applications but allows to use the same | * This task acts as a loader for java applications but allows to use the same | ||||
@@ -217,7 +218,8 @@ public class Java | |||||
private int run( final Commandline command ) | private int run( final Commandline command ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
if( m_dir == null ) | if( m_dir == null ) | ||||
@@ -13,6 +13,7 @@ import org.apache.myrmidon.api.AbstractTask; | |||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Task as a layer on top of patch. Patch applies a diff file to an original. | * Task as a layer on top of patch. Patch applies a diff file to an original. | ||||
@@ -109,7 +110,8 @@ public class Patch | |||||
{ | { | ||||
validate(); | validate(); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
final Commandline cmd = buildCommand(); | final Commandline cmd = buildCommand(); | ||||
@@ -21,6 +21,7 @@ import org.apache.tools.ant.types.Commandline; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.PathUtil; | import org.apache.tools.ant.types.PathUtil; | ||||
import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* This is the default implementation for the CompilerAdapter interface. | * This is the default implementation for the CompilerAdapter interface. | ||||
@@ -360,7 +361,8 @@ public abstract class DefaultCompilerAdapter | |||||
try | try | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)m_attributes.getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setWorkingDirectory( m_baseDir ); | exe.setWorkingDirectory( m_baseDir ); | ||||
final String[] commandline = commandArray; | final String[] commandline = commandArray; | ||||
@@ -35,6 +35,11 @@ public class Execute2 | |||||
private boolean m_newEnvironment; | private boolean m_newEnvironment; | ||||
private ExecOutputHandler m_handler; | private ExecOutputHandler m_handler; | ||||
private long m_timeout; | private long m_timeout; | ||||
private ExecManager m_execManager; | |||||
public Execute2( ExecManager execManager ) | |||||
{ | |||||
} | |||||
public void setTimeout( final long timeout ) | public void setTimeout( final long timeout ) | ||||
{ | { | ||||
@@ -19,6 +19,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.myrmidon.framework.Pattern; | import org.apache.myrmidon.framework.Pattern; | ||||
import org.apache.aut.nativelib.Os; | import org.apache.aut.nativelib.Os; | ||||
import org.apache.aut.nativelib.ExecOutputHandler; | import org.apache.aut.nativelib.ExecOutputHandler; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.apache.tools.ant.types.DirectoryScanner; | import org.apache.tools.ant.types.DirectoryScanner; | ||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
@@ -811,7 +812,8 @@ public class Javadoc | |||||
getLogger().info( "Javadoc execution" ); | getLogger().info( "Javadoc execution" ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setExecOutputHandler( this ); | exe.setExecOutputHandler( this ); | ||||
@@ -20,6 +20,7 @@ import org.apache.tools.ant.types.Argument; | |||||
import org.apache.tools.ant.types.CommandlineJava; | import org.apache.tools.ant.types.CommandlineJava; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* ANTLR task. | * ANTLR task. | ||||
@@ -226,7 +227,8 @@ public class ANTLR extends Task | |||||
private int run( final Commandline command ) | private int run( final Commandline command ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
if( workingdir != null ) | if( workingdir != null ) | ||||
@@ -15,6 +15,7 @@ import java.io.PrintWriter; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import org.apache.aut.nativelib.Os; | import org.apache.aut.nativelib.Os; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.types.DirectoryScanner; | import org.apache.tools.ant.types.DirectoryScanner; | ||||
import org.apache.tools.ant.taskdefs.MatchingTask; | import org.apache.tools.ant.taskdefs.MatchingTask; | ||||
@@ -134,7 +135,8 @@ public class Cab | |||||
try | try | ||||
{ | { | ||||
File listFile = createListFile( files ); | File listFile = createListFile( files ); | ||||
Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setWorkingDirectory( m_baseDir ); | exe.setWorkingDirectory( m_baseDir ); | ||||
final Commandline cmd = createCommand( listFile ); | final Commandline cmd = createCommand( listFile ); | ||||
@@ -20,7 +20,6 @@ import org.apache.tools.ant.taskdefs.Java; | |||||
import org.apache.tools.ant.taskdefs.Javac; | import org.apache.tools.ant.taskdefs.Javac; | ||||
import org.apache.tools.ant.taskdefs.MatchingTask; | import org.apache.tools.ant.taskdefs.MatchingTask; | ||||
import org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter; | import org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter; | ||||
import org.apache.antlib.file.Mkdir; | |||||
import org.apache.tools.ant.types.DirectoryScanner; | import org.apache.tools.ant.types.DirectoryScanner; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
@@ -708,13 +707,9 @@ public class IContract extends MatchingTask | |||||
// Prepare the directories for iContract. iContract will make them if they | // Prepare the directories for iContract. iContract will make them if they | ||||
// don't exist, but for some reason I don't know, it will complain about the REP files | // don't exist, but for some reason I don't know, it will complain about the REP files | ||||
// afterwards | // afterwards | ||||
Mkdir mkdir = (Mkdir)getProject().createTask( "mkdir" ); | |||||
mkdir.setDir( instrumentDir ); | |||||
mkdir.execute(); | |||||
mkdir.setDir( buildDir ); | |||||
mkdir.execute(); | |||||
mkdir.setDir( repositoryDir ); | |||||
mkdir.execute(); | |||||
instrumentDir.mkdirs(); | |||||
buildDir.mkdirs(); | |||||
repositoryDir.mkdirs(); | |||||
// Set the classpath that is needed for regular Javac compilation | // Set the classpath that is needed for regular Javac compilation | ||||
Path baseClasspath = createClasspath(); | Path baseClasspath = createClasspath(); | ||||
@@ -12,6 +12,7 @@ import java.io.IOException; | |||||
import org.apache.myrmidon.api.AbstractTask; | import org.apache.myrmidon.api.AbstractTask; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.aut.nativelib.ExecOutputHandler; | import org.apache.aut.nativelib.ExecOutputHandler; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
@@ -111,7 +112,8 @@ public abstract class Continuus | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
if( null != handler ) | if( null != handler ) | ||||
{ | { | ||||
@@ -13,6 +13,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* A base class for creating tasks for executing commands on ClearCase. <p> | * A base class for creating tasks for executing commands on ClearCase. <p> | ||||
@@ -107,7 +108,8 @@ public abstract class ClearCase extends Task | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setWorkingDirectory( getBaseDirectory() ); | exe.setWorkingDirectory( getBaseDirectory() ); | ||||
exe.setCommandline( cmd ); | exe.setCommandline( cmd ); | ||||
@@ -14,6 +14,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* This is a helper class to spawn net commands out. In its initial form it | * This is a helper class to spawn net commands out. In its initial form it | ||||
@@ -199,7 +200,8 @@ public class NetCommand | |||||
{ | { | ||||
// default directory to the project's base directory | // default directory to the project's base directory | ||||
File dir = _owner.getBaseDirectory(); | File dir = _owner.getBaseDirectory(); | ||||
_exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)_owner.getService( ExecManager.class ); | |||||
_exe = new Execute2( execManager ); | |||||
setupLogger( _exe ); | setupLogger( _exe ); | ||||
_exe.setWorkingDirectory( dir ); | _exe.setWorkingDirectory( dir ); | ||||
} | } | ||||
@@ -24,6 +24,7 @@ import org.apache.tools.ant.types.Argument; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* BorlandDeploymentTool is dedicated to the Borland Application Server 4.5 and | * BorlandDeploymentTool is dedicated to the Borland Application Server 4.5 and | ||||
@@ -361,7 +362,8 @@ public class BorlandDeploymentTool | |||||
*/ | */ | ||||
private void buildBorlandStubs( Iterator ithomes, Hashtable files ) | private void buildBorlandStubs( Iterator ithomes, Hashtable files ) | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
exe.setWorkingDirectory( getTask().getBaseDirectory() ); | exe.setWorkingDirectory( getTask().getBaseDirectory() ); | ||||
final Commandline cmd = buildCommandline( ithomes ); | final Commandline cmd = buildCommandline( ithomes ); | ||||
@@ -14,6 +14,7 @@ import org.apache.tools.ant.taskdefs.exec.Execute2; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Argument; | import org.apache.tools.ant.types.Argument; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* BorlandGenerateClient is dedicated to the Borland Application Server 4.5 This | * BorlandGenerateClient is dedicated to the Borland Application Server 4.5 This | ||||
@@ -160,7 +161,8 @@ public class BorlandGenerateClient extends Task | |||||
getLogger().info( "mode : fork" ); | getLogger().info( "mode : fork" ); | ||||
getLogger().debug( "Calling java2iiop" ); | getLogger().debug( "Calling java2iiop" ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setWorkingDirectory( new File( "." ) ); | exe.setWorkingDirectory( new File( "." ) ); | ||||
exe.setCommandline( cmd ); | exe.setCommandline( cmd ); | ||||
@@ -19,6 +19,7 @@ import org.apache.tools.ant.types.CommandlineJava; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.PathUtil; | import org.apache.tools.ant.types.PathUtil; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Taskdef for the JJTree compiler compiler. | * Taskdef for the JJTree compiler compiler. | ||||
@@ -181,7 +182,8 @@ public class JJTree extends Task | |||||
cmdl.addVmArgument( "-mx140M" ); | cmdl.addVmArgument( "-mx140M" ); | ||||
cmdl.addVmArgument( "-Dinstall.root=" + javaccHome.getAbsolutePath() ); | cmdl.addVmArgument( "-Dinstall.root=" + javaccHome.getAbsolutePath() ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
getLogger().debug( cmdl.toString() ); | getLogger().debug( cmdl.toString() ); | ||||
@@ -21,6 +21,7 @@ import org.apache.tools.ant.types.Path; | |||||
import org.apache.tools.ant.types.PathUtil; | import org.apache.tools.ant.types.PathUtil; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.avalon.excalibur.util.StringUtil; | import org.apache.avalon.excalibur.util.StringUtil; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Taskdef for the JavaCC compiler compiler. | * Taskdef for the JavaCC compiler compiler. | ||||
@@ -244,7 +245,8 @@ public class JavaCC extends Task | |||||
try | try | ||||
{ | { | ||||
getLogger().debug( cmdline.toString() ); | getLogger().debug( cmdline.toString() ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
final String[] commandline = cmdline.getCommandline(); | final String[] commandline = cmdline.getCommandline(); | ||||
exe.setCommandline( new Commandline( commandline ) ); | exe.setCommandline( new Commandline( commandline ) ); | ||||
@@ -19,6 +19,7 @@ import org.apache.tools.ant.types.CommandlineJava; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Ant task to run JDepend tests. <p> | * Ant task to run JDepend tests. <p> | ||||
@@ -239,7 +240,8 @@ public class JDependTask | |||||
commandline.addArgument( f.getPath() ); | commandline.addArgument( f.getPath() ); | ||||
} | } | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
final String[] commandline1 = commandline.getCommandline(); | final String[] commandline1 = commandline.getCommandline(); | ||||
@@ -32,6 +32,7 @@ import org.apache.tools.ant.types.Path; | |||||
import org.apache.tools.ant.types.SysProperties; | import org.apache.tools.ant.types.SysProperties; | ||||
import org.apache.tools.ant.types.PathUtil; | import org.apache.tools.ant.types.PathUtil; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Ant task to run JUnit tests. <p> | * Ant task to run JUnit tests. <p> | ||||
@@ -649,7 +650,8 @@ public class JUnitTask extends Task | |||||
throw new TaskException( "Error creating temporary properties file.", ioe ); | throw new TaskException( "Error creating temporary properties file.", ioe ); | ||||
} | } | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setCommandline( new Commandline( cmd.getCommandline() ) ); | exe.setCommandline( new Commandline( cmd.getCommandline() ) ); | ||||
if( dir != null ) | if( dir != null ) | ||||
@@ -25,6 +25,7 @@ import org.apache.tools.ant.types.FileSet; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.ScannerUtil; | import org.apache.tools.ant.types.ScannerUtil; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Somewhat abstract framework to be used for other metama 2.0 tasks. This | * Somewhat abstract framework to be used for other metama 2.0 tasks. This | ||||
@@ -278,7 +279,8 @@ public abstract class AbstractMetamataTask | |||||
protected void execute0() | protected void execute0() | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
getLogger().debug( m_cmdl.toString() ); | getLogger().debug( m_cmdl.toString() ); | ||||
final String[] commandline = m_cmdl.getCommandline(); | final String[] commandline = m_cmdl.getCommandline(); | ||||
@@ -21,6 +21,7 @@ import org.apache.tools.ant.types.CommandlineJava; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.avalon.excalibur.io.IOUtil; | import org.apache.avalon.excalibur.io.IOUtil; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Simple Metamata MParse task based on the original written by <a | * Simple Metamata MParse task based on the original written by <a | ||||
@@ -286,7 +287,8 @@ public class MParse | |||||
return; | return; | ||||
} | } | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
getLogger().debug( m_cmdl.toString() ); | getLogger().debug( m_cmdl.toString() ); | ||||
final String[] commandline = m_cmdl.getCommandline(); | final String[] commandline = m_cmdl.getCommandline(); | ||||
@@ -10,6 +10,7 @@ package org.apache.tools.ant.taskdefs.optional.perforce; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.aut.nativelib.ExecOutputHandler; | import org.apache.aut.nativelib.ExecOutputHandler; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.apache.oro.text.perl.Perl5Util; | import org.apache.oro.text.perl.Perl5Util; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
@@ -165,7 +166,8 @@ public abstract class P4Base | |||||
handler = this; | handler = this; | ||||
} | } | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
exe.setExecOutputHandler( handler ); | exe.setExecOutputHandler( handler ); | ||||
exe.setCommandline( cmd ); | exe.setCommandline( cmd ); | ||||
@@ -20,6 +20,7 @@ import java.text.ParseException; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import org.apache.aut.nativelib.ExecOutputHandler; | import org.apache.aut.nativelib.ExecOutputHandler; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.apache.avalon.excalibur.io.IOUtil; | import org.apache.avalon.excalibur.io.IOUtil; | ||||
import org.apache.myrmidon.api.AbstractTask; | import org.apache.myrmidon.api.AbstractTask; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
@@ -190,7 +191,8 @@ public class Pvcs | |||||
getLogger().debug( "Executing " + cmd.toString() ); | getLogger().debug( "Executing " + cmd.toString() ); | ||||
try | try | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setWorkingDirectory( getBaseDirectory() ); | exe.setWorkingDirectory( getBaseDirectory() ); | ||||
exe.setCommandline( cmd ); | exe.setCommandline( cmd ); | ||||
@@ -271,7 +273,8 @@ public class Pvcs | |||||
tmp = File.createTempFile( "pvcs_ant_", ".log" ); | tmp = File.createTempFile( "pvcs_ant_", ".log" ); | ||||
final File fileList = File.createTempFile( "pvcs_ant_", ".log" ); | final File fileList = File.createTempFile( "pvcs_ant_", ".log" ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setExecOutputHandler( this ); | exe.setExecOutputHandler( this ); | ||||
m_output = new FileOutputStream( tmp ); | m_output = new FileOutputStream( tmp ); | ||||
@@ -20,6 +20,7 @@ import org.apache.tools.ant.taskdefs.exec.Execute2; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
import org.apache.tools.ant.types.ScannerUtil; | import org.apache.tools.ant.types.ScannerUtil; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Convenient task to run the snapshot merge utility for JProbe Coverage. | * Convenient task to run the snapshot merge utility for JProbe Coverage. | ||||
@@ -114,7 +115,8 @@ public class CovMerge extends Task | |||||
} | } | ||||
cmdl.addArgument( "-jp_paramfile=" + paramfile.getAbsolutePath() ); | cmdl.addArgument( "-jp_paramfile=" + paramfile.getAbsolutePath() ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
getLogger().debug( cmdl.toString() ); | getLogger().debug( cmdl.toString() ); | ||||
exe.setCommandline( cmdl ); | exe.setCommandline( cmdl ); | ||||
@@ -23,6 +23,7 @@ import org.apache.tools.ant.taskdefs.exec.Execute2; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.w3c.dom.Document; | import org.w3c.dom.Document; | ||||
/** | /** | ||||
@@ -246,7 +247,8 @@ public class CovReport extends Task | |||||
} | } | ||||
// use the custom handler for stdin issues | // use the custom handler for stdin issues | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
getLogger().debug( cmdl.toString() ); | getLogger().debug( cmdl.toString() ); | ||||
exe.setCommandline( cmdl ); | exe.setCommandline( cmdl ); | ||||
@@ -21,6 +21,7 @@ import org.apache.tools.ant.types.Commandline; | |||||
import org.apache.tools.ant.types.CommandlineJava; | import org.apache.tools.ant.types.CommandlineJava; | ||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Convenient task to run Sitraka JProbe Coverage from Ant. Options are pretty | * Convenient task to run Sitraka JProbe Coverage from Ant. Options are pretty | ||||
@@ -250,7 +251,8 @@ public class Coverage | |||||
cmdl.addArgument( "-jp_input=" + paramfile.getAbsolutePath() ); | cmdl.addArgument( "-jp_input=" + paramfile.getAbsolutePath() ); | ||||
// use the custom handler for stdin issues | // use the custom handler for stdin issues | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
getLogger().debug( cmdl.toString() ); | getLogger().debug( cmdl.toString() ); | ||||
exe.setCommandline( cmdl ); | exe.setCommandline( cmdl ); | ||||
@@ -14,6 +14,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* A base class for creating tasks for executing commands on Visual SourceSafe. | * A base class for creating tasks for executing commands on Visual SourceSafe. | ||||
@@ -204,7 +205,8 @@ public abstract class MSVSS extends Task | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
// If location of ss.ini is specified we need to set the | // If location of ss.ini is specified we need to set the | ||||
@@ -13,6 +13,7 @@ import org.apache.myrmidon.api.AbstractTask; | |||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
@@ -90,7 +91,8 @@ public class Rpm | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
final Commandline cmd = createCommand(); | final Commandline cmd = createCommand(); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
if( m_topDir == null ) { | if( m_topDir == null ) { | ||||
@@ -19,6 +19,7 @@ import org.apache.tools.ant.types.Commandline; | |||||
import org.apache.tools.ant.types.CommandlineJava; | import org.apache.tools.ant.types.CommandlineJava; | ||||
import org.apache.tools.ant.types.EnvironmentVariable; | import org.apache.tools.ant.types.EnvironmentVariable; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* This task acts as a loader for java applications but allows to use the same | * This task acts as a loader for java applications but allows to use the same | ||||
@@ -217,7 +218,8 @@ public class Java | |||||
private int run( final Commandline command ) | private int run( final Commandline command ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
if( m_dir == null ) | if( m_dir == null ) | ||||
@@ -13,6 +13,7 @@ import org.apache.myrmidon.api.AbstractTask; | |||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Task as a layer on top of patch. Patch applies a diff file to an original. | * Task as a layer on top of patch. Patch applies a diff file to an original. | ||||
@@ -109,7 +110,8 @@ public class Patch | |||||
{ | { | ||||
validate(); | validate(); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
final Commandline cmd = buildCommand(); | final Commandline cmd = buildCommand(); | ||||
@@ -21,6 +21,7 @@ import org.apache.tools.ant.types.Commandline; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.PathUtil; | import org.apache.tools.ant.types.PathUtil; | ||||
import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* This is the default implementation for the CompilerAdapter interface. | * This is the default implementation for the CompilerAdapter interface. | ||||
@@ -360,7 +361,8 @@ public abstract class DefaultCompilerAdapter | |||||
try | try | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)m_attributes.getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setWorkingDirectory( m_baseDir ); | exe.setWorkingDirectory( m_baseDir ); | ||||
final String[] commandline = commandArray; | final String[] commandline = commandArray; | ||||
@@ -35,6 +35,11 @@ public class Execute2 | |||||
private boolean m_newEnvironment; | private boolean m_newEnvironment; | ||||
private ExecOutputHandler m_handler; | private ExecOutputHandler m_handler; | ||||
private long m_timeout; | private long m_timeout; | ||||
private ExecManager m_execManager; | |||||
public Execute2( ExecManager execManager ) | |||||
{ | |||||
} | |||||
public void setTimeout( final long timeout ) | public void setTimeout( final long timeout ) | ||||
{ | { | ||||
@@ -19,6 +19,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.myrmidon.framework.Pattern; | import org.apache.myrmidon.framework.Pattern; | ||||
import org.apache.aut.nativelib.Os; | import org.apache.aut.nativelib.Os; | ||||
import org.apache.aut.nativelib.ExecOutputHandler; | import org.apache.aut.nativelib.ExecOutputHandler; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.apache.tools.ant.types.DirectoryScanner; | import org.apache.tools.ant.types.DirectoryScanner; | ||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
@@ -811,7 +812,8 @@ public class Javadoc | |||||
getLogger().info( "Javadoc execution" ); | getLogger().info( "Javadoc execution" ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setExecOutputHandler( this ); | exe.setExecOutputHandler( this ); | ||||
@@ -20,6 +20,7 @@ import org.apache.tools.ant.types.Argument; | |||||
import org.apache.tools.ant.types.CommandlineJava; | import org.apache.tools.ant.types.CommandlineJava; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* ANTLR task. | * ANTLR task. | ||||
@@ -226,7 +227,8 @@ public class ANTLR extends Task | |||||
private int run( final Commandline command ) | private int run( final Commandline command ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
if( workingdir != null ) | if( workingdir != null ) | ||||
@@ -15,6 +15,7 @@ import java.io.PrintWriter; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import org.apache.aut.nativelib.Os; | import org.apache.aut.nativelib.Os; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.types.DirectoryScanner; | import org.apache.tools.ant.types.DirectoryScanner; | ||||
import org.apache.tools.ant.taskdefs.MatchingTask; | import org.apache.tools.ant.taskdefs.MatchingTask; | ||||
@@ -134,7 +135,8 @@ public class Cab | |||||
try | try | ||||
{ | { | ||||
File listFile = createListFile( files ); | File listFile = createListFile( files ); | ||||
Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setWorkingDirectory( m_baseDir ); | exe.setWorkingDirectory( m_baseDir ); | ||||
final Commandline cmd = createCommand( listFile ); | final Commandline cmd = createCommand( listFile ); | ||||
@@ -20,7 +20,6 @@ import org.apache.tools.ant.taskdefs.Java; | |||||
import org.apache.tools.ant.taskdefs.Javac; | import org.apache.tools.ant.taskdefs.Javac; | ||||
import org.apache.tools.ant.taskdefs.MatchingTask; | import org.apache.tools.ant.taskdefs.MatchingTask; | ||||
import org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter; | import org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter; | ||||
import org.apache.antlib.file.Mkdir; | |||||
import org.apache.tools.ant.types.DirectoryScanner; | import org.apache.tools.ant.types.DirectoryScanner; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
@@ -708,13 +707,9 @@ public class IContract extends MatchingTask | |||||
// Prepare the directories for iContract. iContract will make them if they | // Prepare the directories for iContract. iContract will make them if they | ||||
// don't exist, but for some reason I don't know, it will complain about the REP files | // don't exist, but for some reason I don't know, it will complain about the REP files | ||||
// afterwards | // afterwards | ||||
Mkdir mkdir = (Mkdir)getProject().createTask( "mkdir" ); | |||||
mkdir.setDir( instrumentDir ); | |||||
mkdir.execute(); | |||||
mkdir.setDir( buildDir ); | |||||
mkdir.execute(); | |||||
mkdir.setDir( repositoryDir ); | |||||
mkdir.execute(); | |||||
instrumentDir.mkdirs(); | |||||
buildDir.mkdirs(); | |||||
repositoryDir.mkdirs(); | |||||
// Set the classpath that is needed for regular Javac compilation | // Set the classpath that is needed for regular Javac compilation | ||||
Path baseClasspath = createClasspath(); | Path baseClasspath = createClasspath(); | ||||
@@ -12,6 +12,7 @@ import java.io.IOException; | |||||
import org.apache.myrmidon.api.AbstractTask; | import org.apache.myrmidon.api.AbstractTask; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.aut.nativelib.ExecOutputHandler; | import org.apache.aut.nativelib.ExecOutputHandler; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
@@ -111,7 +112,8 @@ public abstract class Continuus | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
if( null != handler ) | if( null != handler ) | ||||
{ | { | ||||
@@ -13,6 +13,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* A base class for creating tasks for executing commands on ClearCase. <p> | * A base class for creating tasks for executing commands on ClearCase. <p> | ||||
@@ -107,7 +108,8 @@ public abstract class ClearCase extends Task | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setWorkingDirectory( getBaseDirectory() ); | exe.setWorkingDirectory( getBaseDirectory() ); | ||||
exe.setCommandline( cmd ); | exe.setCommandline( cmd ); | ||||
@@ -14,6 +14,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* This is a helper class to spawn net commands out. In its initial form it | * This is a helper class to spawn net commands out. In its initial form it | ||||
@@ -199,7 +200,8 @@ public class NetCommand | |||||
{ | { | ||||
// default directory to the project's base directory | // default directory to the project's base directory | ||||
File dir = _owner.getBaseDirectory(); | File dir = _owner.getBaseDirectory(); | ||||
_exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)_owner.getService( ExecManager.class ); | |||||
_exe = new Execute2( execManager ); | |||||
setupLogger( _exe ); | setupLogger( _exe ); | ||||
_exe.setWorkingDirectory( dir ); | _exe.setWorkingDirectory( dir ); | ||||
} | } | ||||
@@ -24,6 +24,7 @@ import org.apache.tools.ant.types.Argument; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* BorlandDeploymentTool is dedicated to the Borland Application Server 4.5 and | * BorlandDeploymentTool is dedicated to the Borland Application Server 4.5 and | ||||
@@ -361,7 +362,8 @@ public class BorlandDeploymentTool | |||||
*/ | */ | ||||
private void buildBorlandStubs( Iterator ithomes, Hashtable files ) | private void buildBorlandStubs( Iterator ithomes, Hashtable files ) | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
exe.setWorkingDirectory( getTask().getBaseDirectory() ); | exe.setWorkingDirectory( getTask().getBaseDirectory() ); | ||||
final Commandline cmd = buildCommandline( ithomes ); | final Commandline cmd = buildCommandline( ithomes ); | ||||
@@ -14,6 +14,7 @@ import org.apache.tools.ant.taskdefs.exec.Execute2; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Argument; | import org.apache.tools.ant.types.Argument; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* BorlandGenerateClient is dedicated to the Borland Application Server 4.5 This | * BorlandGenerateClient is dedicated to the Borland Application Server 4.5 This | ||||
@@ -160,7 +161,8 @@ public class BorlandGenerateClient extends Task | |||||
getLogger().info( "mode : fork" ); | getLogger().info( "mode : fork" ); | ||||
getLogger().debug( "Calling java2iiop" ); | getLogger().debug( "Calling java2iiop" ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setWorkingDirectory( new File( "." ) ); | exe.setWorkingDirectory( new File( "." ) ); | ||||
exe.setCommandline( cmd ); | exe.setCommandline( cmd ); | ||||
@@ -19,6 +19,7 @@ import org.apache.tools.ant.types.CommandlineJava; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.PathUtil; | import org.apache.tools.ant.types.PathUtil; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Taskdef for the JJTree compiler compiler. | * Taskdef for the JJTree compiler compiler. | ||||
@@ -181,7 +182,8 @@ public class JJTree extends Task | |||||
cmdl.addVmArgument( "-mx140M" ); | cmdl.addVmArgument( "-mx140M" ); | ||||
cmdl.addVmArgument( "-Dinstall.root=" + javaccHome.getAbsolutePath() ); | cmdl.addVmArgument( "-Dinstall.root=" + javaccHome.getAbsolutePath() ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
getLogger().debug( cmdl.toString() ); | getLogger().debug( cmdl.toString() ); | ||||
@@ -21,6 +21,7 @@ import org.apache.tools.ant.types.Path; | |||||
import org.apache.tools.ant.types.PathUtil; | import org.apache.tools.ant.types.PathUtil; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.avalon.excalibur.util.StringUtil; | import org.apache.avalon.excalibur.util.StringUtil; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Taskdef for the JavaCC compiler compiler. | * Taskdef for the JavaCC compiler compiler. | ||||
@@ -244,7 +245,8 @@ public class JavaCC extends Task | |||||
try | try | ||||
{ | { | ||||
getLogger().debug( cmdline.toString() ); | getLogger().debug( cmdline.toString() ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
final String[] commandline = cmdline.getCommandline(); | final String[] commandline = cmdline.getCommandline(); | ||||
exe.setCommandline( new Commandline( commandline ) ); | exe.setCommandline( new Commandline( commandline ) ); | ||||
@@ -19,6 +19,7 @@ import org.apache.tools.ant.types.CommandlineJava; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Ant task to run JDepend tests. <p> | * Ant task to run JDepend tests. <p> | ||||
@@ -239,7 +240,8 @@ public class JDependTask | |||||
commandline.addArgument( f.getPath() ); | commandline.addArgument( f.getPath() ); | ||||
} | } | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
final String[] commandline1 = commandline.getCommandline(); | final String[] commandline1 = commandline.getCommandline(); | ||||
@@ -32,6 +32,7 @@ import org.apache.tools.ant.types.Path; | |||||
import org.apache.tools.ant.types.SysProperties; | import org.apache.tools.ant.types.SysProperties; | ||||
import org.apache.tools.ant.types.PathUtil; | import org.apache.tools.ant.types.PathUtil; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Ant task to run JUnit tests. <p> | * Ant task to run JUnit tests. <p> | ||||
@@ -649,7 +650,8 @@ public class JUnitTask extends Task | |||||
throw new TaskException( "Error creating temporary properties file.", ioe ); | throw new TaskException( "Error creating temporary properties file.", ioe ); | ||||
} | } | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setCommandline( new Commandline( cmd.getCommandline() ) ); | exe.setCommandline( new Commandline( cmd.getCommandline() ) ); | ||||
if( dir != null ) | if( dir != null ) | ||||
@@ -25,6 +25,7 @@ import org.apache.tools.ant.types.FileSet; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.ScannerUtil; | import org.apache.tools.ant.types.ScannerUtil; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Somewhat abstract framework to be used for other metama 2.0 tasks. This | * Somewhat abstract framework to be used for other metama 2.0 tasks. This | ||||
@@ -278,7 +279,8 @@ public abstract class AbstractMetamataTask | |||||
protected void execute0() | protected void execute0() | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
getLogger().debug( m_cmdl.toString() ); | getLogger().debug( m_cmdl.toString() ); | ||||
final String[] commandline = m_cmdl.getCommandline(); | final String[] commandline = m_cmdl.getCommandline(); | ||||
@@ -21,6 +21,7 @@ import org.apache.tools.ant.types.CommandlineJava; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.avalon.excalibur.io.IOUtil; | import org.apache.avalon.excalibur.io.IOUtil; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Simple Metamata MParse task based on the original written by <a | * Simple Metamata MParse task based on the original written by <a | ||||
@@ -286,7 +287,8 @@ public class MParse | |||||
return; | return; | ||||
} | } | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
getLogger().debug( m_cmdl.toString() ); | getLogger().debug( m_cmdl.toString() ); | ||||
final String[] commandline = m_cmdl.getCommandline(); | final String[] commandline = m_cmdl.getCommandline(); | ||||
@@ -10,6 +10,7 @@ package org.apache.tools.ant.taskdefs.optional.perforce; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.aut.nativelib.ExecOutputHandler; | import org.apache.aut.nativelib.ExecOutputHandler; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.apache.oro.text.perl.Perl5Util; | import org.apache.oro.text.perl.Perl5Util; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
@@ -165,7 +166,8 @@ public abstract class P4Base | |||||
handler = this; | handler = this; | ||||
} | } | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
exe.setExecOutputHandler( handler ); | exe.setExecOutputHandler( handler ); | ||||
exe.setCommandline( cmd ); | exe.setCommandline( cmd ); | ||||
@@ -20,6 +20,7 @@ import java.text.ParseException; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import org.apache.aut.nativelib.ExecOutputHandler; | import org.apache.aut.nativelib.ExecOutputHandler; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.apache.avalon.excalibur.io.IOUtil; | import org.apache.avalon.excalibur.io.IOUtil; | ||||
import org.apache.myrmidon.api.AbstractTask; | import org.apache.myrmidon.api.AbstractTask; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
@@ -190,7 +191,8 @@ public class Pvcs | |||||
getLogger().debug( "Executing " + cmd.toString() ); | getLogger().debug( "Executing " + cmd.toString() ); | ||||
try | try | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setWorkingDirectory( getBaseDirectory() ); | exe.setWorkingDirectory( getBaseDirectory() ); | ||||
exe.setCommandline( cmd ); | exe.setCommandline( cmd ); | ||||
@@ -271,7 +273,8 @@ public class Pvcs | |||||
tmp = File.createTempFile( "pvcs_ant_", ".log" ); | tmp = File.createTempFile( "pvcs_ant_", ".log" ); | ||||
final File fileList = File.createTempFile( "pvcs_ant_", ".log" ); | final File fileList = File.createTempFile( "pvcs_ant_", ".log" ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
exe.setExecOutputHandler( this ); | exe.setExecOutputHandler( this ); | ||||
m_output = new FileOutputStream( tmp ); | m_output = new FileOutputStream( tmp ); | ||||
@@ -20,6 +20,7 @@ import org.apache.tools.ant.taskdefs.exec.Execute2; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
import org.apache.tools.ant.types.ScannerUtil; | import org.apache.tools.ant.types.ScannerUtil; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Convenient task to run the snapshot merge utility for JProbe Coverage. | * Convenient task to run the snapshot merge utility for JProbe Coverage. | ||||
@@ -114,7 +115,8 @@ public class CovMerge extends Task | |||||
} | } | ||||
cmdl.addArgument( "-jp_paramfile=" + paramfile.getAbsolutePath() ); | cmdl.addArgument( "-jp_paramfile=" + paramfile.getAbsolutePath() ); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
getLogger().debug( cmdl.toString() ); | getLogger().debug( cmdl.toString() ); | ||||
exe.setCommandline( cmdl ); | exe.setCommandline( cmdl ); | ||||
@@ -23,6 +23,7 @@ import org.apache.tools.ant.taskdefs.exec.Execute2; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
import org.w3c.dom.Document; | import org.w3c.dom.Document; | ||||
/** | /** | ||||
@@ -246,7 +247,8 @@ public class CovReport extends Task | |||||
} | } | ||||
// use the custom handler for stdin issues | // use the custom handler for stdin issues | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
getLogger().debug( cmdl.toString() ); | getLogger().debug( cmdl.toString() ); | ||||
exe.setCommandline( cmdl ); | exe.setCommandline( cmdl ); | ||||
@@ -21,6 +21,7 @@ import org.apache.tools.ant.types.Commandline; | |||||
import org.apache.tools.ant.types.CommandlineJava; | import org.apache.tools.ant.types.CommandlineJava; | ||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* Convenient task to run Sitraka JProbe Coverage from Ant. Options are pretty | * Convenient task to run Sitraka JProbe Coverage from Ant. Options are pretty | ||||
@@ -250,7 +251,8 @@ public class Coverage | |||||
cmdl.addArgument( "-jp_input=" + paramfile.getAbsolutePath() ); | cmdl.addArgument( "-jp_input=" + paramfile.getAbsolutePath() ); | ||||
// use the custom handler for stdin issues | // use the custom handler for stdin issues | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
getLogger().debug( cmdl.toString() ); | getLogger().debug( cmdl.toString() ); | ||||
exe.setCommandline( cmdl ); | exe.setCommandline( cmdl ); | ||||
@@ -14,6 +14,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
* A base class for creating tasks for executing commands on Visual SourceSafe. | * A base class for creating tasks for executing commands on Visual SourceSafe. | ||||
@@ -204,7 +205,8 @@ public abstract class MSVSS extends Task | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
// If location of ss.ini is specified we need to set the | // If location of ss.ini is specified we need to set the | ||||
@@ -13,6 +13,7 @@ import org.apache.myrmidon.api.AbstractTask; | |||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.aut.nativelib.ExecManager; | |||||
/** | /** | ||||
@@ -90,7 +91,8 @@ public class Rpm | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
final Commandline cmd = createCommand(); | final Commandline cmd = createCommand(); | ||||
final Execute2 exe = new Execute2(); | |||||
final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||||
final Execute2 exe = new Execute2( execManager ); | |||||
setupLogger( exe ); | setupLogger( exe ); | ||||
if( m_topDir == null ) { | if( m_topDir == null ) { | ||||