wrapper-upgrade-gradle-plugin icon indicating copy to clipboard operation
wrapper-upgrade-gradle-plugin copied to clipboard

Add possibility for specifying the distribution type

Open vnastasi opened this issue 1 year ago • 6 comments

Hello

I noticed that there is no option in the plugin configurations to specify the distribution type for the wrapper (all or bin), and the wrapper task invoked always defaults to bin distribution type.

While this probably is OK for the vast majority of users, for those of us using all it's a bit inconvenient. I personally like to dig deeper in Gradle sources in my projects when I make custom tasks and plugins, so having the full distribution is a must. I can always go and amend the resulting PR, of course, but still. A property in the plugin extension would be a lot nicer.

Cheers!

vnastasi avatar Dec 30 '24 09:12 vnastasi

I didn't find this request too bad and think about adding this feature. However, right now the extension or the specific domain object is used for Gradle and Maven. Since this is a gradle specific request we may wanna talk about the api here. One approach would be to extract the current domain object to an interface and inherit this by specific GradleDomainObject and a MavenGradleObject.

What do you think about this @alextu ? Not only about the request itself but also about my api suggestion?

StefMa avatar Jan 06 '25 16:01 StefMa

Yes, I think that's a reasonable feature. Since the "distribution type" exists as well for Maven, we can implement this attribute for both Gradle and Maven in the same domain object. We won't have time to work on this feature in the near future though, but feel free to submit a PR.

alextu avatar Jan 07 '25 08:01 alextu

But the type is 100% (except of bin) different. Doesn't it make sense in terms of runtime safety to introduce hardcoded enums? So that for Gradle only all and bin is possible while for maven bin source.. etc?

StefMa avatar Jan 13 '25 06:01 StefMa

I just checked the code and found out that for Gradle, it fetches https://services.gradle.org/versions/current to find out the latest version and the checksum. It seems that there is only a checksum for the bin vesion, but no checksum of the all version. I get of course see the checksum here https://gradle.org/release-checksums/, but seems I'm unable to get them via json? 🤔

This would of course a big blocker for this feature...

StefMa avatar Jan 14 '25 13:01 StefMa

All (including the bin and all distribution) checksums can be found here: https://services.gradle.org/distributions/

StefMa avatar Mar 28 '25 11:03 StefMa

https://github.com/gradle/wrapper-upgrade-gradle-plugin/issues/278

joe10832 avatar Oct 16 '25 05:10 joe10832