Skip to content

Updating Gradle Wrapper binaries support#12908

Closed
gmazzo wants to merge 9 commits into
dependabot:mainfrom
gmazzo:gradle-wrapper-support-binaries
Closed

Updating Gradle Wrapper binaries support#12908
gmazzo wants to merge 9 commits into
dependabot:mainfrom
gmazzo:gradle-wrapper-support-binaries

Conversation

@gmazzo

@gmazzo gmazzo commented Aug 22, 2025

Copy link
Copy Markdown
Contributor

What are you trying to accomplish?

Extends Gradle Wrapper support introduced by #12891 to also update gradlew and gradle-wrapper.jar by running the native wrapper 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 new GradleUpdaterBase class, which has two abstract methods:

  • target_file? to tell the given file is meant to be updated by it
  • command_args to collaborate with the final gradle command run

Now both LockfileUpdater and the new WrapperUpdater inherit from GradleUpdaterBase.

Same as LockfileUpdater is under gradle_lockfile_updater feature flag, a new gradle_wrapper_updater is used for WrapperUpdater.

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:


=== gradle-wrapper (8.14)
 => checking for updates 1/1
🌍 --> GET https://services.gradle.org/versions/all
🌍 <-- 200 https://services.gradle.org/versions/all
I, [2025-08-22T12:38:02.535120 #13831]  INFO -- : Initializing cooldown filter
I, [2025-08-22T12:38:02.554660 #13831]  INFO -- : Release date not available for version 9.0.0
I, [2025-08-22T12:38:02.554733 #13831]  INFO -- : Filtered out 0 version(s) due to cooldown
 => latest available version is 9.0.0
 => latest allowed version is 9.0.0
 => requirements to unlock: own
 => requirements update strategy: 
gradle --no-daemon wrapper --gradle-version 9.0.0
 => bump gradle-wrapper from 8.14 to 9.0.0

    ± gradlew
    ~~~
    <Script file content truncated>
    ~~~
    23 insertions (+), 16 deletions (-)

    ± gradlew.bat
    ~~~
    <Script file content truncated>
    ~~~
    95 insertions (+), 93 deletions (-)

    ± gradle/wrapper/gradle-wrapper.jar
    ~~~
    Binary files /tmp/original20250822-13831-1i27f6 and /tmp/updated20250822-13831-rbx4cg differ
    ~~~
    0 insertions (+), 0 deletions (-)

    ± gradle/wrapper/gradle-wrapper.properties
    ~~~
    --- /tmp/original20250822-13831-x20t9e      2025-08-22 12:38:09.174914071 +0000
    +++ /tmp/updated20250822-13831-3bg825       2025-08-22 12:38:09.174914071 +0000
    @@ -1,6 +1,7 @@
     distributionBase=GRADLE_USER_HOME
     distributionPath=wrapper/dists
    -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
    +distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
     networkTimeout=10000
    +validateDistributionUrl=true
     zipStoreBase=GRADLE_USER_HOME
     zipStorePath=wrapper/dists
    ~~~
    3 insertions (+), 2 deletions (-)
🌍 Total requests made: '1'
Dry-run completed successfully.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@github-actions github-actions Bot added the L: java:gradle Maven packages via Gradle label Aug 22, 2025
@gmazzo gmazzo mentioned this pull request Aug 22, 2025
5 tasks
@gmazzo gmazzo force-pushed the gradle-wrapper-support-binaries branch 12 times, most recently from ffe2f83 to e37c768 Compare August 25, 2025 13:42
@gmazzo gmazzo changed the title Updates Gradle Wrapper binaries Updating Gradle Wrapper binaries support Aug 25, 2025
@gmazzo gmazzo force-pushed the gradle-wrapper-support-binaries branch from e37c768 to 321013e Compare August 25, 2025 13:49
@gmazzo gmazzo force-pushed the gradle-wrapper-support-binaries branch 4 times, most recently from 92548a6 to c2cf521 Compare August 25, 2025 15:12
@gmazzo gmazzo force-pushed the gradle-wrapper-support-binaries branch from c2cf521 to c0c402c Compare August 25, 2025 18:51
@gmazzo gmazzo force-pushed the gradle-wrapper-support-binaries branch 3 times, most recently from acf1838 to 992e9e0 Compare August 26, 2025 10:22
@gmazzo gmazzo force-pushed the gradle-wrapper-support-binaries branch 7 times, most recently from 7535c7f to 7cc8fa3 Compare August 26, 2025 16:16
@gmazzo gmazzo force-pushed the gradle-wrapper-support-binaries branch 2 times, most recently from 190690a to 96d9571 Compare August 26, 2025 22:53
@gmazzo gmazzo force-pushed the gradle-wrapper-support-binaries branch from 96d9571 to 6a3e02c Compare August 27, 2025 12:24
@gmazzo

gmazzo commented Aug 27, 2025

Copy link
Copy Markdown
Contributor Author

Closing, since it has been integrated into #12891

@gmazzo gmazzo closed this Aug 27, 2025
@gmazzo gmazzo deleted the gradle-wrapper-support-binaries branch November 8, 2025 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L: java:gradle Maven packages via Gradle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant