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_2
Groovy 1.8.2 version.
|
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 static Version |
GROOVY_2_1_3
Groovy 2.1.3 version.
|
protected static Version |
GROOVY_2_3_3
Groovy 2.3.3 version.
|
protected static Version |
GROOVY_2_5_3
Groovy 2.5.3 version.
|
protected static Version |
GROOVY_2_5_7
Groovy 2.5.7 version.
|
protected static Version |
GROOVY_2_6_0_ALPHA1
Groovy 2.6.0 alpha-1 version.
|
protected static Version |
GROOVY_2_6_0_ALPHA4
Groovy 2.6.0 alpha-4 version.
|
protected static Version |
GROOVY_3_0_0_ALPHA1
Groovy 3.0.0 alpha-1 version.
|
protected static Version |
GROOVY_3_0_0_ALPHA2
Groovy 3.0.0 alpha-2 version.
|
protected static Version |
GROOVY_3_0_0_ALPHA4
Groovy 3.0.0 alpha-4 version.
|
protected static Version |
GROOVY_3_0_0_BETA1
Groovy 3.0.0 beta-1 version.
|
protected static Version |
GROOVY_3_0_0_BETA2
Groovy 3.0.0 beta-2 version.
|
protected static Version |
GROOVY_3_0_3
Groovy 3.0.3 version.
|
protected static Version |
GROOVY_3_0_6
Groovy 3.0.6 version.
|
protected static Version |
GROOVY_3_0_8
Groovy 3.0.8 version.
|
protected static Version |
GROOVY_4_0_0_ALPHA1
Groovy 4.0.0 alpha-1 version.
|
protected static Version |
GROOVY_4_0_0_ALPHA3
Groovy 4.0.0 alpha-3 version.
|
protected static Version |
GROOVY_4_0_0_BETA1
Groovy 4.0.0 beta-1 version.
|
protected static Version |
GROOVY_4_0_11
Groovy 4.0.11 version.
|
protected static Version |
GROOVY_4_0_16
Groovy 4.0.11 version.
|
protected static Version |
GROOVY_4_0_2
Groovy 4.0.2 version.
|
protected static Version |
GROOVY_4_0_21
Groovy 4.0.21 version.
|
protected static Version |
GROOVY_4_0_24
Groovy 4.0.24 version.
|
protected static Version |
GROOVY_4_0_27
Groovy 4.0.27 version.
|
protected static Version |
GROOVY_4_0_6
Groovy 4.0.6 version.
|
protected static Version |
GROOVY_5_0_0_ALPHA1
Groovy 5.0.0-alpha-1 version.
|
protected static Version |
GROOVY_5_0_0_ALPHA11
Groovy 5.0.0-alpha-11 version.
|
protected static Version |
GROOVY_5_0_0_ALPHA13
Groovy 5.0.0-alpha-13 version.
|
protected static Version |
GROOVY_5_0_0_ALPHA3
Groovy 5.0.0-alpha-3 version.
|
protected static Version |
GROOVY_5_0_0_ALPHA8
Groovy 5.0.0-alpha-8 version.
|
protected IncludeClasspath |
includeClasspath
What classpath to include.
|
protected boolean |
skipBytecodeCheck
Whether to check that the version of Groovy used is able to use the requested
targetBytecode. |
protected String |
sourceEncoding
The encoding of source files.
|
protected 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.
|
MAIN, TESTclassWrangler, GROOVY_1_5_0, GROOVY_SOURCES_PATTERN, JAVA_1_7, JAVA_1_8, JAVA_12, JAVA_SOURCES_PATTERN, minGroovyVersion, mojoExecution, pluginArtifacts, project, session| Constructor and Description |
|---|
AbstractGenerateStubsMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addGroovySources(Set<File> stubSources,
Class<?> compilerConfigurationClass,
Class<?> javaStubCompilationUnitClass,
Object compilerConfiguration,
Object javaStubCompilationUnit)
Adds the Groovy sources to the CompilationUnit.
|
protected void |
doStubGeneration(Set<File> stubSources,
List<?> classpath,
File outputDirectory)
Performs the stub generation on the specified source files.
|
protected void |
logGeneratedStubs(File outputDirectory)
Logs the stubs that have been generated.
|
protected void |
resetStubModifiedDates(Set<File> stubs)
This is a fix for ...
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 Object |
setupCompilerConfiguration(File outputDirectory,
Class<?> compilerConfigurationClass)
Sets up the CompilerConfiguration to use for stub generation.
|
protected boolean |
supportsSettingExtensions()
Determines whether the version of Groovy supports stub generation.
|
protected static String |
translateJavacTargetToTargetBytecode(String targetBytecode) |
protected void |
verifyGroovyVersionSupportsTargetBytecode()
Throws an exception if targetBytecode is not supported with this version of Groovy.
|
getStubs, removeSourceRootgetFiles, getFilesets, getTestFiles, getTestFilesetsgetJavaVersion, getJavaVersionString, groovyAtLeast, groovyIs, groovyNewerThan, groovyOlderThan, groovyVersionSupportsAction, isGroovyIndy, isJavaSupportIndy, isJavaSupportParameters, isJavaSupportPreviewFeatures, logPluginClasspath, setupClassWranglergetLog, getPluginContext, setLog, setPluginContextprotected static final Version GROOVY_5_0_0_ALPHA13
protected static final Version GROOVY_5_0_0_ALPHA11
protected static final Version GROOVY_5_0_0_ALPHA8
protected static final Version GROOVY_5_0_0_ALPHA3
protected static final Version GROOVY_5_0_0_ALPHA1
protected static final Version GROOVY_4_0_27
protected static final Version GROOVY_4_0_24
protected static final Version GROOVY_4_0_21
protected static final Version GROOVY_4_0_16
protected static final Version GROOVY_4_0_11
protected static final Version GROOVY_4_0_6
protected static final Version GROOVY_4_0_2
protected static final Version GROOVY_4_0_0_BETA1
protected static final Version GROOVY_4_0_0_ALPHA3
protected static final Version GROOVY_4_0_0_ALPHA1
protected static final Version GROOVY_3_0_8
protected static final Version GROOVY_3_0_6
protected static final Version GROOVY_3_0_3
protected static final Version GROOVY_3_0_0_BETA2
protected static final Version GROOVY_3_0_0_BETA1
protected static final Version GROOVY_3_0_0_ALPHA4
protected static final Version GROOVY_3_0_0_ALPHA2
protected static final Version GROOVY_3_0_0_ALPHA1
protected static final Version GROOVY_2_6_0_ALPHA4
protected static final Version GROOVY_2_6_0_ALPHA1
protected static final Version GROOVY_2_5_7
protected static final Version GROOVY_2_5_3
protected static final Version GROOVY_2_3_3
protected static final Version GROOVY_2_1_3
protected static final Version GROOVY_1_9_0_BETA1
protected static final Version GROOVY_1_9_0_BETA3
protected static final Version GROOVY_1_8_2
protected static final Version GROOVY_1_8_3
@Parameter(defaultValue="${project.build.sourceEncoding}")
protected String sourceEncoding
@Parameter(property="maven.compiler.target",
defaultValue="1.8")
protected String targetBytecode
@Parameter(property="skipBytecodeCheck",
defaultValue="false")
protected boolean skipBytecodeCheck
targetBytecode.@Parameter(defaultValue="false") protected boolean debug
@Parameter(defaultValue="false") protected boolean verbose
@Parameter(defaultValue="1") protected int warningLevel
@Parameter(defaultValue="0") protected int tolerance
@Parameter(defaultValue="PROJECT_ONLY") protected IncludeClasspath includeClasspath
protected void doStubGeneration(Set<File> stubSources, List<?> classpath, File outputDirectory) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException, InstantiationException, MalformedURLException
stubSources - the sources to perform stub generation onclasspath - The classpath to use for compilationoutputDirectory - the directory to write the stub files toClassNotFoundException - when a class needed for stub generation cannot be foundInstantiationException - when a class needed for stub generation cannot be instantiatedIllegalAccessException - when a method needed for stub generation cannot be accessedInvocationTargetException - when a reflection invocation needed for stub generation cannot be completedMalformedURLException - when a classpath element provides a malformed URLprotected Object setupCompilerConfiguration(File outputDirectory, Class<?> compilerConfigurationClass) throws InvocationTargetException, IllegalAccessException, InstantiationException
outputDirectory - the directory to write the stub files tocompilerConfigurationClass - the CompilerConfiguration classInstantiationException - when a class needed for stub generation cannot be instantiatedIllegalAccessException - when a method needed for stub generation cannot be accessedInvocationTargetException - when a reflection invocation needed for stub generation cannot be completedprotected void addGroovySources(Set<File> stubSources, Class<?> compilerConfigurationClass, Class<?> javaStubCompilationUnitClass, Object compilerConfiguration, Object javaStubCompilationUnit) throws InvocationTargetException, 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 generationIllegalAccessException - when a method needed for stub generation cannot be accessedInvocationTargetException - when a reflection invocation needed for stub generation cannot be completedprotected boolean supportsSettingExtensions()
true if the version of Groovy supports stub generation, false otherwiseprotected void logGeneratedStubs(File outputDirectory)
outputDirectory - the output directory for the stubsprotected void resetStubModifiedDates(Set<File> stubs)
stubs - the files on which to reset the modified dateprotected void verifyGroovyVersionSupportsTargetBytecode()
Copyright © 2011–2025. All rights reserved.