public abstract class AbstractGenerateStubsMojo extends AbstractGroovyStubSourcesMojo
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
debug
Whether Groovy compiler should be set to debug.
|
protected static Version |
GROOVY_1_8_3
Groovy 1.8.3 version.
|
protected static Version |
GROOVY_1_9_0_BETA1
Groovy 2.9.0 beta-1 version.
|
protected static Version |
GROOVY_1_9_0_BETA3
Groovy 1.9.0 beta-3 version.
|
protected java.util.Set<java.lang.String> |
scriptExtensions
The file extensions of Groovy source files.
|
protected java.lang.String |
sourceEncoding
The encoding of source files.
|
protected java.lang.String |
targetBytecode
The Groovy compiler bytecode compatibility.
|
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.
|
stubsOutputDirectory, testStubsOutputDirectoryMAIN, 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 |
|---|
AbstractGenerateStubsMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addGroovySources(java.util.Set<java.io.File> stubSources,
java.lang.Class compilerConfigurationClass,
java.lang.Class javaStubCompilationUnitClass,
java.lang.Object compilerConfiguration,
java.lang.Object javaStubCompilationUnit)
Adds the Groovy sources to the CompilationUnit.
|
protected void |
doStubGeneration(java.util.Set<java.io.File> stubSources,
java.util.List classpath,
java.io.File outputDirectory)
Performs the stub generation on the specified source files.
|
protected void |
resetStubModifiedDates(java.util.Set<java.io.File> stubs)
This is a fix for http://jira.codehaus.org/browse/MGROOVY-187
It modifies the dates of the created stubs to 1/1/1970, ensuring that
the Java compiler will not overwrite perfectly good compiled Groovy
just because it has a newer source stub.
|
protected java.lang.Object |
setupCompilerConfiguration(java.io.File outputDirectory,
java.lang.Class compilerConfigurationClass)
Sets up the CompilerConfiguration to use for stub generation.
|
getStubs, getTestStubsgetFiles, getFilesets, getSourceRoots, getSourceRoots, getSources, getSources, getTestSourceRoots, getTestSourceRoots, getTestSources, getTestSources, setSources, setTestSourcesgetJavaVersion, getJavaVersionString, groovyVersionSupportsAction, isJavaSupportIndy, logPluginClasspathgetLog, getPluginContext, setLog, setPluginContextprotected static final Version GROOVY_1_9_0_BETA1
protected static final Version GROOVY_1_9_0_BETA3
protected static final Version GROOVY_1_8_3
protected java.lang.String sourceEncoding
protected java.util.Set<java.lang.String> scriptExtensions
protected java.lang.String targetBytecode
protected boolean debug
protected boolean verbose
protected int warningLevel
protected int tolerance
protected void doStubGeneration(java.util.Set<java.io.File> stubSources,
java.util.List classpath,
java.io.File outputDirectory)
throws java.lang.ClassNotFoundException,
java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
java.net.MalformedURLException
stubSources - the sources to perform stub generation onclasspath - The classpath to use for compilationoutputDirectory - the directory to write the stub files tojava.lang.ClassNotFoundException - when a class needed for stub generation cannot be foundjava.lang.InstantiationException - when a class needed for stub generation cannot be instantiatedjava.lang.IllegalAccessException - when a method needed for stub generation cannot be accessedjava.lang.reflect.InvocationTargetException - when a reflection invocation needed for stub generation cannot be completedjava.net.MalformedURLException - when a classpath element provides a malformed URLprotected java.lang.Object setupCompilerConfiguration(java.io.File outputDirectory,
java.lang.Class compilerConfigurationClass)
throws java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
outputDirectory - the directory to write the stub files tocompilerConfigurationClass - the CompilerConfiguration classjava.lang.InstantiationException - when a class needed for stub generation cannot be instantiatedjava.lang.IllegalAccessException - when a method needed for stub generation cannot be accessedjava.lang.reflect.InvocationTargetException - when a reflection invocation needed for stub generation cannot be completedprotected void addGroovySources(java.util.Set<java.io.File> stubSources,
java.lang.Class compilerConfigurationClass,
java.lang.Class javaStubCompilationUnitClass,
java.lang.Object compilerConfiguration,
java.lang.Object javaStubCompilationUnit)
throws java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException
stubSources - the sources to perform stub generation oncompilerConfigurationClass - the CompilerConfiguration classjavaStubCompilationUnitClass - the JavaStubCompilationUnit classcompilerConfiguration - the CompilerConfiguration to use for stub generationjavaStubCompilationUnit - the JavaStubCompilationUnit to use for stub generationjava.lang.IllegalAccessException - when a method needed for stub generation cannot be accessedjava.lang.reflect.InvocationTargetException - when a reflection invocation needed for stub generation cannot be completedprotected void resetStubModifiedDates(java.util.Set<java.io.File> stubs)
stubs - the files on which to reset the modified date