Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
76c0cc3
Report a partly DSL-shaped beans block instead of dropping it
codeconsole Sep 1, 2026
942cce5
Reject a sibling bean call that cannot return the singleton
codeconsole Sep 1, 2026
dedfe26
Document parameter annotations, and cover the optional-dependency case
codeconsole Sep 1, 2026
4ec20d1
Add .typeArguments(...) so a declared type can carry type arguments
codeconsole Sep 1, 2026
2aabf4b
Pin annotate's array-valued attributes, which only the docs disclaimed
codeconsole Sep 1, 2026
a0c90c9
Stop the sibling-bean check at a nested closure
codeconsole Sep 1, 2026
6509f29
Fail a stray beans statement on a plugin descriptor too
codeconsole Sep 1, 2026
683432b
Fix checkstyle import order and codenarc UnnecessaryGString violations
codeconsole Sep 1, 2026
97ae226
Merge branch '8.0.x' into feat/beans-dsl-diagnostics-8.0.x
codeconsole Sep 2, 2026
c2768dd
Check static sibling bean calls on a proxied host too
codeconsole Sep 3, 2026
6fbfd28
Only record an annotation type in visited when descending into it
codeconsole Sep 3, 2026
5a08d84
Merge remote-tracking branch 'origin/feat/beans-dsl-diagnostics-8.0.x…
codeconsole Sep 3, 2026
e49a39e
Merge branch '8.0.x' into feat/beans-dsl-diagnostics-8.0.x
codeconsole Sep 3, 2026
e27cb9b
beans DSL: declare a bean as its interface and still construct it
codeconsole Sep 3, 2026
b1c0c42
beans DSL: infer type arguments from what the bean constructs
codeconsole Sep 3, 2026
bf31c48
beans DSL: reach @Bean's own attributes instead of colliding with it
codeconsole Sep 3, 2026
9d685b9
beans DSL: reject a post-processor bean that is not staticMethod()
codeconsole Sep 3, 2026
8f30584
beans DSL: condition a bean on the Grails environment
codeconsole Sep 3, 2026
910dc72
Dump the generated members to a directory on request
codeconsole Sep 4, 2026
2867e4d
Resolve sibling bean calls against hand-written @Bean methods too
codeconsole Sep 4, 2026
4a572c7
Document the one-expression form for a property-configured bean
codeconsole Sep 4, 2026
5ea9efe
Add .conditionalOnBean(...), the positive counterpart
codeconsole Sep 4, 2026
1690234
Derive the set of all qualifier names instead of restating it
codeconsole Sep 4, 2026
8f8e86a
Let every condition qualifier tell same-named beans apart
codeconsole Sep 4, 2026
507dd2c
Add .conditionalOnProperty(...), the condition applications actually use
codeconsole Sep 4, 2026
b8a8d00
Rename .grailsEnv(...) to .conditionalOnGrailsEnv(...)
codeconsole Sep 4, 2026
69c5de6
Add .conditionalOnExpression(...), for what the others cannot say
codeconsole Sep 4, 2026
fb07669
Give the DSL reference structure, and say a block can be split
codeconsole Sep 4, 2026
85b1417
Order the java.io imports, which checkstyleMain rejects
codeconsole Sep 4, 2026
0a91ed9
Merge into any qualifier-attached annotation, not only @Bean
codeconsole Sep 4, 2026
e0f99fc
Add .aliases(...), so a bean can keep an old name
codeconsole Sep 4, 2026
4959bf4
Let .scope(...) take the annotation's other attributes
codeconsole Sep 4, 2026
7df2280
Re-home anonymous inner classes in a lifted body
codeconsole Sep 4, 2026
6e32b25
Set originType when re-homing an anonymous inner class
codeconsole Sep 4, 2026
a2603b0
Add .conditionalOnClass(...), the condition optional integrations are…
codeconsole Sep 4, 2026
3c498eb
Take a compile-time String constant as a member name
codeconsole Sep 4, 2026
41d3665
Add group(...), the nested conditionally-guarded configuration class
codeconsole Sep 4, 2026
1085bed
Merge branch '8.0.x' into feat/beans-dsl-diagnostics-8.0.x
codeconsole Sep 4, 2026
e45b3a2
Merge branch '8.0.x' into feat/beans-dsl-diagnostics-8.0.x
codeconsole Sep 5, 2026
c4cadbb
Stop asserting an ordering @ConditionalOnBean does not guarantee
codeconsole Sep 6, 2026
f7d22ce
Fall back rather than throw when Grails cannot answer
codeconsole Sep 7, 2026
cf68805
Document the new DSL surface in the user guide
codeconsole Sep 7, 2026
a488d6a
Merge branch '8.0.x' into feat/beans-dsl-diagnostics-8.0.x
codeconsole Sep 8, 2026
902f082
Fix three defects the new forms introduced, and pin what was missing
codeconsole Sep 8, 2026
6663088
Reject an anonymous class reaching a member that moved to the sibling
codeconsole Sep 8, 2026
9b266f4
Merge branch '8.0.x' into feat/beans-dsl-diagnostics-8.0.x
codeconsole Sep 9, 2026
4c01501
Merge branch '8.0.x' into feat/beans-dsl-diagnostics-8.0.x
codeconsole Sep 9, 2026
67d20dc
Give a lifted anonymous class an enclosing method
codeconsole Sep 9, 2026
191830e
Run the anonymous-class reach check for a group too
codeconsole Sep 9, 2026
635f284
Count a property-style read as a use of the moved accessor
codeconsole Sep 9, 2026
55fa461
Set the enclosing method on nested-closure anonymous classes too
codeconsole Sep 10, 2026
4fe4570
Catch every spelling of a reference the anonymous class cannot reach
codeconsole Sep 10, 2026
b952b27
Reach: one rule for both host kinds, and the runtime's own resolution
codeconsole Sep 10, 2026
5615328
Repair an anonymous class in a closure parameter default too
codeconsole Sep 10, 2026
c4546d2
Make the reach check follow the lift exactly
codeconsole Sep 10, 2026
0c25aef
Stop the reach check at closures, and let both field spellings agree
codeconsole Sep 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,33 @@
* attributes but rejecting {@code name:} and types), {@code .primary()}, {@code .lazy()},
* {@code .scope("name")}, {@code .staticMethod()} (a {@code static} factory method - Spring's
* recommended shape for {@code BeanFactoryPostProcessor}/{@code BeanPostProcessor} beans, which
* must be creatable without instantiating their declaring configuration class), and (repeatably)
* must be creatable without instantiating their declaring configuration class),
* {@code .typeArguments(Type, ...)} (type arguments for the declared type -
* {@code bean("auditorAware", AuditorAware).typeArguments(String)} declares
* {@code AuditorAware<String>}, which matters because Spring resolves an injection point by its
* full generic type and the type in {@code bean(...)} is a class literal, on which Groovy has no
* syntax for writing them), and (repeatably)
* {@code .annotate(AnnotationType[, attr: value, ...])} - the last a generic escape hatch
* attaching any other single-valued annotation. The closure body becomes the generated method's
* attaching any other annotation, with as many attributes as it declares; an array-valued one
* takes either a list or a single value that widens into a one-element array, exactly as it would
* written out ({@code .annotate(DependsOn, value: "other")}). The closure body becomes the generated method's
* body verbatim, and closure parameters become the generated method's parameters (for
* constructor-style bean injection). The generated method's name is an implementation detail:
* constructor-style bean injection) - annotations and all, so anything Spring reads off an
* injection point can be written on the parameter that receives it: {@code @Qualifier} to pick
* between candidates, {@code @Value} for a config property, and
* {@code @Autowired(required = false)} for a dependency that may not be there, which is the
* only way to say "inject this if some other module supplied it" - e.g.
* {@code bean('smsSender', SmsSender) { @Autowired(required = false) SmsTransport t -> ... }}.
* The generated method's name is an implementation detail:
* Spring resolves the bean by its {@code @Bean("name")} value, so a bean name that isn't a valid
* Java identifier (e.g. {@code "my-service"}) simply gets a synthesized {@code <type>$N} method
* name behind the scenes. The same bean name may even be declared by more than one
* {@code bean(...)} statement - the standard Spring Boot pattern for mutually exclusive variants
* of one bean - provided every declaration with the name carries its own discriminating
* condition (e.g. {@code .annotate(ConditionalOnProperty, ...)}) so that at most one of them
* registers at runtime.</li>
* <li>{@code field(["name", ] Type)}, optionally chained with {@code .value(...)} and/or
* <li>{@code field(["name", ] Type)}, optionally chained with {@code .value(...)},
* {@code .typeArguments(Type, ...)} and/or
* (repeatably) {@code .annotate(AnnotationType[, attr: value, ...])}. Declares a private field on
* the generated class, for state shared across bean methods. The usual case is injected
* configuration: {@code field("encoding", String).value(Settings.GSP_VIEW_ENCODING, "UTF-8")}
Expand All @@ -70,8 +84,8 @@
* takes a bare config key with no default ({@code .value("app.encoding")} compiles to
* {@code @Value("${app.encoding}")}), while a string already containing a {@code ${...}}
* placeholder or {@code #{...}} SpEL expression passes through verbatim.</li>
* <li>{@code method(["name", ] Type) { ... }}, chainable with {@code .annotate(...)} only
* ({@code .value(...)} is field-specific).
* <li>{@code method(["name", ] Type) { ... }}, chainable with {@code .annotate(...)} and
* {@code .typeArguments(...)} only ({@code .value(...)} is field-specific).
* Declares a private helper method on the generated class, for logic shared across bean methods,
* lifted from the closure the same way {@code bean(...)} is.</li>
* </ul>
Expand Down
Loading
Loading