Skip to content

Commit

Permalink
Merge pull request #313 from groovy/revert-310-remove-groovy-4-optimi…
Browse files Browse the repository at this point in the history
…zation-options

Revert "Don't try to set optimization options on Groovy 4.x"
  • Loading branch information
keeganwitt authored Oct 2, 2024
2 parents d7c6845 + bf4d30e commit f5b688b
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 && 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()) {
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) && 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<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 f5b688b

Please sign in to comment.