Updates Gradle Wrapper binaries #12908
Draft
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.
What are you trying to accomplish?
Extends Gradle Wrapper support introduced by #12891 to also update
gradlew
andgradle-wrapper.jar
by running the nativewrapper
task.Note
This PR is based on #12891, the real diff is here
Anything you want to highlight for special attention from reviewers?
Leverages the existing
LockfileUpdater
, extracting most of its code into a newGradleUpdaterBase
class, which has two abstract methods:target_file?
to tell the given file is meant to be updated by itcommand_args
to collaborate with the finalgradle
command runNow both
LockfileUpdater
and the newWrapperUpdater
inherit fromGradleUpdaterBase
.Same as
LockfileUpdater
is undergradle_lockfile_updater
feature flag, a newgradle_wrapper_updater
was introduced forWrapperUpdater
.The update will not attempt to use any configuration for the
wrapper
task in the main build script; many of the repos will be broken because they rely on other files or included builds that will take a long time to complete. We limit to copying the wrapper-related files and running a clean, empty build.How will you know you've accomplished your goal?
Running against a sample repo:
DEBUG_HELPERS=true bin/dry-run.rb gradle ReactiveX/RxJava --updater-options gradle_lockfile_updater,gradle_wrapper_updater --dep="gradle-wrapper"
produces the desired diff:
Checklist