The GitHub Actions job "CI" on grails-core.git/spike/grails-beans-dsl has 
succeeded.
Run started by GitHub user codeconsole (triggered by codeconsole).

Head commit for run:
a8a12d5d5a92ae469406cbceba9aaff6cd4704d0 / Scott Murphy Heiberg 
<[email protected]>
Add @GrailsBeans: compile a bean-wiring DSL into real @AutoConfiguration classes

Plugin.beanRegistrar() (#15994) plus the before-autoconfiguration
retiming (#15934) already give Grails a Spring-native,
statically-compilable bean-registration mechanism that runs before
Boot evaluates its @ConditionalOnMissingBean defaults. That solves
bean registration winning against Boot's own conditional defaults,
but beanRegistrar() output is inserted as a single hard cut point
ahead of all Boot auto-configuration, ordered only relative to other
Grails plugins by name. It has no way to express "run before this
specific @AutoConfiguration but after that one" the way a real
@AutoConfiguration(before = ..., after = ...) class can, against any
other auto-configuration on the classpath, Grails-authored or
third-party.

@GrailsBeans closes that gap: a Groovy AST transformation compiles a
doWithSpring()-style `beans = { bean(Type[, "name"]) { ... } }`
closure into public @Bean factory methods on a plain
@AutoConfiguration class, with `.conditionalOnMissingBean(Type...)`
chaining and typed closure parameters becoming constructor-style
method parameters. No closures, and nothing DSL-specific, survive
into the compiled bytecode.

Because the result is an ordinary @AutoConfiguration class, it must
be registered in 
META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
like any other. Rather than hand-maintaining that file, this adds
org.apache.grails.buildsrc.autoconfiguration-imports, a build-logic
convention plugin that generates it by scanning a module's own
compiled classes for @AutoConfiguration - the same way
META-INF/grails-plugin.xml is already generated from scanned
*GrailsPlugin classes elsewhere in this build.

- grails-beans-dsl: the @GrailsBeans annotation (grails.compiler.beans,
  alongside grails.compiler.GrailsCompileStatic) and
  GrailsBeansASTTransformation, with unit tests covering every
  generated-bytecode behaviour and every malformed-DSL error path.
- grails-beans-dsl-example: a worked example (Greeter / FancyGreeter /
  LoudGreeter), including an end-to-end test that boots a bare
  @EnableAutoConfiguration application with zero explicit reference to
  the example class and confirms the beans are discovered purely from
  the generated imports file.
- build-logic: the autoconfiguration-imports convention plugin, with
  fixture-compiling unit tests of its own.
- grails-doc: documents @GrailsBeans alongside the existing
  beanRegistrar()/doWithSpring coverage, explaining when to reach for
  each.

Report URL: https://github.com/apache/grails-core/actions/runs/29704789172

With regards,
GitHub Actions via GitBox

Reply via email to