Upgrading Groovy and Java

I noticed that Groovy and Java versions in the Groovy test runner are outdated (Groovy 3 and Java 11), so no recent features are supported, like records or switch expressions.
Updating both is quite an endeavor:

  • Groovy 4 requires JDK 16+ to build
  • Groovy changed its package groupId since version 4
  • Groovy deprecated groovy-all activate since version 4
  • The Spock version is also dependent on the Groovy version.

But since groovy-test-runner is pretty independent of exercises’ Gradle configs (it runs on maven with its own pre-downloaded list of dependencies), I think it should be possible to bump the runner first (and have the exercise dependency update PR ready too to merge shortly after).
There aren’t any deprecated language features, at least according to the release notes.

Does anyone have any concerns already?

I’m planning to at least check reference Groovy exercises solutions to pass the tests to get some estimate of backwards compatibility.

3 Likes

Looks like I’ve misread the release notes.

Groovy 4.0 requires JDK16+ to build and JDK8 is the minimum version of the JRE that we support. Groovy has been tested on JDK versions 8 through 17.

:point_up: 16+ is probably required to build the Groovy jar, not to build your code.

Here’s a PR updating test runner dependencies to Groovy 4: Update test runner to Groovy 4 by artamonovkirill · Pull Request #40 · exercism/groovy-test-runner · GitHub

1 Like

And here’s the one for exercism/groovy: Bump Groovy to version 4 by artamonovkirill · Pull Request #468 · exercism/groovy · GitHub
Quite some changes due to the bump of the Gradle wrapper version :disappointed:

2 Likes