Repository navigation
Upgrade to Groovy 6.0.0 - #484
Merged
Merged
Conversation
Fix the Groovy 6 source incompatibilities (val keyword, yield in switch expression block arms, unqualified enum case labels, stricter static type inference), align the BOM and smile consumer test pins, update Groovy versions in READMEs and tutorials, and document the pitfalls in the style guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Raise the Matrix static initializer minimum to Groovy 6 so Groovy 5 users get a clear error instead of a later NoSuchMethodError, update remaining "targets Groovy 5" statements, and correct the style guide note on unqualified enum case labels under @CompileStatic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Note the Groovy 6 runtime requirement in every published module's next release section, move the release-tools CI Groovy CLI to 6.0.0, and fix staged-settings.groovy, whose `as Node` coercion of find() results throws on Groovy 6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the note from matrix-logging, state the Groovy 6 requirement for matrix-groovy-ext without the Matrix-specific failure modes, and give the BOM a consumer-facing dependency note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the build from Groovy 5.1.3 to 6.0.0 and fixes the source incompatibilities Groovy 6 exposed. All source fixes also compile on Groovy 5.1.3.
Breaking for consumers: artifacts compiled with Groovy 6 require a Groovy 6 runtime. Statically compiled call sites bind to new Groovy 6 overloads (e.g.
DefaultGroovyMethods.getAt(Map, String)), which throwNoSuchMethodErroron Groovy 5. TheMatrixstatic initializer now rejects Groovy < 6 with a clearIllegalStateException; code paths that do not loadMatrix(e.g.Stat.frequency(List)) may still fail withNoSuchMethodErroron Groovy 5. The published modules' next-release sections note the requirement.Source fixes
matrix-coreValueConvertervalis now a keyword;val / xlexed as a slashy string (reported as a misleading "Missing ')'" at line 116)intdivmatrix-coreValueConverterdefault -> try {…}not allowed in switch expressionsyieldin both branchesmatrix-chartsMapCoordyieldyield 'identity'matrix-statsNormalizecase LOG ->rejected at compile time (on Groovy 5 it worked under@CompileStatic, only dynamic code threwMissingPropertyException)case Normalization.LOG ->matrix-chartsWktReader,matrix-ggplotGgCharmMappingRegistrydefault -> nullarm infersObjectnullto the target typematrix-gsheetsGsUtil,matrix-spreadsheetSpreadsheetUtilchararithmetic now inferred asNumberintcastsmatrix-gsheetsGsUtilLong/BigIntegerternary no longer typedBigIntegermatrix-statsAccuracydeflocals mutated in a closure inferred asNumberBigDecimalmatrix-statsFormulaModelFrameTestputAtVersion pins and docs
gradle/libs.versions.toml: Groovy 6.0.0matrix-bom/pom.xmlgroovy.version5.1.2 → 6.0.0;BomResolutionITruntime assertion updatedmatrix-smile/src/test/consumer/build.gradle→ 6.0.0docs/tutorial/*,AGENTS.md,matrix-bom/api-coverage.mdreadme.md,docs/tutorial/1-introduction.md,docs/tutorial/2-matrix-core.md,docs/cookbook/matrix-core.md,matrix-smile/README.mdMatrixruntime version check: minimum raised from Groovy 5 to 6docs/agents/groovy-style-guide.mdMatrix-specific failure modes; matrix-bom tells consumers to declare Groovy 6.0.0+) (new "(unreleased)" sections added, using thebuild.gradlesnapshot version, where the top section was already released)Release tooling
.github/workflows/release-all-tools.yml: release CLIgroovy,groovy-json,groovy-xml5.1.1 → 6.0.0scripts/release-all/staged-settings.groovy:find { … } as Nodethrows on Groovy 6 (the newXmlExtensions.asTypetries to construct aNode), which the catch block reported as a generic "Cannot prepare isolated Maven settings" error. Replaced with(Node)casts; verified on Groovy 5.1.3 and 6.0.0.Modules touched: matrix-core, matrix-stats, matrix-charts, matrix-ggplot, matrix-gsheets, matrix-spreadsheet, matrix-smile (consumer test), matrix-bom, docs.
Tests
./gradlew compileGroovy compileTestGroovy --continueon Groovy 6.0.0: all modules passSame command with
v_groovytemporarily set to 5.1.3: all modules pass./gradlew :matrix-core:test :matrix-stats:test :matrix-gsheets:test :matrix-spreadsheet:test :matrix-charts:test :matrix-ggplot:test --continue: all pass (core 680; others 170, 161, 1122, 760, and 1665 with 7 skipped)cd matrix-bom && mvn test:MatrixModulesTest15/15cd matrix-bom && mvn verify -Papi-it: all 21 IT classes passAfter the review fixes:
./gradlew :matrix-core:test680/680./matrix-bom/preReleaseVerify.sh(Groovy CLI 6.0.0): exit 0. japicmp flags matrix-core changes vs 3.8.0. The only public API changes areGrid.leftShift(def→Grid<T>) andColumn.subList(IntRange)(List→Column); both are intentional source changes made on main since 3.8.0, not from this PR. The rest are compiler-generated closure classes.Release tooling with Groovy CLI 6.0.0 (same commands as CI):
groovy scripts/release-all/test-tools.groovy .(61 assertions),test-inventory-inheritance.groovy .,test-workflow.groovy .,test-manifest-verifier.groovy . .bom-verify-repo: all pass. Before thestaged-settings.groovyfix,test-toolsand the manifest verifier failed.Not run: full
./gradlew testfor modules without source changes, andshellcheck(no shell scripts changed).🤖 Generated with Claude Code