Skip to content

Commit

Permalink
Remove direct dependency on j2objc
Browse files Browse the repository at this point in the history
Bazel had the dependency added because of #5046, where Guava was
depending on it as compile-only and Bazel build have "unknown enum
constant" warnings. Guava now has a compile dependency on j2objc, so
this workaround is no longer needed. There are currently no version skew
issues in Gradle, which was the only usage.
  • Loading branch information
ejona86 authored Aug 14, 2024
1 parent 909c4bc commit ff8e413
Show file tree
Hide file tree
Showing 19 changed files with 11 additions and 22 deletions.
2 changes: 0 additions & 2 deletions alts/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ java_library(
"@com_google_protobuf//:protobuf_java_util",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
artifact("io.netty:netty-buffer"),
artifact("io.netty:netty-codec"),
artifact("io.netty:netty-common"),
Expand All @@ -45,7 +44,6 @@ java_library(
artifact("com.google.auth:google-auth-library-oauth2-http"),
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
artifact("io.netty:netty-common"),
artifact("io.netty:netty-handler"),
artifact("io.netty:netty-transport"),
Expand Down
1 change: 0 additions & 1 deletion api/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ java_library(
artifact("com.google.errorprone:error_prone_annotations"),
artifact("com.google.guava:failureaccess"), # future transitive dep of Guava. See #5214
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
],
)
1 change: 0 additions & 1 deletion auth/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ java_library(
artifact("com.google.auth:google-auth-library-credentials"),
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
],
)
1 change: 0 additions & 1 deletion core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ java_library(
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.errorprone:error_prone_annotations"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
artifact("io.perfmark:perfmark-api"),
artifact("org.codehaus.mojo:animal-sniffer-annotations"),
],
Expand Down
5 changes: 5 additions & 0 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<artifactId>protobuf-java-util</artifactId>
<version>${protobuf.version}</version>
</dependency>
<dependency> <!-- Use newer version than in protobuf-java-util -->
<groupId>com.google.j2objc</groupId>
<artifactId>j2objc-annotations</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>annotations-api</artifactId>
Expand Down
3 changes: 1 addition & 2 deletions gcp-observability/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ dependencies {
libraries.auto.value.annotations, // Use our newer version
libraries.guava.jre, // Use our newer version
libraries.protobuf.java.util, // Use our newer version
libraries.re2j, // Use our newer version
libraries.j2objc.annotations // Explicit dependency to keep in step with version used by guava
libraries.re2j // Use our newer version

testImplementation testFixtures(project(':grpc-api')),
project(':grpc-testing'),
Expand Down
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ guava-testlib = "com.google.guava:guava-testlib:33.2.1-android"
# May be different from the -android version.
guava-jre = "com.google.guava:guava:33.2.1-jre"
hdrhistogram = "org.hdrhistogram:HdrHistogram:2.2.2"
j2objc-annotations = " com.google.j2objc:j2objc-annotations:3.0.0"
jakarta-servlet-api = "jakarta.servlet:jakarta.servlet-api:5.0.0"
javax-annotation = "org.apache.tomcat:annotations-api:6.0.53"
javax-servlet-api = "javax.servlet:javax.servlet-api:4.0.1"
Expand Down
1 change: 0 additions & 1 deletion grpclb/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ java_library(
"@io_grpc_grpc_proto//:grpclb_load_balancer_java_proto",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
],
)

Expand Down
4 changes: 2 additions & 2 deletions grpclb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ dependencies {
implementation project(':grpc-core'),
project(':grpc-protobuf'),
project(':grpc-stub'),
libraries.guava,
libraries.protobuf.java,
libraries.protobuf.java.util,
libraries.guava
libraries.protobuf.java.util
runtimeOnly libraries.errorprone.annotations
compileOnly libraries.javax.annotation
testImplementation libraries.truth,
Expand Down
1 change: 0 additions & 1 deletion inprocess/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ java_library(
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.errorprone:error_prone_annotations"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
],
)
1 change: 0 additions & 1 deletion netty/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ java_library(
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.errorprone:error_prone_annotations"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
artifact("io.netty:netty-buffer"),
artifact("io.netty:netty-codec"),
artifact("io.netty:netty-codec-http"),
Expand Down
1 change: 0 additions & 1 deletion okhttp/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ java_library(
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.errorprone:error_prone_annotations"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
artifact("com.squareup.okhttp:okhttp"),
artifact("com.squareup.okio:okio"),
artifact("io.perfmark:perfmark-api"),
Expand Down
1 change: 0 additions & 1 deletion protobuf-lite/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ java_library(
"//api",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
] + select({
":android": ["@com_google_protobuf//:protobuf_javalite"],
"//conditions:default": ["@com_google_protobuf//:protobuf_java"],
Expand Down
1 change: 0 additions & 1 deletion protobuf/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ java_library(
artifact("com.google.api.grpc:proto-google-common-protos"),
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
],
)
5 changes: 2 additions & 3 deletions services/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ dependencies {
implementation project(':grpc-core'),
project(':grpc-protobuf'),
project(':grpc-util'),
libraries.protobuf.java.util,
libraries.guava.jre // JRE required by protobuf-java-util
libraries.guava.jre, // JRE required by protobuf-java-util
libraries.protobuf.java.util

runtimeOnly libraries.errorprone.annotations,
libraries.j2objc.annotations, // Explicit dependency to keep in step with version used by guava
libraries.gson // to fix checkUpperBoundDeps error here
compileOnly libraries.javax.annotation
testImplementation project(':grpc-testing'),
Expand Down
1 change: 0 additions & 1 deletion stub/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ java_library(
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.errorprone:error_prone_annotations"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
],
)

Expand Down
1 change: 0 additions & 1 deletion testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ java_library(
"//util",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
artifact("com.google.truth:truth"),
artifact("junit:junit"),
],
Expand Down
1 change: 0 additions & 1 deletion util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ java_library(
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.errorprone:error_prone_annotations"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
artifact("org.codehaus.mojo:animal-sniffer-annotations"),
],
)
1 change: 1 addition & 0 deletions xds/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ dependencies {
project(':grpc-services'),
project(':grpc-auth'),
project(path: ':grpc-alts', configuration: 'shadow'),
libraries.guava,
libraries.gson,
libraries.re2j,
libraries.auto.value.annotations,
Expand Down

0 comments on commit ff8e413

Please sign in to comment.