Repository navigation
build(android): Download Robolectric android-all jars with Gradle - #6553
Merged
Merged
Conversation
runningcode
requested review from
0xadam-brown and
romtsn
and removed request for
a team
November 11, 2026 09:37
📲 Install BuildsAndroid
|
3 of 9 tasks
Robolectric fetched ~0.95 GB of android-all jars from Maven Central while tests ran, and CI doesn't cache ~/.m2, so every Build run downloaded them again. A new io.sentry.robolectric build-logic plugin resolves them with Gradle before the tests start, so setup-gradle restores them from cache, and points Robolectric at them through robolectric-deps.properties instead of copying them into robolectric.dependency.dir. See https://robolectric.org/blog/2023/11/11/improving-android-all-downloading/ Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runningcode
force-pushed
the
no/robolectric-android-all-gradle
branch
from
November 11, 2026 14:48
d15fa0f to
55bccb8
Compare
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.
📜 Description
Adds an
io.sentry.robolectricbuild-logic plugin, applied to the seven modules with Robolectric tests. Gradle now downloads the android-all jars the tests need, instead of Robolectric downloading them from Maven Central during the tests, as recommended in Improving android-all downloading.robolectric-deps.propertiesfile, so nothing is copied.no artifacts found for org.robolectric:android-all-instrumented:…, and a comment inlibs.versions.tomlpoints to the plugin.💡 Motivation and Context
This makes the downloads more reliable; it barely changes build speed. Gradle retries, respects proxy settings, and fetches each jar once per machine, before any test runs. Downloading in the middle of a test is what causes the flaky SHA-mismatch failures the post describes.
It is not a meaningful speedup: CI downloads all the jars in about 10 s. Because of the configuration cache, every
checkalso resolves the jars, even when the tests come from the build cache. That's a local lookup oncesetup-gradlehas them, but theBuildjob's cache grows by about 0.95 GB.💚 How did you test it?
All Robolectric tests pass in the seven modules. With one API level removed from the list, its tests fail, so Robolectric never falls back to
~/.m2. On CI, the build scan shows each jar downloaded once, even though six modules resolved it.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
After merge, check that a PR's build scan shows no android-all downloads, to confirm
setup-gradlekeeps the jars between runs.🤖 Generated with Claude Code
#skip-changelog