Skip to content

Generate the google-java-format default from the version catalog - #3045

Open
builtbyjuls wants to merge 1 commit into
diffplug:mainfrom
builtbyjuls:issue-2705-gjf-buildconfig
Open

Generate the google-java-format default from the version catalog#3045
builtbyjuls wants to merge 1 commit into
diffplug:mainfrom
builtbyjuls:issue-2705-gjf-buildconfig

Conversation

@builtbyjuls

Copy link
Copy Markdown

Closes #2705.

Summary

  • Add gradle-buildconfig-plugin to the library build.
  • Generate a package-private BuildConfig.VERSION_GJF from the google-java-format version catalog entry.
  • Use the generated value for the JVM 21+ default.
  • Keep the JVM 17 default and JVM minimum-version constraints explicit because they represent compatibility rules rather than the latest dependency version.

Verification

  • ./gradlew :lib:clean :lib:generateBuildConfigClasses :lib:compileJava --stacktrace
  • ./gradlew :lib:compileJava :testlib:test --tests com.diffplug.spotless.java.GoogleJavaFormatStepTest spotlessCheck --stacktrace

The focused test run executed 13 tests: 10 passed and 3 JVM-specific tests were skipped.

No CHANGES.md entry: this changes build maintenance only and does not change the current formatter default or user-facing behavior.

@Goooler

Goooler commented Sep 8, 2026

Copy link
Copy Markdown
Member

Needs to check the other versions as well, replace all related usages.

@builtbyjuls

Copy link
Copy Markdown
Author

Thanks. To confirm, should I generate constants for every catalog-backed formatter/runtime default in lib and replace their usages across lib and the plugins, while keeping compatibility thresholds and intentionally older compile pins hardcoded?

I found four catalog/default mismatches: Gson 2.14.0/2.13.2, Jackson YAML 2.20.1/2.14.1, Cleanthat 2.24/2.25, and Palantir 1.1.0/2.80.0. Including those would change or downgrade current defaults. Should this PR reconcile those too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use gradle-buildconfig-plugin to generate dependency versions

2 participants