Author: sisbell
Date: Sat Nov 24 12:22:33 2007
New Revision: 597907
URL: http://svn.apache.org/viewvc?rev=597907&view=rev
Log:
Additional compiler classes, cleanup of API.
Added:
incubator/nmaven/tags/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-executable/src/org/apache/maven/dotnet/compiler/CommandExecutor.java
(with props)
incubator/nmaven/tags/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-executable/src/org/apache/maven/dotnet/compiler/CompilerException.java
(with props)
Modified:
incubator/nmaven/tags/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-executable/src/org/apache/maven/dotnet/compiler/CompilerContext.java
incubator/nmaven/tags/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-executable/src/org/apache/maven/dotnet/compiler/impl/NetCompilerContextImpl.java
Added:
incubator/nmaven/tags/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-executable/src/org/apache/maven/dotnet/compiler/CommandExecutor.java
URL:
http://svn.apache.org/viewvc/incubator/nmaven/tags/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-executable/src/org/apache/maven/dotnet/compiler/CommandExecutor.java?rev=597907&view=auto
==
---
incubator/nmaven/tags/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-executable/src/org/apache/maven/dotnet/compiler/CommandExecutor.java
(added)
+++
incubator/nmaven/tags/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-executable/src/org/apache/maven/dotnet/compiler/CommandExecutor.java
Sat Nov 24 12:22:33 2007
@@ -0,0 +1,306 @@
+package org.apache.maven.dotnet.compiler;
+
+import org.codehaus.plexus.logging.Logger;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+import org.codehaus.plexus.util.cli.Commandline;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.DefaultConsumer;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.io.File;
+
+/**
+ * Provides services for executing commands (executables or compilers). A
NetExecutable or
+ * CompilerExecutable implementation can use the services of this
interface for executing commands.
+ *
+ * @author Shane Isbell
+ */
+public interface CommandExecutor
+{
+/**
+ * Sets the plexus logger.
+ *
+ * @param logger the plexus logger
+ */
+void setLogger( Logger logger );
+
+/**
+ * Executes the command for the specified executable and list of command
options.
+ *
+ * @param executable the name of the executable (csc, xsd, etc).
+ * @param commands the command options for the compiler/executable
+ * @throws org.apache.maven.dotnet.executable.ExecutionException if
compiler or executable writes anything to the standard error stream or if the
process
+ *returns a process result != 0.
+ */
+void executeCommand( String executable, List commands )
+throws CompilerException;
+
+/**
+ * Executes the command for the specified executable and list of command
options.
+ *
+ * @param executable the name of the executable (csc, xsd, etc).
+ * @param commands the commands options for the
compiler/executable
+ * @param failsOnErrorOutput if true, throws an
ExecutionException if there the compiler or executable
+ * writes anything to the error output stream.
By default, this value is true
+ * @throws org.apache.maven.dotnet.executable.ExecutionException if
compiler or executable writes anything to the standard error stream (provided
the
+ *failsOnErrorOutput is not false) or if the
process returns a process result != 0.
+ */
+void executeCommand( String executable, List commands, boolean
failsOnErrorOutput )
+throws CompilerException;
+
+/**
+ * Executes the command for the specified executable and list of command
options. If the compiler or executable is
+ * not within the environmental path, you should use this method to
specify the working directory. Always use this
+ * method for executables located within the local maven repository.
+ *
+ * @param executable the name of the executable (csc, xsd, etc).
+ * @param commands the command options for the compiler/executable
+ * @param workingDirectory the directory where the command will be executed
+ * @throws org.apache.maven.dotnet.executable.ExecutionException if
compiler or executable writes anything to the standard error stream (provided
the
+ *failsOnErrorOutput is not false) or if the
process returns a process result != 0.
+ */
+void executeCommand( String executable, List commands, File
workingDirectory, boolean failsOnErrorOutput )
+throws CompilerException;
+
+/**
+ * Returns the process result of executing the command. Typically a value
of 0 means