@Component(role=org.codehaus.plexus.compiler.Compiler.class,
hint="jdt")
public class JDTCompiler
extends org.codehaus.plexus.compiler.AbstractCompiler
Modifier and Type | Field and Description |
---|---|
private static char[] |
ADAPTER_ACCESS |
private static char[] |
ADAPTER_ENCODING |
private static char[] |
ADAPTER_PREFIX |
(package private) static java.util.regex.Pattern |
LINE_PATTERN |
private static java.lang.String |
SEPARATOR |
private static char[] |
SEPARATOR_CHARS |
Constructor and Description |
---|
JDTCompiler() |
Modifier and Type | Method and Description |
---|---|
private static void |
addMessageIfFound(java.util.List<org.codehaus.plexus.compiler.CompilerMessage> messages,
java.lang.String type,
java.lang.String file,
int line,
java.lang.String message) |
java.lang.String[] |
buildCompilerArguments(org.codehaus.plexus.compiler.CompilerConfiguration config,
CustomCompilerConfiguration custom,
java.lang.String[] sourceFiles) |
private void |
checkCompilerArgs(java.util.Map<java.lang.String,java.lang.String> args,
CustomCompilerConfiguration custom)
check the compiler arguments.
|
(package private) org.codehaus.plexus.compiler.CompilerResult |
compileInProcess(java.lang.String[] args,
CustomCompilerConfiguration custom)
Compile the java sources in the current JVM, without calling an external executable, using
com.sun.tools.javac.Main class |
(package private) org.codehaus.plexus.compiler.CompilerResult |
compileOutOfProcess(java.io.File workingDirectory,
java.lang.String executable,
java.lang.String[] args)
Compile the java sources in a external process, calling an external executable, like javac.
|
private java.lang.String |
createClasspathArgument(java.util.List<java.lang.String> classpath,
CustomCompilerConfiguration custom)
Copy the classpath to the command line with access rules included.
|
java.lang.String[] |
createCommandLine(org.codehaus.plexus.compiler.CompilerConfiguration config) |
protected static java.util.List<org.codehaus.plexus.compiler.CompilerMessage> |
parseModernStream(java.io.BufferedReader input)
Parse the output from the compiler into a list of CompilerMessage objects
|
org.codehaus.plexus.compiler.CompilerResult |
performCompile(org.codehaus.plexus.compiler.CompilerConfiguration config) |
private static boolean |
suppressEncoding(org.codehaus.plexus.compiler.CompilerConfiguration config) |
private static boolean |
suppressSource(org.codehaus.plexus.compiler.CompilerConfiguration config) |
canUpdateTarget, compile, getCompilerOutputStyle, getInputFileEnding, getOutputFile, getOutputFileEnding, getPathString, getSourceFiles, getSourceFilesForSourceRoot, makeClassName, toStringArray
private static final java.lang.String SEPARATOR
private static final char[] SEPARATOR_CHARS
private static final char[] ADAPTER_PREFIX
private static final char[] ADAPTER_ENCODING
private static final char[] ADAPTER_ACCESS
static final java.util.regex.Pattern LINE_PATTERN
public org.codehaus.plexus.compiler.CompilerResult performCompile(org.codehaus.plexus.compiler.CompilerConfiguration config) throws org.codehaus.plexus.compiler.CompilerException
performCompile
in interface org.codehaus.plexus.compiler.Compiler
performCompile
in class org.codehaus.plexus.compiler.AbstractCompiler
org.codehaus.plexus.compiler.CompilerException
public java.lang.String[] createCommandLine(org.codehaus.plexus.compiler.CompilerConfiguration config) throws org.codehaus.plexus.compiler.CompilerException
org.codehaus.plexus.compiler.CompilerException
public java.lang.String[] buildCompilerArguments(org.codehaus.plexus.compiler.CompilerConfiguration config, CustomCompilerConfiguration custom, java.lang.String[] sourceFiles)
private static boolean suppressSource(org.codehaus.plexus.compiler.CompilerConfiguration config)
private static boolean suppressEncoding(org.codehaus.plexus.compiler.CompilerConfiguration config)
org.codehaus.plexus.compiler.CompilerResult compileOutOfProcess(java.io.File workingDirectory, java.lang.String executable, java.lang.String[] args) throws org.codehaus.plexus.compiler.CompilerException
workingDirectory
- base directory where the process will be launchedexecutable
- name of the executable to launchargs
- arguments for the executable launchedorg.codehaus.plexus.compiler.CompilerException
org.codehaus.plexus.compiler.CompilerResult compileInProcess(java.lang.String[] args, CustomCompilerConfiguration custom) throws org.codehaus.plexus.compiler.CompilerException
com.sun.tools.javac.Main
classargs
- arguments for the compiler as they would be used in the command line javacorg.codehaus.plexus.compiler.CompilerException
protected static java.util.List<org.codehaus.plexus.compiler.CompilerMessage> parseModernStream(java.io.BufferedReader input) throws java.io.IOException
input
- The output of the compilerjava.io.IOException
private static void addMessageIfFound(java.util.List<org.codehaus.plexus.compiler.CompilerMessage> messages, java.lang.String type, java.lang.String file, int line, java.lang.String message)
private java.lang.String createClasspathArgument(java.util.List<java.lang.String> classpath, CustomCompilerConfiguration custom)
cmd
- the given command lineclasspath
- the given classpath entryprivate void checkCompilerArgs(java.util.Map<java.lang.String,java.lang.String> args, CustomCompilerConfiguration custom)
args
- compiler arguments to process