diff --git a/proposal/myrmidon/src/java/org/apache/antlib/cvslib/Cvs.java b/proposal/myrmidon/src/java/org/apache/antlib/cvslib/Cvs.java index af7444ca0..6ac03eb01 100644 --- a/proposal/myrmidon/src/java/org/apache/antlib/cvslib/Cvs.java +++ b/proposal/myrmidon/src/java/org/apache/antlib/cvslib/Cvs.java @@ -147,15 +147,10 @@ public class Cvs final Properties env = buildEnvironment(); final Execute exe = new Execute(); - if( m_dest == null ) - { - m_dest = getBaseDirectory(); - } exe.setWorkingDirectory( m_dest ); exe.setCommandline( command ); exe.setEnvironment( env ); - exe.setReturnCode( 0 ); exe.execute( getContext() ); } diff --git a/proposal/myrmidon/src/java/org/apache/antlib/dotnet/CSharp.java b/proposal/myrmidon/src/java/org/apache/antlib/dotnet/CSharp.java index 8ac2471cb..71b320296 100644 --- a/proposal/myrmidon/src/java/org/apache/antlib/dotnet/CSharp.java +++ b/proposal/myrmidon/src/java/org/apache/antlib/dotnet/CSharp.java @@ -504,8 +504,6 @@ public class CSharp } final Execute exe = new Execute(); - exe.setReturnCode( 0 ); - final Commandline cmd = exe.getCommandline(); cmd.setExecutable( EXE_NAME ); diff --git a/proposal/myrmidon/src/java/org/apache/antlib/dotnet/Ilasm.java b/proposal/myrmidon/src/java/org/apache/antlib/dotnet/Ilasm.java index 8ad25c984..4dd9f2077 100644 --- a/proposal/myrmidon/src/java/org/apache/antlib/dotnet/Ilasm.java +++ b/proposal/myrmidon/src/java/org/apache/antlib/dotnet/Ilasm.java @@ -248,8 +248,6 @@ public class Ilasm throws TaskException { final Execute exe = new Execute(); - exe.setReturnCode( 0 ); - final Commandline cmd = exe.getCommandline(); cmd.setExecutable( EXE_NAME ); addArgument( cmd, getDebugParameter() ); diff --git a/proposal/myrmidon/src/java/org/apache/antlib/nativelib/Exec.java b/proposal/myrmidon/src/java/org/apache/antlib/nativelib/Exec.java index b44f5aaae..e1c9c1822 100644 --- a/proposal/myrmidon/src/java/org/apache/antlib/nativelib/Exec.java +++ b/proposal/myrmidon/src/java/org/apache/antlib/nativelib/Exec.java @@ -105,15 +105,8 @@ public class Exec return; } - // default directory to the project's base directory - if( m_dir == null ) - { - m_dir = getBaseDirectory(); - } - // execute the command final Execute exe = createExecute(); - exe.setReturnCode( 0 ); exe.execute( getContext() ); } diff --git a/proposal/myrmidon/src/java/org/apache/antlib/security/GenerateKey.java b/proposal/myrmidon/src/java/org/apache/antlib/security/GenerateKey.java index f7e98bfed..8fce2639b 100644 --- a/proposal/myrmidon/src/java/org/apache/antlib/security/GenerateKey.java +++ b/proposal/myrmidon/src/java/org/apache/antlib/security/GenerateKey.java @@ -120,7 +120,6 @@ public class GenerateKey final Commandline cmd = createCommand(); final Execute exe = new Execute(); - exe.setWorkingDirectory( getBaseDirectory() ); exe.setCommandline( cmd ); exe.execute( getContext() ); } diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/api/AbstractTask.java b/proposal/myrmidon/src/java/org/apache/myrmidon/api/AbstractTask.java index 3b00b31be..656f740a9 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/api/AbstractTask.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/api/AbstractTask.java @@ -52,14 +52,22 @@ public abstract class AbstractTask return m_context; } - //Needs to be made protected - public final File getBaseDirectory() + /** + * Convenience method that returns the project's base directory. + */ + protected final File getBaseDirectory() { return getContext().getBaseDirectory(); } - ///HACK: Make this protected - public final Object getService( final Class serviceClass ) + /** + * Convenience method that locates a service for this task to use. + * + * @param serviceClass the service to locate. + * @return the service, never returns null. + * @throws TaskException if the service cannot be located. + */ + protected final Object getService( final Class serviceClass ) throws TaskException { return getContext().getService( serviceClass ); diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Deployment.java b/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Deployment.java index 233339815..be6c97efc 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Deployment.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Deployment.java @@ -272,8 +272,11 @@ class Deployment try { - final String message = REZ.getString( "url-deploy-roles.notice", descriptor.getUrl() ); - getLogger().info( message ); + if( getLogger().isDebugEnabled() ) + { + final String message = REZ.getString( "url-deploy-roles.notice", descriptor.getUrl() ); + getLogger().debug( message ); + } final RoleDefinition[] definitions = descriptor.getDefinitions(); for( int i = 0; i < definitions.length; i++ ) @@ -297,8 +300,11 @@ class Deployment { try { - final String message = REZ.getString( "url-deploy-types.notice", descriptor.getUrl() ); - getLogger().info( message ); + if( getLogger().isDebugEnabled() ) + { + final String message = REZ.getString( "url-deploy-types.notice", descriptor.getUrl() ); + getLogger().debug( message ); + } // Deploy all the types final TypeDefinition[] definitions = descriptor.getDefinitions(); @@ -324,8 +330,11 @@ class Deployment try { - final String message = REZ.getString( "url-deploy-services.notice", descriptor.getUrl() ); - getLogger().info( message ); + if( getLogger().isDebugEnabled() ) + { + final String message = REZ.getString( "url-deploy-services.notice", descriptor.getUrl() ); + getLogger().debug( message ); + } // Deploy the services final ServiceDefinition[] definitions = descriptor.getDefinitions(); diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java b/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java index 9a4f5a5da..5f238c387 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java @@ -247,14 +247,15 @@ public class DefaultWorkspace // Create a logger final Logger logger = - new RoutingLogger( RoutingLogger.LEVEL_DEBUG, m_listenerSupport ); + new RoutingLogger( getLogger(), m_listenerSupport ); // Create and configure the context final DefaultTaskContext context = new DefaultTaskContext( m_baseContext, serviceManager, logger ); context.setProperty( TaskContext.BASE_DIRECTORY, project.getBaseDirectory() ); - final DefaultExecutionFrame frame = new DefaultExecutionFrame( logger, context, typeManager ); + final DefaultExecutionFrame frame = + new DefaultExecutionFrame( logger, context, typeManager ); /** * @todo Should no occur but done for the time being to simplify evolution. diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/RoutingLogger.java b/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/RoutingLogger.java index d4d7e843a..f429cf578 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/RoutingLogger.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/RoutingLogger.java @@ -7,31 +7,72 @@ */ package org.apache.myrmidon.components.workspace; -import org.apache.myrmidon.frontends.BasicLogger; +import org.apache.avalon.framework.logger.Logger; +import org.apache.myrmidon.frontends.AbstractLogger; /** - * A basic logger that just routes the messages to the ProjectListenerSupport. + * A logger that just routes the messages to the ProjectListenerSupport. * * @author Peter Donald * @version $Revision$ $Date$ */ final class RoutingLogger - extends BasicLogger + extends AbstractLogger + implements Logger { /** * The endpoint of all the logging messages. */ private final ProjectListenerSupport m_listenerSupport; + /** + * A wrapped logger that is used to determine which message types are + * enabled. + */ + private final Logger m_logger; + /** * Create a Logger that routes messages at specified level * to specified support. + * + * @todo Use something other than a logger to figure out which messages + * are enabled. */ - public RoutingLogger( final int logLevel, + public RoutingLogger( final Logger logger, final ProjectListenerSupport listenerSupport ) { - super( null, logLevel ); m_listenerSupport = listenerSupport; + m_logger = logger; + } + + public boolean isDebugEnabled() + { + return m_logger.isDebugEnabled(); + } + + public boolean isInfoEnabled() + { + return m_logger.isInfoEnabled(); + } + + public boolean isWarnEnabled() + { + return m_logger.isWarnEnabled(); + } + + public boolean isErrorEnabled() + { + return m_logger.isErrorEnabled(); + } + + public boolean isFatalErrorEnabled() + { + return m_logger.isFatalErrorEnabled(); + } + + public Logger getChildLogger( final String name ) + { + return new RoutingLogger( m_logger.getChildLogger( name ), m_listenerSupport ); } /** diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/framework/Execute.java b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/Execute.java index 2d87b99f9..beaa699b7 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/framework/Execute.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/Execute.java @@ -24,6 +24,9 @@ import org.apache.tools.todo.util.FileUtils; * This is a utility class designed to make executing native * processes easier in the context of ant. * + *
To execute a native process, configure an instance of this class, + * and then call its {@link #execute} method. + * * @author Peter Donald * @author Thomas Haas * @version $Revision$ $Date$ @@ -35,32 +38,50 @@ public class Execute private Commandline m_command; private Properties m_environment = new Properties(); - private File m_workingDirectory = new File( "." ); + private File m_workingDirectory; private boolean m_newEnvironment; private ExecOutputHandler m_handler; private long m_timeout; - private Integer m_returnCode; + private int m_returnCode; + private boolean m_ignoreReturnCode; + /** + * Sets the timeout, in milliseconds, for the process. The process is + * forcibly shutdown after this time. Use 0 to allow the process to + * run forever. Default is 0. + * + * @param timeout the timeout, in milliseconds. + */ public void setTimeout( final long timeout ) { m_timeout = timeout; } + /** + * Sets the handler for the process' output and error streams. If not + * provided, the process' output and error are written to the log using + * the TaskContext's logging methods. + * + * @param handler the handler. + */ public void setExecOutputHandler( final ExecOutputHandler handler ) { m_handler = handler; } /** - * Sets the commandline of the subprocess to launch. + * Sets the commandline of the process to launch. * - * @param command the commandline of the subprocess to launch + * @param command the commandline of the process to launch */ public void setCommandline( final Commandline command ) { m_command = command; } + /** + * Returns the commandline of the process to launch. + */ public Commandline getCommandline() { if( null == m_command ) @@ -70,6 +91,11 @@ public class Execute return m_command; } + /** + * Sets the environment to use for the process. + * + * @param environment a map from environment variable name to value. + */ public void setEnvironment( final Properties environment ) { if( null == environment ) @@ -83,7 +109,7 @@ public class Execute * If this variable is false then then the environment specified is * added to the environment variables for current process. If this * value is true then the specified environment replaces the environment - * for the command. + * for the command. Default is false. */ public void setNewenvironment( final boolean newEnvironment ) { @@ -91,18 +117,36 @@ public class Execute } /** - * Sets the working directory of the process to execute.
+ * Sets the working directory of the process to execute. Default is the + * project's base directory. * - * @param workingDirectory the working directory of the process. + * @param workingDirectory the working directory of the process. Use + * null for the project's base directory. */ public void setWorkingDirectory( final File workingDirectory ) { m_workingDirectory = workingDirectory; } + /** + * Sets the expected return code of the process. If the process does not + * exit with this return code, and exception is thrown by {@link #execute}. + * Default is 0. + * + * @param returnCode the expected return code. + */ public void setReturnCode( final int returnCode ) { - m_returnCode = new Integer( returnCode ); + m_returnCode = returnCode; + } + + /** + * If set to true, the return code of the process is ignore. If false, + * it is compared against the expected return code. Default is false. + */ + public void setIgnoreReturnCode( final boolean ignore ) + { + m_ignoreReturnCode = ignore; } /** @@ -122,11 +166,11 @@ public class Execute // Build the command meta-info final ExecManager execManager = (ExecManager)context.getService( ExecManager.class ); - final ExecMetaData metaData = buildExecMetaData( execManager ); + final ExecMetaData metaData = buildExecMetaData( context, execManager ); logExecDetails( metaData, context ); - // Execute the command and check return code + // Execute the process and check return code final int returnCode = execManager.execute( metaData, handler, m_timeout ); checkReturnCode( returnCode ); return returnCode; @@ -167,20 +211,23 @@ public class Execute final String message = REZ.getString( "execute.no-executable.error" ); throw new TaskException( message ); } - if( !m_workingDirectory.exists() ) + if( m_workingDirectory != null ) { - final String message = REZ.getString( "execute.dir-noexist.error", m_workingDirectory ); - throw new TaskException( message ); - } - else if( !m_workingDirectory.isDirectory() ) - { - final String message = REZ.getString( "execute.dir-notdir.error", m_workingDirectory ); - throw new TaskException( message ); + if( !m_workingDirectory.exists() ) + { + final String message = REZ.getString( "execute.dir-noexist.error", m_workingDirectory ); + throw new TaskException( message ); + } + else if( !m_workingDirectory.isDirectory() ) + { + final String message = REZ.getString( "execute.dir-notdir.error", m_workingDirectory ); + throw new TaskException( message ); + } } } /** - * Creates an output handler to use when executing the commmand. + * Creates an output handler to use for the process' stdout and stderr. */ private ExecOutputHandler buildOutputHandler( final TaskContext context ) { @@ -199,8 +246,7 @@ public class Execute private void checkReturnCode( final int returnCode ) throws TaskException { - if( null != m_returnCode && - returnCode != m_returnCode.intValue() ) + if( ! m_ignoreReturnCode && returnCode != m_returnCode ) { final String message = REZ.getString( "execute.bad-resultcode.error", m_command.getExecutable(), @@ -213,11 +259,14 @@ public class Execute * Utility method to create an ExecMetaData object * to pass to the ExecManager service. */ - private ExecMetaData buildExecMetaData( final ExecManager execManager ) + private ExecMetaData buildExecMetaData( final TaskContext context, + final ExecManager execManager ) throws ExecException { + // Build the command line final String[] command = m_command.getCommandline(); + // Build the environment final Properties newEnvironment = new Properties(); if( !m_newEnvironment ) { @@ -225,8 +274,15 @@ public class Execute } newEnvironment.putAll( m_environment ); + // Determine the working directory + File workingDir = m_workingDirectory; + if( workingDir == null ) + { + workingDir = context.getBaseDirectory(); + } + return new ExecMetaData( command, newEnvironment, - m_workingDirectory ); + workingDir ); } } diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/framework/LoggingExecOutputHandler.java b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/LoggingExecOutputHandler.java index 85464879d..d795bc634 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/framework/LoggingExecOutputHandler.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/LoggingExecOutputHandler.java @@ -33,7 +33,9 @@ public class LoggingExecOutputHandler */ public void stdout( final String line ) { - m_context.info( line ); + // TODO - should be using info(), but currently that is only used + // when ant is run in verbose mode + m_context.warn( line ); } /** diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/AbstractLogger.java b/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/AbstractLogger.java new file mode 100644 index 000000000..bded478ff --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/AbstractLogger.java @@ -0,0 +1,167 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.frontends; + +import org.apache.avalon.framework.logger.Logger; + +/** + * A partial logger implementation. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public abstract class AbstractLogger + implements Logger +{ + public final static int LEVEL_DEBUG = 0; + public final static int LEVEL_INFO = 1; + public final static int LEVEL_WARN = 2; + public final static int LEVEL_ERROR = 3; + public final static int LEVEL_FATAL = 4; + + /** + * Log a debug message. + * + * @param message the message + */ + public void debug( final String message ) + { + if( isDebugEnabled() ) + { + output( message, null ); + } + } + + /** + * Log a debug message. + * + * @param message the message + * @param throwable the throwable + */ + public void debug( final String message, final Throwable throwable ) + { + if( isDebugEnabled() ) + { + output( message, throwable ); + } + } + + /** + * Log a info message. + * + * @param message the message + */ + public void info( final String message ) + { + if( isInfoEnabled() ) + { + output( message, null ); + } + } + + /** + * Log a info message. + * + * @param message the message + * @param throwable the throwable + */ + public void info( final String message, final Throwable throwable ) + { + if( isInfoEnabled() ) + { + output( message, throwable ); + } + } + + /** + * Log a warn message. + * + * @param message the message + */ + public void warn( final String message ) + { + if( isWarnEnabled() ) + { + output( message, null ); + } + } + + /** + * Log a warn message. + * + * @param message the message + * @param throwable the throwable + */ + public void warn( final String message, final Throwable throwable ) + { + if( isWarnEnabled() ) + { + output( message, throwable ); + } + } + + /** + * Log a error message. + * + * @param message the message + */ + public void error( final String message ) + { + if( isErrorEnabled() ) + { + output( message, null ); + } + } + + /** + * Log a error message. + * + * @param message the message + * @param throwable the throwable + */ + public void error( final String message, final Throwable throwable ) + { + if( isErrorEnabled() ) + { + output( message, throwable ); + } + } + + /** + * Log a fatalError message. + * + * @param message the message + */ + public void fatalError( final String message ) + { + if( isFatalErrorEnabled() ) + { + output( message, null ); + } + } + + /** + * Log a fatalError message. + * + * @param message the message + * @param throwable the throwable + */ + public void fatalError( final String message, final Throwable throwable ) + { + if( isFatalErrorEnabled() ) + { + output( message, throwable ); + } + } + + /** + * Utility method to output messages. + */ + protected abstract void output( final String message, + final Throwable throwable ); +} diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/BasicLogger.java b/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/BasicLogger.java index 46f68ed7b..9a245d389 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/BasicLogger.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/BasicLogger.java @@ -17,14 +17,9 @@ import org.apache.avalon.framework.logger.Logger; * @version $Revision$ $Date$ */ public class BasicLogger + extends AbstractLogger implements Logger { - public final static int LEVEL_DEBUG = 0; - public final static int LEVEL_INFO = 1; - public final static int LEVEL_WARN = 2; - public final static int LEVEL_ERROR = 3; - public final static int LEVEL_FATAL = 4; - /** * The string prefixed to all log messages. */ @@ -45,33 +40,6 @@ public class BasicLogger m_logLevel = logLevel; } - /** - * Log a debug message. - * - * @param message the message - */ - public void debug( final String message ) - { - if( isDebugEnabled() ) - { - output( message, null ); - } - } - - /** - * Log a debug message. - * - * @param message the message - * @param throwable the throwable - */ - public void debug( final String message, final Throwable throwable ) - { - if( isDebugEnabled() ) - { - output( message, throwable ); - } - } - /** * Determine if messages of priority "debug" will be logged. * @@ -82,33 +50,6 @@ public class BasicLogger return m_logLevel <= LEVEL_DEBUG; } - /** - * Log a info message. - * - * @param message the message - */ - public void info( final String message ) - { - if( isInfoEnabled() ) - { - output( message, null ); - } - } - - /** - * Log a info message. - * - * @param message the message - * @param throwable the throwable - */ - public void info( final String message, final Throwable throwable ) - { - if( isInfoEnabled() ) - { - output( message, throwable ); - } - } - /** * Determine if messages of priority "info" will be logged. * @@ -119,33 +60,6 @@ public class BasicLogger return m_logLevel <= LEVEL_INFO; } - /** - * Log a warn message. - * - * @param message the message - */ - public void warn( final String message ) - { - if( isWarnEnabled() ) - { - output( message, null ); - } - } - - /** - * Log a warn message. - * - * @param message the message - * @param throwable the throwable - */ - public void warn( final String message, final Throwable throwable ) - { - if( isWarnEnabled() ) - { - output( message, throwable ); - } - } - /** * Determine if messages of priority "warn" will be logged. * @@ -156,33 +70,6 @@ public class BasicLogger return m_logLevel <= LEVEL_WARN; } - /** - * Log a error message. - * - * @param message the message - */ - public void error( final String message ) - { - if( isErrorEnabled() ) - { - output( message, null ); - } - } - - /** - * Log a error message. - * - * @param message the message - * @param throwable the throwable - */ - public void error( final String message, final Throwable throwable ) - { - if( isErrorEnabled() ) - { - output( message, throwable ); - } - } - /** * Determine if messages of priority "error" will be logged. * @@ -193,33 +80,6 @@ public class BasicLogger return m_logLevel <= LEVEL_ERROR; } - /** - * Log a fatalError message. - * - * @param message the message - */ - public void fatalError( final String message ) - { - if( isFatalErrorEnabled() ) - { - output( message, null ); - } - } - - /** - * Log a fatalError message. - * - * @param message the message - * @param throwable the throwable - */ - public void fatalError( final String message, final Throwable throwable ) - { - if( isFatalErrorEnabled() ) - { - output( message, throwable ); - } - } - /** * Determine if messages of priority "fatalError" will be logged. * diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/ANTLR.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/ANTLR.java index add470255..a7bc5ff25 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/ANTLR.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/ANTLR.java @@ -10,14 +10,10 @@ package org.apache.tools.todo.taskdefs; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; -import java.io.IOException; import java.net.URL; -import org.apache.aut.nativelib.ExecManager; import org.apache.myrmidon.api.AbstractTask; import org.apache.myrmidon.api.TaskException; -import org.apache.myrmidon.api.TaskContext; import org.apache.myrmidon.framework.Execute; -import org.apache.tools.todo.taskdefs.ExecuteJava; import org.apache.tools.todo.types.Argument; import org.apache.tools.todo.types.Commandline; import org.apache.tools.todo.types.CommandlineJava; @@ -131,12 +127,7 @@ public class ANTLR extends AbstractTask if( fork ) { - getContext().debug( "Forking " + commandline.toString() ); - int err = run( commandline ); - if( err == 1 ) - { - throw new TaskException( "ANTLR returned: " + err ); - } + run( commandline ); } else { @@ -222,26 +213,15 @@ public class ANTLR extends AbstractTask * execute in a forked VM * * @param command Description of Parameter - * @return Description of the Returned Value * @exception org.apache.myrmidon.api.TaskException Description of Exception */ - private int run( final Commandline command ) + private void run( final Commandline command ) throws TaskException { final Execute exe = new Execute(); - if( workingdir != null ) - { - exe.setWorkingDirectory( workingdir ); - } + exe.setWorkingDirectory( workingdir ); exe.setCommandline( command ); - try - { - return exe.execute( getContext() ); - } - catch( IOException e ) - { - throw new TaskException( "Error", e ); - } + exe.execute( getContext() ); } private void validateAttributes() diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/IContract.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/IContract.java index fcdc9322a..7a1d39baa 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/IContract.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/IContract.java @@ -784,18 +784,7 @@ public class IContract extends MatchingTask } // do it! - int result = iContract.executeJava(); - if( result != 0 ) - { - if( iContractMissing ) - { - getContext().info( "iContract can't be found on your classpath. Your classpath is:" ); - getContext().info( classpath.toString() ); - getContext().info( "If you don't have the iContract jar, go get it at http://www.reliable-systems.com/tools/" ); - } - throw new TaskException( "iContract instrumentation failed. Code=" + result ); - } - + iContract.executeJava(); } else {// not dirty diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Java.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Java.java index 5e4b669b7..b7a949e8b 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Java.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Java.java @@ -120,21 +120,15 @@ public class Java public void execute() throws TaskException { - final int err = executeJava(); - if( 0 != err ) - { - throw new TaskException( "Java returned: " + err ); - } + executeJava(); } /** - * Do the execution and return a return code. + * Do the execution. * - * @return the return code from the execute java class if it was executed in - * a separate VM (fork = "yes"). * @exception org.apache.myrmidon.api.TaskException Description of Exception */ - public int executeJava() + public void executeJava() throws TaskException { final String classname = m_cmdl.getClassname(); @@ -156,8 +150,7 @@ public class Java if( m_fork ) { getContext().debug( "Forking " + m_cmdl.toString() ); - - return run( new Commandline( m_cmdl.getCommandline() ) ); + run( new Commandline( m_cmdl.getCommandline() ) ); } else { @@ -172,7 +165,6 @@ public class Java getContext().debug( "Running in same VM " + m_cmdl.getJavaCommand().toString() ); run( m_cmdl ); - return 0; } } @@ -212,23 +204,12 @@ public class Java /** * Executes the given classname with the given arguments in a separate VM. */ - private int run( final Commandline command ) + private void run( final Commandline command ) throws TaskException { final Execute exe = new Execute(); - - if( m_dir == null ) - { - m_dir = getBaseDirectory(); - } - else if( !m_dir.exists() || !m_dir.isDirectory() ) - { - final String message = m_dir.getAbsolutePath() + " is not a valid directory"; - throw new TaskException( message ); - } - exe.setWorkingDirectory( m_dir ); exe.setCommandline( command ); - return exe.execute( getContext() ); + exe.execute( getContext() ); } } diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Rpm.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Rpm.java index ec59c4016..62d0abc72 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Rpm.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Rpm.java @@ -91,14 +91,8 @@ public class Rpm { final Commandline cmd = createCommand(); final Execute exe = new Execute(); - - if( m_topDir == null ) - { - m_topDir = getBaseDirectory(); - } exe.setWorkingDirectory( m_topDir ); exe.setCommandline( cmd ); - exe.setReturnCode( 0 ); final String message = "Building the RPM based on the " + m_specFile + " file"; getContext().info( message ); diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/ccm/Continuus.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/ccm/Continuus.java index 9cdc514b9..aac89ee87 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/ccm/Continuus.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/ccm/Continuus.java @@ -114,9 +114,7 @@ public abstract class Continuus { exe.setExecOutputHandler( handler ); } - exe.setWorkingDirectory( getBaseDirectory() ); exe.setCommandline( cmd ); - exe.setReturnCode( 0 ); exe.execute( getContext() ); } } diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/clearcase/ClearCase.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/clearcase/ClearCase.java index 0801439a4..0967e25d9 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/clearcase/ClearCase.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/clearcase/ClearCase.java @@ -106,9 +106,7 @@ public abstract class ClearCase extends AbstractTask throws TaskException { final Execute exe = new Execute(); - exe.setWorkingDirectory( getBaseDirectory() ); exe.setCommandline( cmd ); - exe.setReturnCode( 0 ); exe.execute( getContext() ); } diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/DefaultCompilerAdapter.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/DefaultCompilerAdapter.java index 8451cb81b..4288ccc56 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/DefaultCompilerAdapter.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/DefaultCompilerAdapter.java @@ -11,7 +11,6 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; -import org.apache.aut.nativelib.ExecManager; import org.apache.avalon.excalibur.io.IOUtil; import org.apache.avalon.excalibur.util.StringUtil; import org.apache.myrmidon.api.TaskContext; @@ -54,7 +53,6 @@ public abstract class DefaultCompilerAdapter protected boolean m_includeJavaRuntime; protected String m_memoryInitialSize; protected String m_memoryMaximumSize; - protected File m_baseDir; /* * jdg - TODO - all these attributes are currently protected, but they @@ -91,7 +89,6 @@ public abstract class DefaultCompilerAdapter m_extdirs = attributes.getExtdirs(); m_compileList = attributes.getFileList(); m_compileClasspath = attributes.getClasspath(); - m_baseDir = attributes.getBaseDirectory(); m_memoryInitialSize = attributes.getMemoryInitialSize(); m_memoryMaximumSize = attributes.getMemoryMaximumSize(); } @@ -371,7 +368,7 @@ public abstract class DefaultCompilerAdapter } final Execute exe = new Execute(); - exe.setWorkingDirectory( m_baseDir ); + exe.setIgnoreReturnCode( true ); final String[] commandline = commandArray; exe.setCommandline( new Commandline( commandline ) ); return exe.execute( getTaskContext() ); diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JJTree.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JJTree.java index 4bed5c74a..c1303bda2 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JJTree.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JJTree.java @@ -184,7 +184,6 @@ public class JJTree final Execute exe = new Execute(); getContext().debug( cmdl.toString() ); exe.setCommandline( new Commandline( cmdl.getCommandline() ) ); - exe.setReturnCode( 0 ); exe.execute( getContext() ); } } diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JavaCC.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JavaCC.java index 1019c207b..b6217f7ef 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JavaCC.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JavaCC.java @@ -244,7 +244,6 @@ public class JavaCC final Execute exe = new Execute(); final String[] commandline = cmdline.getCommandline(); exe.setCommandline( new Commandline( commandline ) ); - exe.setReturnCode( 0 ); exe.execute( getContext() ); } diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc/Javadoc.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc/Javadoc.java index d6ac1ab5e..92c9102bf 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc/Javadoc.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc/Javadoc.java @@ -823,15 +823,7 @@ public class Javadoc final Execute exe = new Execute(); exe.setExecOutputHandler( this ); - /* - * No reason to change the working directory as all filenames and - * path components have been resolved already. - * - * Avoid problems with command line length in some environments. - */ - exe.setWorkingDirectory( null ); exe.setCommandline( cmd ); - exe.setReturnCode( 0 ); try { exe.execute( getContext() ); diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jdepend/JDependTask.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jdepend/JDependTask.java index ef8e0bc5d..f56e6e9ab 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jdepend/JDependTask.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jdepend/JDependTask.java @@ -11,10 +11,8 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; -import org.apache.aut.nativelib.ExecManager; import org.apache.myrmidon.api.AbstractTask; import org.apache.myrmidon.api.TaskException; -import org.apache.myrmidon.api.TaskContext; import org.apache.myrmidon.framework.Execute; import org.apache.tools.todo.types.Commandline; import org.apache.tools.todo.types.CommandlineJava; @@ -36,16 +34,6 @@ import org.apache.tools.todo.util.FileUtils; public class JDependTask extends AbstractTask { - /** - * No problems with this test. - */ - private final static int SUCCESS = 0; - - /** - * An error occured. - */ - private final static int ERRORS = 1; - private boolean m_fork; private String m_jvm; private String m_format = "text"; @@ -84,7 +72,7 @@ public class JDependTask /** * Tells whether a JVM should be forked for the task. Default: false. * - * @param value true if a JVM should be forked, otherwise false + * @param fork true if a JVM should be forked, otherwise false * */ public void setFork( final boolean fork ) @@ -101,7 +89,7 @@ public class JDependTask * Set a new VM to execute the task. Default is java . Ignored if * no JVM is forked. * - * @param value the new VM to use instead of java + * @param jvm the new VM to use instead of java * @see #setFork(boolean) */ public void setJvm( final String jvm ) @@ -179,22 +167,13 @@ public class JDependTask } // execute the test and get the return code - int exitValue = JDependTask.ERRORS; if( !m_fork ) { - exitValue = executeInVM( commandline ); + executeInVM( commandline ); } else { - exitValue = executeAsForked( commandline ); - } - - // if there is an error/failure and that it should halt, stop everything otherwise - // just log a statement - final boolean errorOccurred = exitValue == JDependTask.ERRORS; - if( errorOccurred ) - { - throw new TaskException( "JDepend failed" ); + executeAsForked( commandline ); } } @@ -205,7 +184,7 @@ public class JDependTask * killedProcess() method of the watchdog class. */ // JL: comment extracted from JUnitTask (and slightly modified) - private int executeAsForked( final CommandlineJava commandline ) + private void executeAsForked( final CommandlineJava commandline ) throws TaskException { // if not set, auto-create the ClassPath from the project @@ -245,17 +224,13 @@ public class JDependTask final String[] commandline1 = commandline.getCommandline(); exe.setCommandline( new Commandline( commandline1 ) ); - if( m_dir != null ) - { - exe.setWorkingDirectory( m_dir ); - } + exe.setWorkingDirectory( m_dir ); if( m_outputFile != null ) { getContext().info( "Output to be stored in " + m_outputFile.getPath() ); } - getContext().debug( "Executing: " + commandline.toString() ); - return exe.execute( getContext() ); + exe.execute( getContext() ); } @@ -268,10 +243,9 @@ public class JDependTask * Execute inside VM. * * @param commandline Description of Parameter - * @return Description of the Returned Value * @exception TaskException Description of Exception */ - public int executeInVM( final CommandlineJava commandline ) + private void executeInVM( final CommandlineJava commandline ) throws TaskException { jdepend.textui.JDepend jdepend; @@ -326,6 +300,5 @@ public class JDependTask } } jdepend.analyze(); - return SUCCESS; } } diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/WLJspc.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/WLJspc.java index 239215d0b..96072ac05 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/WLJspc.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/WLJspc.java @@ -231,10 +231,7 @@ public class WLJspc extends MatchingTask //helperTask.clearArgs(); helperTask.addArg( new Argument( arg ) ); helperTask.addClasspath( compileClasspath ); - if( helperTask.executeJava() != 0 ) - { - getContext().warn( files[ i ] + " failed to compile" ); - } + helperTask.executeJava(); } } diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/AggregateTransformer.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/AggregateTransformer.java index 041d5ffec..2a5a7903a 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/AggregateTransformer.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/AggregateTransformer.java @@ -16,7 +16,7 @@ import java.net.URL; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.apache.avalon.excalibur.io.FileUtil; -import org.apache.myrmidon.api.AbstractTask; +import org.apache.myrmidon.api.TaskContext; import org.apache.myrmidon.api.TaskException; import org.apache.tools.todo.types.EnumeratedAttribute; import org.w3c.dom.Document; @@ -57,7 +57,7 @@ public class AggregateTransformer */ private File m_styleDir; - private AbstractTask m_task; + private TaskContext m_context; /** * the destination directory, this is the root from where html should be @@ -65,9 +65,9 @@ public class AggregateTransformer */ private File m_toDir; - public AggregateTransformer( AbstractTask task ) + public AggregateTransformer( TaskContext context ) { - m_task = task; + m_context = context; } public void setFormat( Format format ) @@ -196,11 +196,11 @@ public class AggregateTransformer // set the destination directory relative from the project if needed. if( m_toDir == null ) { - m_toDir = FileUtil.resolveFile( m_task.getBaseDirectory(), "." ); + m_toDir = FileUtil.resolveFile( m_context.getBaseDirectory(), "." ); } else if( !m_toDir.isAbsolute() ) { - m_toDir = FileUtil.resolveFile( m_task.getBaseDirectory(), m_toDir.getPath() ); + m_toDir = FileUtil.resolveFile( m_context.getBaseDirectory(), m_toDir.getPath() ); } } diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/JUnitTask.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/JUnitTask.java index 5f57b4bde..221665e13 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/JUnitTask.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/JUnitTask.java @@ -633,13 +633,10 @@ public class JUnitTask extends AbstractTask } final Execute exe = new Execute(); + exe.setIgnoreReturnCode( true ); exe.setCommandline( new Commandline( cmd.getCommandline() ) ); - if( dir != null ) - { - exe.setWorkingDirectory( dir ); - } + exe.setWorkingDirectory( dir ); - getContext().debug( "Executing: " + cmd.toString() ); try { return exe.execute( getContext() ); diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/XMLResultAggregator.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/XMLResultAggregator.java index e24a8c84d..55f90d7d8 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/XMLResultAggregator.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/XMLResultAggregator.java @@ -133,7 +133,7 @@ public class XMLResultAggregator public AggregateTransformer createReport() { - AggregateTransformer transformer = new AggregateTransformer( this ); + AggregateTransformer transformer = new AggregateTransformer( getContext() ); transformers.add( transformer ); return transformer; } diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/AbstractMetamataTask.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/AbstractMetamataTask.java index b805411ca..1386d5030 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/AbstractMetamataTask.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/AbstractMetamataTask.java @@ -281,7 +281,6 @@ public abstract class AbstractMetamataTask getContext().debug( m_cmdl.toString() ); final String[] commandline = m_cmdl.getCommandline(); exe.setCommandline( new Commandline( commandline ) ); - exe.setReturnCode( 0 ); exe.execute( getContext() ); } diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MParse.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MParse.java index 811e1d4aa..7fa135912 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MParse.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MParse.java @@ -292,7 +292,6 @@ public class MParse getContext().debug( m_cmdl.toString() ); final String[] commandline = m_cmdl.getCommandline(); exe.setCommandline( new Commandline( commandline ) ); - exe.setReturnCode( 0 ); exe.execute( getContext() ); } diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/pvcs/Pvcs.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/pvcs/Pvcs.java index b389e8548..826ae6f2b 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/pvcs/Pvcs.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/pvcs/Pvcs.java @@ -19,12 +19,10 @@ import java.text.MessageFormat; import java.text.ParseException; import java.util.ArrayList; import java.util.Iterator; -import org.apache.aut.nativelib.ExecManager; import org.apache.aut.nativelib.ExecOutputHandler; import org.apache.avalon.excalibur.io.IOUtil; import org.apache.myrmidon.api.AbstractTask; import org.apache.myrmidon.api.TaskException; -import org.apache.myrmidon.api.TaskContext; import org.apache.myrmidon.framework.Execute; import org.apache.tools.todo.types.Commandline; @@ -181,8 +179,6 @@ public class Pvcs public void execute() throws TaskException { - int result = 0; - validate(); final File filelist = getFileList(); @@ -192,10 +188,9 @@ public class Pvcs try { final Execute exe = new Execute(); - exe.setWorkingDirectory( getBaseDirectory() ); + exe.setIgnoreReturnCode( m_ignoreReturnCode ); exe.setCommandline( cmd ); - result = exe.execute( getContext() ); - checkResultCode( result, cmd ); + exe.execute( getContext() ); } finally { @@ -238,17 +233,6 @@ public class Pvcs return cmd; } - private void checkResultCode( final int result, final Commandline cmd ) - throws TaskException - { - if( result != 0 && !m_ignoreReturnCode ) - { - final String message = "Failed executing: " + cmd.toString() + - ". Return code was " + result; - throw new TaskException( message ); - } - } - private File getFileList() throws TaskException { @@ -267,12 +251,11 @@ public class Pvcs final File fileList = File.createTempFile( "pvcs_ant_", ".log" ); final Execute exe = new Execute(); + exe.setIgnoreReturnCode( m_ignoreReturnCode ); exe.setExecOutputHandler( this ); m_output = new FileOutputStream( tmp ); - exe.setWorkingDirectory( getBaseDirectory() ); exe.setCommandline( cmd ); - final int result = exe.execute( getContext() ); - checkResultCode( result, cmd ); + exe.execute( getContext() ); if( !tmp.exists() ) { diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/CovMerge.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/CovMerge.java index 8a4e1a09d..f0b7e2e31 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/CovMerge.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/CovMerge.java @@ -118,7 +118,6 @@ public class CovMerge final Execute exe = new Execute(); exe.setCommandline( cmdl ); - exe.setReturnCode( 0 ); // JProbe process always return 0 so we will not be // able to check for failure ! :-( diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/CovReport.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/CovReport.java index ed53fcab8..cf9b8a896 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/CovReport.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/CovReport.java @@ -251,7 +251,6 @@ public class CovReport // use the custom handler for stdin issues final Execute exe = new Execute(); exe.setCommandline( cmdl ); - exe.setReturnCode( 0 ); exe.execute( getContext() ); getContext().debug( "coveragePath: " + coveragePath ); getContext().debug( "format: " + format ); diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/Coverage.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/Coverage.java index 1280b8a85..0f894a1ae 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/Coverage.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/Coverage.java @@ -252,7 +252,6 @@ public class Coverage // use the custom handler for stdin issues final Execute exe = new Execute(); exe.setCommandline( cmdl ); - exe.setReturnCode( 0 ); exe.execute( getContext() ); } finally diff --git a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/vss/MSVSS.java b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/vss/MSVSS.java index d5f9bb7b1..8a36dcd6b 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/vss/MSVSS.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/vss/MSVSS.java @@ -213,9 +213,7 @@ public abstract class MSVSS exe.setEnvironment( env ); } - exe.setWorkingDirectory( getBaseDirectory() ); exe.setCommandline( cmd ); - exe.setReturnCode( 0 ); exe.execute( getContext() ); } }