Skip to content

Commit

Permalink
Merge pull request #310 from groovy/remove-groovy-4-optimization-options
Browse files Browse the repository at this point in the history
Don't try to set optimization options on Groovy 4.x
  • Loading branch information
keeganwitt authored Jul 9, 2024
2 parents c317564 + b40b42d commit 5c567ba
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 || groovyAtLeast(GROOVY_4_0_0_ALPHA1)) {
if (invokeDynamic && groovyOlderThan(GROOVY_4_0_0_ALPHA1)) {
if (groovyAtLeast(GROOVY_2_0_0_BETA3)) {
if (classWrangler.isGroovyIndy()) {
if (isJavaSupportIndy()) {
Expand Down Expand Up @@ -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)) {
if ((parallelParsing == null && groovyAtLeast(GROOVY_4_0_0_ALPHA1)) || (parallelParsing != null && parallelParsing)) {
if (groovyAtLeast(GROOVY_3_0_5) && groovyOlderThan(GROOVY_4_0_0_ALPHA1)) {
if (parallelParsing != null && parallelParsing) {
Map<String, Boolean> optimizationOptions = (Map<String, Boolean>) invokeMethod(findMethod(compilerConfigurationClass, "getOptimizationOptions"), compilerConfiguration);
optimizationOptions.put("parallelParse", true);
getLog().info("Parallel parsing enabled.");
Expand Down

0 comments on commit 5c567ba

Please sign in to comment.