spotless icon indicating copy to clipboard operation
spotless copied to clipboard

Use `gradle-buildconfig-plugin` to generate dependency versions

Open Goooler opened this issue 2 months ago • 3 comments

Generate build config for the versions like

https://github.com/diffplug/spotless/blame/a0ac60042bb4470f9dd7992e11541ca37d025f75/lib/build.gradle#L99

And refer to the generated config for

https://github.com/diffplug/spotless/blob/8d4cd28cb1ed3f2ebfd0e48cc8e5715ef65d6440/lib/src/main/java/com/diffplug/spotless/java/GoogleJavaFormatStep.java#L124

There is an example like https://github.com/vanniktech/gradle-maven-publish-plugin/blob/d0e50fec7a07ef91fde62ae5cb0e4b4b4769d797/plugin/build.gradle.kts#L35-L110

This should be stacked on #2704.

Goooler avatar Oct 28 '25 02:10 Goooler

I'm not familiar with this, but I'm open to it. What is the problem that it solves?

nedtwigg avatar Nov 03 '25 17:11 nedtwigg

@renovate-bot send the updates like #2345, we have to update GoogleJavaFormatStep.java manually to reflect the latest version string. If we apply the build config stuff, the latest version in the lib will always be refed by

.add(17, BuildConfig.VERSION_GJF); // default version 

and BuildConfig.VERSION_GJF always reflects the latest version bumped by @renovate-bot.

Goooler avatar Nov 04 '25 05:11 Goooler

Wow! Great idea, I like it!

nedtwigg avatar Nov 05 '25 17:11 nedtwigg