You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ca...@apache.org on 2008/04/17 03:59:24 UTC
svn commit: r648917 -
/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
Author: carlos
Date: Wed Apr 16 18:58:58 2008
New Revision: 648917
URL: http://svn.apache.org/viewvc?rev=648917&view=rev
Log:
Refactor the command line creation
Modified:
continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java?rev=648917&r1=648916&r2=648917&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java Wed Apr 16 18:58:58 2008
@@ -60,14 +60,21 @@
environments );
}
- public ExecutionResult executeShellCommand( File workingDirectory, String executable, String[] arguments,
- File output, long idCommand, Map<String, String> environments )
+ /**
+ * Make the command line
+ *
+ * @param workingDirectory
+ * @param executable
+ * @param arguments
+ * @param idCommand
+ * @param environments
+ * @return
+ * @throws Exception
+ */
+ protected Commandline createCommandline( File workingDirectory, String executable, String[] arguments,
+ long idCommand, Map<String, String> environments )
throws Exception
{
- // ----------------------------------------------------------------------
- // Make the command line
- // ----------------------------------------------------------------------
-
Commandline cl = new Commandline();
cl.setPid( idCommand );
@@ -96,6 +103,16 @@
cl.createArgument().setValue( argument );
}
+
+ return cl;
+ }
+
+ public ExecutionResult executeShellCommand( File workingDirectory, String executable, String[] arguments,
+ File output, long idCommand, Map<String, String> environments )
+ throws Exception
+ {
+
+ Commandline cl = createCommandline( workingDirectory, executable, arguments, idCommand, environments );
getLogger().info( "Executing: " + cl );
getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() );