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.

Addresses #7397. (But I'll keep that issue open until I publish a release.)

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: 677781422
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Sep 23, 2024
1 parent e5b58e2 commit 01e2668
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 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
14 changes: 7 additions & 7 deletions integration-tests/gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ 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",
"listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar"
"listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar",
)
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"
"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 Expand Up @@ -163,7 +163,7 @@ subprojects {
// TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE
attribute(
Attribute.of("org.gradle.jvm.environment", String::class.java),
"standard-jvm"
"standard-jvm",
)
}
}
Expand Down

0 comments on commit 01e2668

Please sign in to comment.