jdaugherty commented on code in PR #15382:
URL: https://github.com/apache/grails-core/pull/15382#discussion_r2872314440
##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsExtension.groovy:
##########
@@ -106,6 +106,15 @@ class GrailsExtension {
this.indy.set(enabled)
}
+ /**
+ * Preserve method parameter names in .class files
+ * This would make grails to not have to specify '@qualifier' for wiring
by name.
Review Comment:
This doesn't make sense since class names are not lowered case. I'd suggest
something like this:
Keep class file parameter names so autowire by name can be supported without
additional annotations such as '@Qualifier'.
##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy:
##########
@@ -228,10 +228,14 @@ class GrailsGradlePlugin implements Plugin<Project> {
// Configure indy and log status after evaluation so user's grails { }
block has been applied
project.afterEvaluate {
- boolean indyEnabled = grailsExtension?.indy?.getOrElse(false) ?:
false
+ boolean indyEnabled = grailsExtension.indy?.getOrElse(false) ?:
false
+ boolean preserveParameterNames =
grailsExtension.preserveParameterNames
Review Comment:
This needs to do what the above line does - support the property syntax
##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsExtension.groovy:
##########
@@ -106,6 +106,15 @@ class GrailsExtension {
this.indy.set(enabled)
}
+ /**
+ * Preserve method parameter names in .class files
+ * This would make grails to not have to specify '@qualifier' for wiring
by name.
+ * Additionally enables better IDE code completion for method parameters,
reflection-based tools, bean introspection, etc.).
+ * Corresponds to groovyc `-parameters`.
+ * Default: true (See #13028)
+ */
+ boolean preserveParameterNames = true
Review Comment:
This must be a Property<Boolean> to support lazy configuration.
##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsExtension.groovy:
##########
@@ -106,6 +106,15 @@ class GrailsExtension {
this.indy.set(enabled)
}
+ /**
+ * Preserve method parameter names in .class files
+ * This would make grails to not have to specify '@qualifier' for wiring
by name.
+ * Additionally enables better IDE code completion for method parameters,
reflection-based tools, bean introspection, etc.).
Review Comment:
Just remove the rest of these comments.
##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy:
##########
@@ -228,10 +228,14 @@ class GrailsGradlePlugin implements Plugin<Project> {
// Configure indy and log status after evaluation so user's grails { }
block has been applied
project.afterEvaluate {
- boolean indyEnabled = grailsExtension?.indy?.getOrElse(false) ?:
false
+ boolean indyEnabled = grailsExtension.indy?.getOrElse(false) ?:
false
+ boolean preserveParameterNames =
grailsExtension.preserveParameterNames
+
project.tasks.withType(GroovyCompile).configureEach {
GroovyCompile c ->
c.groovyOptions.optimizationOptions.indy = indyEnabled
+ c.groovyOptions.parameters = preserveParameterNames
Review Comment:
Only set the value if it's true.
--
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]