-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Introduce Gradle wrapper #28065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Gradle wrapper #28065
Conversation
We have agreed to introduce the Gradle wrapper to simplify workflows for developers, and managing infrastructure (e.g., CI, release builds, etc.) as well as consideration for the fact that other projects in our stack use Gradle and do not necessarily want to be tied to our Gradle version.
nik9000
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want the binary in the repo but I really don't want to wrangle with gradle upgrades and I like that we can rely on a particular version of gradle with this. This is an improvement overall so let's do it.
ywelsch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I've left two suggestions and one question.
build.gradle
Outdated
| int bytesRead | ||
| while ((bytesRead = i.read(buffer)) >= 0) { | ||
| if (bytesRead > 0) { | ||
| sha256.update(buffer, 0, bytesRead) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe simpler to just write
String checksum = MessageDigest.getInstance("SHA-256").digest(uri.toURL().getBytes()).encodeHex().toString()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is simpler, but I would prefer not to download an arbitrary number of bytes into memory in one go. This is why I chunk it.
build.gradle
Outdated
| tasks.withType(Wrapper).each(wrapperClosure) | ||
|
|
||
| subprojects { | ||
| tasks.withType(Wrapper).each(wrapperClosure) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can fold this call with the previous one into
allprojects {
tasks.withType(Wrapper).each(wrapperClosure)
}
|
|
||
| task wrapper(type: Wrapper) | ||
|
|
||
| gradle.projectsEvaluated { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this required?
We have agreed to introduce the Gradle wrapper to simplify workflows for developers, and managing infrastructure (e.g., CI, release builds, etc.) as well as consideration for the fact that other projects in our stack use Gradle and do not necessarily want to be tied to our Gradle version. Relates #28065
We have agreed to introduce the Gradle wrapper to simplify workflows for developers, and managing infrastructure (e.g., CI, release builds, etc.) as well as consideration for the fact that other projects in our stack use Gradle and do not necessarily want to be tied to our Gradle version. Relates #28065
We have agreed to introduce the Gradle wrapper to simplify workflows for developers, and managing infrastructure (e.g., CI, release builds, etc.) as well as consideration for the fact that other projects in our stack use Gradle and do not necessarily want to be tied to our Gradle version. Relates #28065
We have agreed to introduce the Gradle wrapper to simplify workflows for developers, and managing infrastructure (e.g., CI, release builds, etc.) as well as consideration for the fact that other projects in our stack use Gradle and do not necessarily want to be tied to our Gradle version. Relates #28065
We have agreed to introduce the Gradle wrapper to simplify workflows for developers, and managing infrastructure (e.g., CI, release builds, etc.) as well as consideration for the fact that other projects in our stack use Gradle and do not necessarily want to be tied to our Gradle version.
Relates #13744