From bf4d30e92701a4b98b197a79d23eecb6efe67bd3 Mon Sep 17 00:00:00 2001 From: Keegan Witt Date: Tue, 1 Oct 2024 20:48:11 -0400 Subject: [PATCH] Revert "Don't try to set optimization options on Groovy 4.x" --- .../org/codehaus/gmavenplus/mojo/AbstractCompileMojo.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/codehaus/gmavenplus/mojo/AbstractCompileMojo.java b/src/main/java/org/codehaus/gmavenplus/mojo/AbstractCompileMojo.java index 56950332..6cd770fb 100644 --- a/src/main/java/org/codehaus/gmavenplus/mojo/AbstractCompileMojo.java +++ b/src/main/java/org/codehaus/gmavenplus/mojo/AbstractCompileMojo.java @@ -472,7 +472,7 @@ protected Object setupCompilerConfiguration(final File compileOutputDirectory, f invokeMethod(findMethod(compilerConfigurationClass, "setSourceEncoding", String.class), compilerConfiguration, sourceEncoding); } invokeMethod(findMethod(compilerConfigurationClass, "setTargetDirectory", String.class), compilerConfiguration, compileOutputDirectory.getAbsolutePath()); - if (invokeDynamic && groovyOlderThan(GROOVY_4_0_0_ALPHA1)) { + if (invokeDynamic || groovyAtLeast(GROOVY_4_0_0_ALPHA1)) { if (groovyAtLeast(GROOVY_2_0_0_BETA3)) { if (classWrangler.isGroovyIndy()) { if (isJavaSupportIndy()) { @@ -501,8 +501,8 @@ protected Object setupCompilerConfiguration(final File compileOutputDirectory, f getLog().warn("Requested to use parameters, but your Groovy version (" + classWrangler.getGroovyVersionString() + ") doesn't support it (must be " + GROOVY_2_5_0_ALPHA1 + " or newer). Ignoring parameters parameter."); } } - if (groovyAtLeast(GROOVY_3_0_5) && groovyOlderThan(GROOVY_4_0_0_ALPHA1)) { - if (parallelParsing != null && parallelParsing) { + if (groovyAtLeast(GROOVY_3_0_5)) { + if ((parallelParsing == null && groovyAtLeast(GROOVY_4_0_0_ALPHA1)) || (parallelParsing != null && parallelParsing)) { Map optimizationOptions = (Map) invokeMethod(findMethod(compilerConfigurationClass, "getOptimizationOptions"), compilerConfiguration); optimizationOptions.put("parallelParse", true); getLog().info("Parallel parsing enabled.");