Skip to content

Commit

Permalink
Include j2objc-annotations in the Gradle runtime classpath.
Browse files Browse the repository at this point in the history
While that artifact contains no runtime-retention annotations, it does contain class-retention annotations (which could drive a runtime bytecode-rewriting agent). And, more practically, the Android Gradle Plugin has started reporting errors for `compileOnly` dependencies.

Fixes #7397

Relevant to firebase/firebase-android-sdk#6232 and androidx/media#1700

RELNOTES=Added `j2objc-annotations` to the Gradle runtime classpath to avoid [an Android Gradle Plugin error](#7397).
PiperOrigin-RevId: 677842769
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Sep 23, 2024
1 parent 6a070d8 commit a3b5188
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 14 additions & 0 deletions guava/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@
"version": {
"requires": "${errorprone.version}"
}
},
{
"group": "com.google.j2objc",
"module": "j2objc-annotations",
"version": {
"requires": "${j2objc.version}"
}
}
],
"files": [
Expand Down Expand Up @@ -272,6 +279,13 @@
"version": {
"requires": "${errorprone.version}"
}
},
{
"group": "com.google.j2objc",
"module": "j2objc-annotations",
"version": {
"requires": "${j2objc.version}"
}
}
],
"files": [
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ val expectedReducedRuntimeClasspathAndroidVersion =
setOf(
"guava-${guavaVersionJre.replace("jre", "android")}.jar",
"failureaccess-1.0.2.jar",
"j2objc-annotations-3.0.0.jar",
"jsr305-3.0.2.jar",
"checker-qual-3.43.0.jar",
"error_prone_annotations-2.28.0.jar",
Expand All @@ -17,15 +18,14 @@ val expectedReducedRuntimeClasspathJreVersion =
setOf(
"guava-$guavaVersionJre.jar",
"failureaccess-1.0.2.jar",
"j2objc-annotations-3.0.0.jar",
"jsr305-3.0.2.jar",
"checker-qual-3.43.0.jar",
"error_prone_annotations-2.28.0.jar",
"listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar"
)
val expectedCompileClasspathAndroidVersion =
expectedReducedRuntimeClasspathAndroidVersion + setOf("j2objc-annotations-3.0.0.jar")
val expectedCompileClasspathJreVersion =
expectedReducedRuntimeClasspathJreVersion + setOf("j2objc-annotations-3.0.0.jar")
val expectedCompileClasspathAndroidVersion = expectedReducedRuntimeClasspathAndroidVersion
val expectedCompileClasspathJreVersion = expectedReducedRuntimeClasspathJreVersion

val extraLegacyDependencies = setOf("google-collections-1.0.jar")

Expand Down

0 comments on commit a3b5188

Please sign in to comment.