Proposal: add distributionRepository and archiveClassifier properties to Wrapper task

52 views
Skip to first unread message

davidmc24

unread,
Sep 30, 2015, 4:01:03 PM9/30/15
to gradle-dev
At work, we have Artifactory configured to act as a caching proxy for Gradle distributions downloaded by the Gradle Wrapper, to avoid network connectivity/services.gradle.org outages from generally affecting us.  However, the experience in getting this set up and retained isn't quite as smooth as it could be.

When upgrading Gradle versions, my preferred method is to upgrade Gradle on my system using Homebrew, and then execute the "wrapper" task from the new version.  However, this overwrites the distributionUrl with the default.  The proposed distributionRepository property would allow setting the repository to use as a command-line option ("gradle-distribution-repository") or in your build script.  If not specified, it would retain the current default behavior from DistributionLocator, using either https://services.gradle.org/distributions or https://services.gradle.org/distributions-snapshots depending on the version.

Similarly, on some projects, I prefer using the "all" distribution rather than the "bin" distribution, to allow taking advantage of IntelliJ's enhanced tooling when sources are available.  The proposed archiveClassifier property would default to "bin" to maintain the current behavior, but would be passed to DistributionLocator when generating URLs.  I think it might also be useful to expose this as a command-line option, perhaps "gradle-archive-classifier".

Any thoughts on this change?  If it sounds like a useful direction, I'd be happy to provide a pull request.

Marcin Erdmann

unread,
Sep 30, 2015, 5:38:15 PM9/30/15
to gradl...@googlegroups.com
It's probably not quite the same because I don't get the version of gradle wrapper jar updated but I'll share my approach anyway: I simply change the version specified as part of the distributionUrl property defined in gradle/wrapper/gradle-wrapper.properties to update gradle version on a project. This way you wouldn't get your distribution url overwritten.

--
You received this message because you are subscribed to the Google Groups "gradle-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gradle-dev+...@googlegroups.com.
To post to this group, send email to gradl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/571f36a9-a5bf-440d-8516-d52bed02a1cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

davidmc24

unread,
Sep 30, 2015, 9:16:15 PM9/30/15
to gradle-dev
Thanks for the suggestion. I'm aware that the distributionUrl can be changed directly as a work-around, but I'd prefer an approach that cleanly supports upgrading the jar to account for future changes to the jar, similar to the performance fix in 2.7.

Marcin Erdmann

unread,
Oct 1, 2015, 3:52:25 AM10/1/15
to gradl...@googlegroups.com
Yeah, the 2.7 wrapper jar fix is probably enough of a precedent to always update your wrapper jar and have a proper solution for using a custom distribution url...


On Thursday, 1 October 2015, davidmc24 <davi...@gmail.com> wrote:
Thanks for the suggestion. I'm aware that the distributionUrl can be changed directly as a work-around, but I'd prefer an approach that cleanly supports upgrading the jar to account for future changes to the jar, similar to the performance fix in 2.7.

--
You received this message because you are subscribed to the Google Groups "gradle-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gradle-dev+...@googlegroups.com.
To post to this group, send email to gradl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/936ce75c-3af0-4cef-baff-12502802134d%40googlegroups.com.

Luke Daley

unread,
Oct 4, 2015, 10:57:56 PM10/4/15
to gradl...@googlegroups.com, davidmc24
I’m +1 for these changes. There are a host of usability problems with the wrapper, but these don’t exacerbate any of those and improve some.
--
You received this message because you are subscribed to the Google Groups "gradle-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gradle-dev+...@googlegroups.com.
To post to this group, send email to gradl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages