public abstract class AbstractCompileMojo extends AbstractGroovySourcesMojo
| Modifier and Type | Field and Description |
|---|---|
protected java.io.File |
configScript
A script
for tweaking the configuration options (requires Groovy 2.1.0-beta-1
or greater).
|
protected boolean |
debug
Whether Groovy compiler should be set to debug.
|
protected static Version |
GROOVY_1_6_0
Groovy 1.6.0 version.
|
protected static Version |
GROOVY_2_1_0_BETA1
Groovy 2.1.0 beta-1 version.
|
protected static Version |
GROOVY_2_1_0_BETA3
Groovy 2.1.0 beta-3 version.
|
protected boolean |
invokeDynamic
Whether to support invokeDynamic (requires Java 7 or greater and Groovy
indy 2.0.0-beta-3 or greater).
|
protected java.io.File |
outputDirectory
The location for the compiled classes.
|
protected java.lang.String |
sourceEncoding
The encoding of source files.
|
protected java.lang.String |
targetBytecode
The Groovy compiler bytecode compatibility.
|
protected java.io.File |
testOutputDirectory
The location for the compiled test classes.
|
protected int |
tolerance
Groovy compiler error tolerance
(the number of non-fatal errors (per unit) that should be tolerated
before compilation is aborted).
|
protected boolean |
verbose
Whether Groovy compiler should be set to verbose.
|
protected int |
warningLevel
Groovy compiler warning level.
|
MAIN, sources, TEST, testSourcesclassWrangler, GROOVY_1_5_0, GROOVY_SOURCES_PATTERN, JAVA_1_7, JAVA_SOURCES_PATTERN, minGroovyVersion, mojoExecution, pluginArtifacts, project, session, skipTests| Constructor and Description |
|---|
AbstractCompileMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doCompile(java.util.Set<java.io.File> sources,
java.util.List classpath,
java.io.File compileOutputDirectory)
Performs compilation of compile mojos.
|
protected java.lang.Object |
setupCompilationUnit(java.util.Set<java.io.File> sources,
java.lang.Class compilerConfigurationClass,
java.lang.Class compilationUnitClass,
java.lang.Class groovyClassLoaderClass,
java.lang.Object compilerConfiguration,
java.lang.Object groovyClassLoader,
java.lang.Object transformLoader)
Sets up the CompilationUnit to use for compilation.
|
protected java.lang.Object |
setupCompilerConfiguration(java.io.File compileOutputDirectory,
java.lang.Class compilerConfigurationClass)
Sets up the CompilationConfiguration to use for compilation.
|
getFiles, getFilesets, getSourceRoots, getSourceRoots, getSources, getSources, getTestSourceRoots, getTestSourceRoots, getTestSources, getTestSources, setSources, setTestSourcesgetJavaVersion, getJavaVersionString, groovyVersionSupportsAction, isJavaSupportIndy, logPluginClasspathgetLog, getPluginContext, setLog, setPluginContextprotected static final Version GROOVY_2_1_0_BETA3
protected static final Version GROOVY_2_1_0_BETA1
protected static final Version GROOVY_1_6_0
protected java.io.File outputDirectory
protected java.io.File testOutputDirectory
protected java.lang.String sourceEncoding
protected java.lang.String targetBytecode
protected boolean debug
protected boolean verbose
protected int warningLevel
protected int tolerance
protected boolean invokeDynamic
protected java.io.File configScript
protected void doCompile(java.util.Set<java.io.File> sources,
java.util.List classpath,
java.io.File compileOutputDirectory)
throws java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.net.MalformedURLException
sources - the sources to compileclasspath - the classpath to use for compilationcompileOutputDirectory - the directory to write the compiled class files tojava.lang.ClassNotFoundException - when a class needed for compilation cannot be foundjava.lang.InstantiationException - when a class needed for compilation cannot be instantiatedjava.lang.IllegalAccessException - when a method needed for compilation cannot be accessedjava.lang.reflect.InvocationTargetException - when a reflection invocation needed for compilation cannot be completedjava.net.MalformedURLException - when a classpath element provides a malformed URLprotected java.lang.Object setupCompilationUnit(java.util.Set<java.io.File> sources,
java.lang.Class compilerConfigurationClass,
java.lang.Class compilationUnitClass,
java.lang.Class groovyClassLoaderClass,
java.lang.Object compilerConfiguration,
java.lang.Object groovyClassLoader,
java.lang.Object transformLoader)
throws java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
sources - the sources to compilecompilerConfigurationClass - the CompilerConfiguration classcompilationUnitClass - the CompilationUnit classgroovyClassLoaderClass - the GroovyClassLoader classcompilerConfiguration - the CompilerConfigurationgroovyClassLoader - the GroovyClassLoadertransformLoader - the GroovyClassLoader to use for transformationjava.lang.InstantiationException - when a class needed for setting up compilation unit cannot be instantiatedjava.lang.IllegalAccessException - when a method needed for setting up compilation unit cannot be accessedjava.lang.reflect.InvocationTargetException - when a reflection invocation needed for setting up compilation unit cannot be completedprotected java.lang.Object setupCompilerConfiguration(java.io.File compileOutputDirectory,
java.lang.Class compilerConfigurationClass)
throws java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
java.lang.ClassNotFoundException
compileOutputDirectory - the directory to write the compiled classes tocompilerConfigurationClass - the CompilerConfiguration classjava.lang.ClassNotFoundException - when a class needed for setting up CompilerConfiguration cannot be foundjava.lang.InstantiationException - when a class needed for setting up CompilerConfiguration cannot be instantiatedjava.lang.IllegalAccessException - when a method needed for setting up CompilerConfiguration cannot be accessedjava.lang.reflect.InvocationTargetException - when a reflection invocation needed for setting up CompilerConfiguration cannot be completed