codeconsole commented on code in PR #16224:
URL: https://github.com/apache/grails-core/pull/16224#discussion_r3907143224
##########
grails-beans-dsl/src/main/java/org/grails/compiler/beans/GrailsBeansASTTransformation.java:
##########
@@ -324,9 +339,27 @@ private ClassNode createAutoConfigurationSibling(ClassNode
pluginClass, Annotati
sibling.addAnnotations(siblingAnnotations);
pluginClass.getAnnotations().removeAll(siblingAnnotations);
+ // The name is settled here and nowhere else.
+
pluginClass.putNodeMetaData(GENERATED_AUTO_CONFIGURATION_NAME_METADATA,
siblingName);
Review Comment:
Dropped in 4c0bd13, both the write and the constant. There was no tooling
hook intended - it existed only to carry the name to the global transform,
which stopped reading it.
##########
grails-beans-dsl/src/test/groovy/org/grails/compiler/beans/AutoConfigurationImportsWriterSpec.groovy:
##########
@@ -0,0 +1,356 @@
+/*
+ * 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.
+ */
+package org.grails.compiler.beans
+
+import org.codehaus.groovy.ast.ClassNode
+import org.codehaus.groovy.classgen.GeneratorContext
+import org.codehaus.groovy.control.CompilationUnit
+import org.codehaus.groovy.control.CompilerConfiguration
+import org.codehaus.groovy.control.Phases
+import org.codehaus.groovy.control.SourceUnit
+import org.codehaus.groovy.control.SourceUnit
Review Comment:
Removed in 4c0bd13. Mine, added with the Groovy-Eclipse mechanism test
without checking what was already imported.
##########
grails-core/src/test/groovy/org/grails/compiler/injection/GlobalGrailsClassInjectorTransformationSpec.groovy:
##########
@@ -349,6 +349,71 @@ class GlobalGrailsClassInjectorTransformationSpec extends
Specification {
then: "the property is consumed by the transform, unlike the two cases
above"
classNode.getProperty('beans') == null
+
+ and: "the name settled by the local transform is registered at the
global transform's target"
+ new File(targetDir,
+
'META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports').text.trim()
==
+ 'DslBeansAutoConfiguration'
+ }
+
+ void "the implicit beans convention claims the closure of a descriptor
that is not a Plugin"() {
Review Comment:
Added in 4c0bd13, in the shape you describe: a descriptor carrying both
annotations through `compileToFile`, asserting the closure was consumed and the
imports file at the target directory holds `AnnotatedBeansAutoConfiguration`.
Checked it can fail rather than trusting that it passes: suppressing the
registration for that one source makes it fail on both assertions. So it does
pin the entry path, and agreed it cannot discriminate the seeded directory from
the configuration fallback - only Groovy-Eclipse diverges there, and the
mechanism test in the writer specification is what covers that.
--
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]