jamesfredley commented on code in PR #16178:
URL: https://github.com/apache/grails-core/pull/16178#discussion_r3817833968
##########
build-logic/docs-core/build.gradle:
##########
@@ -71,6 +71,13 @@ sourceSets {
}
}
+// docs-core does not apply org.apache.grails.buildsrc.compile. Keep the same
+// Grails 8 default (indy off) as CompilePlugin. See #15293.
+tasks.withType(GroovyCompile).configureEach {
+ groovyOptions.optimizationOptions.indy = project.hasProperty('grailsIndy')
&&
+ Boolean.parseBoolean(project.property('grailsIndy') as String)
+}
Review Comment:
Done in 2a534f30e9. Every grailsIndy parse site now uses
toString().trim().toBoolean(), matching GradleUtils.lookupProperty. build-logic
applies the shared gradle/groovy-indy.gradle instead of a local
Boolean.parseBoolean copy. CompilePluginSpec covers -PgrailsIndy with
surrounding whitespace.
##########
gradle/groovy-indy.gradle:
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Grails 8 keeps invokedynamic off. Groovy 5's compiler default is indy=true,
+// which is a large runtime regression for dynamic Groovy (see #15293).
+// Applied from each independent build (grails-core, grails-gradle,
grails-forge)
+// so modules that never apply the Grails Gradle plugin still inherit this.
+// Grails 9 / Groovy 6 can flip the default. CI can still opt in with
-PgrailsIndy=true.
+boolean grailsIndyEnabled = false
+if (project.hasProperty('grailsIndy')) {
+ grailsIndyEnabled = Boolean.parseBoolean(project.property('grailsIndy') as
String)
+}
Review Comment:
Done in 2a534f30e9. gradle/groovy-indy.gradle now uses
toString().trim().toBoolean() so -PgrailsIndy=" true " matches CompilePlugin.
##########
build-logic/plugins/build.gradle:
##########
@@ -57,6 +57,13 @@ tasks.named('test') {
useJUnitPlatform()
}
+// This project compiles CompilePlugin itself, so it cannot apply that plugin.
+// Keep the same Grails 8 default (indy off) as CompilePlugin. See #15293.
+tasks.withType(GroovyCompile).configureEach {
+ groovyOptions.optimizationOptions.indy = project.hasProperty('grailsIndy')
&&
+ Boolean.parseBoolean(project.property('grailsIndy') as String)
+}
Review Comment:
Done in 2a534f30e9. This module now applies the shared
gradle/groovy-indy.gradle instead of a local Boolean.parseBoolean copy, so
trimming matches CompilePlugin.
##########
gradle/grails-extension-gradle-config.gradle:
##########
@@ -35,6 +35,8 @@ grails {
// Allow CI to toggle Groovy invokedynamic (indy) via -PgrailsIndy=true
// This enables testing functional tests with both indy enabled and
disabled.
// See: https://github.com/apache/grails-core/issues/15321
+ // Framework modules that do not apply this plugin inherit the same default
+ // from org.apache.grails.buildsrc.compile (CompilePlugin).
if (project.hasProperty('grailsIndy')) {
indy = Boolean.parseBoolean(project.property('grailsIndy') as String)
Review Comment:
Done in 2a534f30e9. This site now uses toString().trim().toBoolean() as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]