build: Add Java 8 API compatibility checks#5745
Draft
adinauer wants to merge 1 commit into
Draft
Conversation
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4c04bb8 | 350.71 ms | 413.63 ms | 62.92 ms |
| bb0ff41 | 315.84 ms | 350.76 ms | 34.92 ms |
| 7c1a728 | 289.46 ms | 368.15 ms | 78.69 ms |
| ff8eea4 | 313.42 ms | 337.08 ms | 23.66 ms |
| bbc35bb | 298.53 ms | 372.17 ms | 73.64 ms |
| 91bb874 | 311.00 ms | 363.47 ms | 52.47 ms |
| abfcc92 | 337.38 ms | 427.39 ms | 90.00 ms |
| ae7fed0 | 293.84 ms | 380.22 ms | 86.38 ms |
| 3998a95 | 415.94 ms | 478.54 ms | 62.60 ms |
| d15471f | 307.28 ms | 381.85 ms | 74.57 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4c04bb8 | 0 B | 0 B | 0 B |
| bb0ff41 | 0 B | 0 B | 0 B |
| 7c1a728 | 0 B | 0 B | 0 B |
| ff8eea4 | 1.58 MiB | 2.28 MiB | 718.64 KiB |
| bbc35bb | 1.58 MiB | 2.12 MiB | 553.01 KiB |
| 91bb874 | 1.58 MiB | 2.13 MiB | 559.07 KiB |
| abfcc92 | 1.58 MiB | 2.13 MiB | 557.31 KiB |
| ae7fed0 | 1.58 MiB | 2.12 MiB | 551.77 KiB |
| 3998a95 | 1.58 MiB | 2.10 MiB | 532.96 KiB |
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
9 tasks
Member
Author
|
Tested this using #5746 and it failed for both |
3611c33 to
0229500
Compare
9 tasks
Apply Animal Sniffer to Java 8 JVM SDK modules and check them against the Codehaus Java 8 runtime signature. This catches references to newer JDK APIs while keeping the existing Android signature checks in place where they already apply. Refs GH-5741
0229500 to
305dafe
Compare
runningcode
reviewed
Jul 8, 2026
| errorprone(libs.nopen.checker) | ||
| errorprone(libs.nullaway) | ||
|
|
||
| signature("org.codehaus.mojo.signature:java18:${libs.versions.java18Signature.get()}@signature") |
Contributor
There was a problem hiding this comment.
why not use the version catalog for the dependency as well (instead of just the version) ?
runningcode
reviewed
Jul 8, 2026
| testImplementation(libs.mockito.kotlin) | ||
| } | ||
|
|
||
| tasks { check { dependsOn(animalsnifferMain) } } |
Contributor
There was a problem hiding this comment.
Check the build scan to make sure this doesn't eagerly resolve the task.
This would definitely not eagerly resolve the task:
Suggested change
| tasks { check { dependsOn(animalsnifferMain) } } | |
| tasks.check.configureEach { dependsOn(animalsnifferMain) } |
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
Add Java 8 runtime API compatibility coverage to JVM SDK modules using Animal Sniffer and the Codehaus Java 8 signature.
This applies
ru.vyarus.animalsnifferto Java 8java-librarySDK modules that were missing it and adds:to those modules, with the signature version defined in
gradle/libs.versions.tomlasjava18Signature. Modules that already used Animal Sniffer keep their existing gummy-bears signature and also get the Codehaus Java 8 signature. The plugin checks signatures independently, so the Java 8 check still catches plain JVM incompatibilities while the existing Android/desugaring coverage remains intact.💡 Motivation and Context
We recently hit a Java 8 runtime incompatibility from a method reference that compiled on a newer JDK but is unavailable on Java 8. Targeting Java 8 bytecode is not sufficient to catch this class of issue, so published JVM SDK modules should also be checked against the Java 8 runtime API surface.
This now runs through the existing
checklifecycle and therefore through the existing Build workflow on PRs andmain.Refs GH-5741
💚 How did you test it?
The
checkrun includes Android modules and passed, confirming the duplicated JVM Animal Sniffer configuration does not break Android builds.A stacked validation PR intentionally introduces newer JDK API references in multiple JVM modules to confirm the new checks fail where expected.
📝 Checklist
sendDefaultPIIis enabled.#skip-changelog