Backported: Improve init gradle wrapper release#1056
Merged
jacopoc merged 3 commits intoApr 4, 2026
Conversation
…he init-gradle-wrapper scripts to download and verify the version specified in gradle-wrapper.properties This change simplifies gradlew upgrades (no longer requiring updates to the scripts or recomputation of file hashes) and improves repository quality by removing the binary file (gradle-wrapper.jar). The behavior of init-gradle-wrapper.sh and init-gradle-wrapper.ps1 is now consistent. The init-gradle-wrapper.sh and init-gradle-wrapper.ps1 scripts now: * download only gradle-wrapper.jar * parse the version from gradle-wrapper.properties (no hardcoded version in the scripts) * fetch the SHA-256 from services.gradle.org and verify it * correctly detect when the JAR already exists and fetch SHA, warn-and-continue if unreachable, exit if match, re-download if mismatch * accept arguments: ** --help: prints usage + full upgrade workflow, then exits ** --upgrade: sets a flag that triggers "./gradlew wrapper" at both success exit points (jar-already-valid and freshly-downloaded-and-verified) ** unknown arguments produce an error with a pointer to --help (cherry picked from commit c8c8bca)
… unnecessary sed command (cherry picked from commit 7a143d4)
(cherry picked from commit b109e9c)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.