Skip to content

Custom GradleWrapper - #16483

Draft
dsmiley wants to merge 2 commits into
apache:mainfrom
dsmiley:CustomGradleWrapper
Draft

Custom GradleWrapper#16483
dsmiley wants to merge 2 commits into
apache:mainfrom
dsmiley:CustomGradleWrapper

Conversation

@dsmiley

@dsmiley dsmiley commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

I got frustrated with the gradle wrapper situation. The fact that we went through all this trouble here with a custom downloader -- all to download another tiny program (the actual gradle wrapper) to basically just download and run Gradle ... seems a bit silly, no?

So I had an idea and filed it with the Gradle project to offer the wrapper in source form.. Maybe they won't implement the idea but nonetheless we are certainly empowered to do so. It's not hard!

@dsmiley dsmiley left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's probably no more code involved in doing this than what we have tody. I like that it's simpler; removing some entanglements in the shell & GHA yml.

Comment thread gradle/wrapper/GradleWrapper.java Outdated
Comment thread gradle/wrapper/GradleWrapper.java
Execute gradle in the same JVM.
Support the gradle-wrapper.jar if present.
Only include basic/used gradle-wrapper.properties

@dweiss dweiss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea. I'm not sure what the original gradle wrapper does (or will do in the future) though - it'd be good to move the burden of maintaining it to gradle itself... but I don't have high hopes they'll be interested.

What was the source of your frustration with the previous downloader? It didn't work? I never had any problem with it, even when switching branches etc.

Comment thread gradlew.bat
Comment on lines +98 to +99
@rem No staleness check: if you edit GradleWrapper.java, delete %GRADLE_WRAPPER_CACHE% to force
@rem a recompile (this file changes rarely, so keeping this simple is worth that manual step).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's going to be trouble on Windows if the wrapper is updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants