Skip to content

Commit

Permalink
Merge pull request #277 from groovy/fix-bytecode-check
Browse files Browse the repository at this point in the history
Fix bytecode check condition (closes #276)
  • Loading branch information
keeganwitt authored Sep 28, 2023
2 parents ae9883f + 4e44955 commit f6c1c56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,15 @@ protected synchronized void doCompile(final Set<File> sources, final List classp
logPluginClasspath();
classWrangler.logGroovyVersion(mojoExecution.getMojoDescriptor().getGoal());

if (groovyVersionSupportsAction() && !skipBytecodeCheck) {
verifyGroovyVersionSupportsTargetBytecode();
} else {
if (!groovyVersionSupportsAction()) {
getLog().error("Your Groovy version (" + classWrangler.getGroovyVersionString() + ") doesn't support compilation. The minimum version of Groovy required is " + minGroovyVersion + ". Skipping compiling.");
return;
}

if (!skipBytecodeCheck) {
verifyGroovyVersionSupportsTargetBytecode();
}

// get classes we need with reflection
Class<?> compilerConfigurationClass = classWrangler.getClass("org.codehaus.groovy.control.CompilerConfiguration");
Class<?> compilationUnitClass = classWrangler.getClass("org.codehaus.groovy.control.CompilationUnit");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,15 @@ protected synchronized void doStubGeneration(final Set<File> stubSources, final
logPluginClasspath();
classWrangler.logGroovyVersion(mojoExecution.getMojoDescriptor().getGoal());

if (groovyVersionSupportsAction() && !skipBytecodeCheck) {
verifyGroovyVersionSupportsTargetBytecode();
} else {
if (!groovyVersionSupportsAction()) {
getLog().error("Your Groovy version (" + classWrangler.getGroovyVersionString() + ") doesn't support stub generation. The minimum version of Groovy required is " + minGroovyVersion + ". Skipping stub generation.");
return;
}

if (!skipBytecodeCheck) {
verifyGroovyVersionSupportsTargetBytecode();
}

// get classes we need with reflection
Class<?> compilerConfigurationClass = classWrangler.getClass("org.codehaus.groovy.control.CompilerConfiguration");
Class<?> javaStubCompilationUnitClass = classWrangler.getClass("org.codehaus.groovy.tools.javac.JavaStubCompilationUnit");
Expand Down

0 comments on commit f6c1c56

Please sign in to comment.