Package org.codehaus.plexus.compiler
Class AbstractCompiler
- java.lang.Object
-
- org.codehaus.plexus.compiler.AbstractCompiler
-
- All Implemented Interfaces:
Compiler
- Direct Known Subclasses:
CSharpCompiler
,JavacCompiler
public abstract class AbstractCompiler extends java.lang.Object implements Compiler
-
-
Field Summary
Fields Modifier and Type Field Description private CompilerOutputStyle
compilerOutputStyle
protected static java.lang.String
EOL
private java.lang.String
inputFileEnding
private org.slf4j.Logger
log
private java.lang.String
outputFile
private java.lang.String
outputFileEnding
private org.codehaus.plexus.logging.Logger
plexusLogger
protected static java.lang.String
PS
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCompiler(CompilerOutputStyle compilerOutputStyle, java.lang.String inputFileEnding, java.lang.String outputFileEnding, java.lang.String outputFile)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
canUpdateTarget(CompilerConfiguration configuration)
private static java.lang.String
getCanonicalPath(java.io.File origFile)
abstract java.lang.String
getCompilerId()
CompilerOutputStyle
getCompilerOutputStyle()
java.lang.String
getInputFileEnding(CompilerConfiguration configuration)
protected org.slf4j.Logger
getLog()
protected org.codehaus.plexus.logging.Logger
getLogger()
Deprecated.please usegetLog()
java.lang.String
getOutputFile(CompilerConfiguration configuration)
java.lang.String
getOutputFileEnding(CompilerConfiguration configuration)
static java.lang.String
getPathString(java.util.List<java.lang.String> pathElements)
protected static java.lang.String[]
getSourceFiles(CompilerConfiguration config)
protected static java.util.Set<java.lang.String>
getSourceFilesForSourceRoot(CompilerConfiguration config, java.lang.String sourceLocation)
protected void
logCompiling(java.lang.String[] sourceFiles, CompilerConfiguration config)
protected static java.lang.String
makeClassName(java.lang.String fileName, java.lang.String sourceDir)
CompilerResult
performCompile(CompilerConfiguration configuration)
Performs the compilation of the project.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.codehaus.plexus.compiler.Compiler
createCommandLine, supportsIncrementalCompilation
-
-
-
-
Field Detail
-
log
private final org.slf4j.Logger log
-
plexusLogger
private final org.codehaus.plexus.logging.Logger plexusLogger
-
EOL
protected static final java.lang.String EOL
-
PS
protected static final java.lang.String PS
-
compilerOutputStyle
private final CompilerOutputStyle compilerOutputStyle
-
inputFileEnding
private final java.lang.String inputFileEnding
-
outputFileEnding
private final java.lang.String outputFileEnding
-
outputFile
private final java.lang.String outputFile
-
-
Constructor Detail
-
AbstractCompiler
protected AbstractCompiler(CompilerOutputStyle compilerOutputStyle, java.lang.String inputFileEnding, java.lang.String outputFileEnding, java.lang.String outputFile)
-
-
Method Detail
-
getLog
protected org.slf4j.Logger getLog()
- Returns:
- a Logger
-
getLogger
@Deprecated protected org.codehaus.plexus.logging.Logger getLogger()
Deprecated.please usegetLog()
- Returns:
- a plexus Logger
-
getCompilerId
public abstract java.lang.String getCompilerId()
-
performCompile
public CompilerResult performCompile(CompilerConfiguration configuration) throws CompilerException
Description copied from interface:Compiler
Performs the compilation of the project. Clients must implement this method.- Specified by:
performCompile
in interfaceCompiler
- Parameters:
configuration
- the configuration description of the compilation to perform- Returns:
- the result of the compilation returned by the language processor
- Throws:
CompilerException
-
getCompilerOutputStyle
public CompilerOutputStyle getCompilerOutputStyle()
- Specified by:
getCompilerOutputStyle
in interfaceCompiler
-
getInputFileEnding
public java.lang.String getInputFileEnding(CompilerConfiguration configuration) throws CompilerException
- Specified by:
getInputFileEnding
in interfaceCompiler
- Throws:
CompilerException
-
getOutputFileEnding
public java.lang.String getOutputFileEnding(CompilerConfiguration configuration) throws CompilerException
- Specified by:
getOutputFileEnding
in interfaceCompiler
- Throws:
CompilerException
-
getOutputFile
public java.lang.String getOutputFile(CompilerConfiguration configuration) throws CompilerException
- Specified by:
getOutputFile
in interfaceCompiler
- Throws:
CompilerException
-
canUpdateTarget
public boolean canUpdateTarget(CompilerConfiguration configuration) throws CompilerException
- Specified by:
canUpdateTarget
in interfaceCompiler
- Throws:
CompilerException
-
getPathString
public static java.lang.String getPathString(java.util.List<java.lang.String> pathElements)
-
getSourceFilesForSourceRoot
protected static java.util.Set<java.lang.String> getSourceFilesForSourceRoot(CompilerConfiguration config, java.lang.String sourceLocation)
-
getSourceFiles
protected static java.lang.String[] getSourceFiles(CompilerConfiguration config)
-
makeClassName
protected static java.lang.String makeClassName(java.lang.String fileName, java.lang.String sourceDir) throws CompilerException
- Throws:
CompilerException
-
getCanonicalPath
private static java.lang.String getCanonicalPath(java.io.File origFile) throws CompilerException
- Throws:
CompilerException
-
logCompiling
protected void logCompiling(java.lang.String[] sourceFiles, CompilerConfiguration config)
-
-