Skip to content

Commit f6c1c56

Browse files
authored
Merge pull request #277 from groovy/fix-bytecode-check
Fix bytecode check condition (closes #276)
2 parents ae9883f + 4e44955 commit f6c1c56

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/main/java/org/codehaus/gmavenplus/mojo/AbstractCompileMojo.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,15 @@ protected synchronized void doCompile(final Set<File> sources, final List classp
337337
logPluginClasspath();
338338
classWrangler.logGroovyVersion(mojoExecution.getMojoDescriptor().getGoal());
339339

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

345+
if (!skipBytecodeCheck) {
346+
verifyGroovyVersionSupportsTargetBytecode();
347+
}
348+
347349
// get classes we need with reflection
348350
Class<?> compilerConfigurationClass = classWrangler.getClass("org.codehaus.groovy.control.CompilerConfiguration");
349351
Class<?> compilationUnitClass = classWrangler.getClass("org.codehaus.groovy.control.CompilationUnit");

src/main/java/org/codehaus/gmavenplus/mojo/AbstractGenerateStubsMojo.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,15 @@ protected synchronized void doStubGeneration(final Set<File> stubSources, final
295295
logPluginClasspath();
296296
classWrangler.logGroovyVersion(mojoExecution.getMojoDescriptor().getGoal());
297297

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

303+
if (!skipBytecodeCheck) {
304+
verifyGroovyVersionSupportsTargetBytecode();
305+
}
306+
305307
// get classes we need with reflection
306308
Class<?> compilerConfigurationClass = classWrangler.getClass("org.codehaus.groovy.control.CompilerConfiguration");
307309
Class<?> javaStubCompilationUnitClass = classWrangler.getClass("org.codehaus.groovy.tools.javac.JavaStubCompilationUnit");

0 commit comments

Comments
 (0)