Skip to content

Commit a3b5188

Browse files
cpovirkGoogle Java Core Libraries
authored and
Google Java Core Libraries
committed
Include j2objc-annotations in the Gradle runtime classpath.
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
1 parent 6a070d8 commit a3b5188

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

guava/module.json

+14
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@
133133
"version": {
134134
"requires": "${errorprone.version}"
135135
}
136+
},
137+
{
138+
"group": "com.google.j2objc",
139+
"module": "j2objc-annotations",
140+
"version": {
141+
"requires": "${j2objc.version}"
142+
}
136143
}
137144
],
138145
"files": [
@@ -272,6 +279,13 @@
272279
"version": {
273280
"requires": "${errorprone.version}"
274281
}
282+
},
283+
{
284+
"group": "com.google.j2objc",
285+
"module": "j2objc-annotations",
286+
"version": {
287+
"requires": "${j2objc.version}"
288+
}
275289
}
276290
],
277291
"files": [

integration-tests/gradle/build.gradle.kts

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ val expectedReducedRuntimeClasspathAndroidVersion =
88
setOf(
99
"guava-${guavaVersionJre.replace("jre", "android")}.jar",
1010
"failureaccess-1.0.2.jar",
11+
"j2objc-annotations-3.0.0.jar",
1112
"jsr305-3.0.2.jar",
1213
"checker-qual-3.43.0.jar",
1314
"error_prone_annotations-2.28.0.jar",
@@ -17,15 +18,14 @@ val expectedReducedRuntimeClasspathJreVersion =
1718
setOf(
1819
"guava-$guavaVersionJre.jar",
1920
"failureaccess-1.0.2.jar",
21+
"j2objc-annotations-3.0.0.jar",
2022
"jsr305-3.0.2.jar",
2123
"checker-qual-3.43.0.jar",
2224
"error_prone_annotations-2.28.0.jar",
2325
"listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar"
2426
)
25-
val expectedCompileClasspathAndroidVersion =
26-
expectedReducedRuntimeClasspathAndroidVersion + setOf("j2objc-annotations-3.0.0.jar")
27-
val expectedCompileClasspathJreVersion =
28-
expectedReducedRuntimeClasspathJreVersion + setOf("j2objc-annotations-3.0.0.jar")
27+
val expectedCompileClasspathAndroidVersion = expectedReducedRuntimeClasspathAndroidVersion
28+
val expectedCompileClasspathJreVersion = expectedReducedRuntimeClasspathJreVersion
2929

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

0 commit comments

Comments
 (0)