The GitHub Actions job "Code Style" on grails-core.git/grails8-groovy5-sb4 has 
succeeded.
Run started by GitHub user jamesfredley (triggered by jamesfredley).

Head commit for run:
ff5d97284cf7daaa9d7900669bdaea18ab578bb2 / James Fredley 
<[email protected]>
Restore grails.plugin.json.builder deprecation shims for Groovy 5 build

The `grails-views-gson:compileGroovy` task failed with
`unable to resolve class 
grails.plugin.json.builder.StreamingJsonBuilder.StreamingJsonDelegate`
at JsonViewWritableScript.groovy:77 and :88 (and other references in
DefaultHalViewHelper.groovy).

Root cause:

- Commit 2110c45f36 ("refactor!: remove deprecated classes and methods")
  deleted the deprecated Grails-prefixed `grails.plugin.json.builder`
  classes (StreamingJsonBuilder, JsonGenerator, DefaultJsonGenerator),
  leaving only `JsonOutput.java`.
- Commit 153e14c5ad ("fix: cherry-pick Groovy 5 fixes from Groovy 6
  canary branch") then rewrote JsonViewWritableScript.groovy and
  DefaultHalViewHelper.groovy to use the fully-qualified
  `grails.plugin.json.builder.StreamingJsonBuilder.StreamingJsonDelegate`
  type (and matching return types), matching what the canary branch
  uses. However, the actual class file was not cherry-picked along
  with the references, so the groovy compiler cannot resolve the type.

The canary branch (origin/grails8-groovy6-canary) still carries the
three deprecated shim classes. They are minimal (70-110 lines each) and
simply extend the Groovy counterparts so that existing Grails code that
references the old qualified names keeps compiling and behaving
correctly against Groovy 5.

Restore the three files verbatim from the canary branch:

- grails.plugin.json.builder.StreamingJsonBuilder (extends
  `groovy.json.StreamingJsonBuilder`, overrides `call(Closure)` to use
  the Grails `StreamingJsonDelegate` that routes through
  `grails.plugin.json.builder.JsonOutput`'s OPEN_BRACE/CLOSE_BRACE
  constants, and exposes a nested `StreamingJsonDelegate` subclass
  with `cloneDelegateAndGetContent(...)` helper).
- grails.plugin.json.builder.JsonGenerator (deprecated interface that
  extends `groovy.json.JsonGenerator` plus nested `Converter` /
  `Options` shims).
- grails.plugin.json.builder.DefaultJsonGenerator (deprecated class
  that extends `groovy.json.DefaultJsonGenerator`).

Local verification: `./gradlew build -x test -x groovydoc -x javadoc
-x codenarcMain -x codenarcTest -x codenarcAst -x codenarcIntegrationTest
-x checkstyleMain -x checkstyleTest -x checkstyleAst -PskipTests` now
completes successfully (1254 actionable tasks). Only harmless
self-deprecation warnings remain, which is expected for these
forRemoval=true shims.

Assisted-by: claude-code:claude-opus-4-7

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

With regards,
GitHub Actions via GitBox

Reply via email to