Add possibility for specifying the distribution type
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!
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?
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.
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?
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...
All (including the bin and all distribution) checksums can be found here: https://services.gradle.org/distributions/
https://github.com/gradle/wrapper-upgrade-gradle-plugin/issues/278