Skip to content

build: track gradle-wrapper.jar, build through the wrapper in CI - #186

Merged
stozo04 merged 5 commits into
mainfrom
gradle-wrapper
Sep 7, 2026
Merged

stozo04 merged 5 commits into
mainfrom
gradle-wrapper

Conversation

@stozo04

@stozo04 stozo04 commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Commits gradle/wrapper/gradle-wrapper.jar (47,505 bytes, Steven's commit) and makes the rest of the repo consistent with that.

Why this is the right call

gradlew without its jar is a script with no engine. It has worked locally only because every machine that has ever built OpenLoop already had the jar sitting on disk from an earlier Gradle run — nothing in the repo put it there. A clean clone couldn't build, which is exactly what CI hit.

The usual argument against committing it is that it's an unreviewable binary executed on every build, which matters more here than most since this repo is public. That's covered: gradle/actions/setup-gradle v4+ checksums the jar against Gradle's published hashes on every run and fails if it doesn't match. Committed-and-validated beats absent.

Changes beyond the jar

  • .gitignore — removed /gradle/wrapper/gradle-wrapper.jar. Leaving it would have meant git add -f on every wrapper upgrade and an open invitation to untrack it again. Replaced with a comment explaining why the jar is tracked.
  • release.yml — back to ./gradlew, so CI uses the same entry point as every other environment. The version-reading step is gone; setup-gradle takes the version from gradle-wrapper.properties itself.

chmod +x gradlew stays. Git on Windows doesn't track the executable bit, so gradlew is still mode 100644 in the index and arrives non-executable on a Linux runner. If you ever want that fixed at the source: git update-index --chmod=+x gradlew.

Dry run status

Cleared: checkout, compileSdk 37, JDK 17, keystore opening with the alias. Still unproven: R8, the baseline profile, jarsigner.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Miqsf1M14nY5TKiZHzyjNY


Note

Low Risk
Build and CI wiring only; the committed wrapper JAR is validated by setup-gradle checksums on each run, with no app runtime or security logic changes.

Overview
Fixes clean-clone and CI builds by committing gradle/wrapper/gradle-wrapper.jar so ./gradlew has its bootstrap JAR in the repo instead of relying on a machine-local copy left over from an earlier Gradle run.

.gitignore drops the ignore rule for that JAR and documents why it stays tracked, so wrapper upgrades don’t need git add -f or risk untracking it again.

.github/workflows/release.yml switches the release job back to ./gradlew with gradle/actions/setup-gradle (Gradle version from gradle-wrapper.properties), removing a separate version-read step. CI still runs chmod +x gradlew because the executable bit isn’t preserved for Linux runners on Windows-originated commits.

Reviewed by Cursor Bugbot for commit dcc0296. Bugbot is set up for automated code reviews on this repo. Configure here.

The jar is now tracked, so the ignore line is stale and actively misleading:
it would force `git add -f` on every wrapper upgrade and invite someone to
untrack it again. setup-gradle validates the jar's checksum against Gradle's
published hashes on every run, which is the reason it is safe to commit.
With gradle/wrapper/gradle-wrapper.jar committed, ./gradlew works on a clean
checkout, so CI can use the same entry point as every other environment
instead of installing Gradle separately. Drops the version-reading step —
setup-gradle takes the version from the wrapper, and from v4 it also
checksums the jar against Gradle's published hashes on every run.

chmod stays: git on Windows does not track the executable bit, so gradlew is
still mode 100644 in the index.
This branch was cut from a main that predates the release workflows, so
adding release.yml here made it an add/add conflict against the copy already
on main. The workflow change belongs in a follow-up PR based on current main;
this branch should carry only the wrapper jar.
Same reason as the release.yml revert: this branch predates current main, so
editing .gitignore here conflicts. Restoring it byte-for-byte to the merge
base leaves the jar as this branch's only change. The ignore-line removal
moves to the follow-up PR.
@stozo04
stozo04 merged commit 0e1d5a8 into main Sep 7, 2026
3 checks passed
@stozo04
stozo04 deleted the gradle-wrapper branch September 7, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant