From a482a3abeaa12b48e78c012ab44407da9c97a400 Mon Sep 17 00:00:00 2001 From: Colin Decker Date: Fri, 13 Oct 2023 13:14:56 -0700 Subject: [PATCH] Add `//third_party/java/grpc:api` and switch `//third_party/java/grpc:context` to just export it (maybe we can just get rid of it). At some point between the old version of gRPC that Bazel Common used and the newest one, the `grpc-context` artifact was replaced or folded into `grpc-api`. It seems like the new releases of gRPC continue to have a `grpc-context` artifact, but its jar file contains no classes. PiperOrigin-RevId: 573302458 --- third_party/java/grpc/BUILD | 7 ++++++- workspace_defs.bzl | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/third_party/java/grpc/BUILD b/third_party/java/grpc/BUILD index 34d3ef1..da61a13 100644 --- a/third_party/java/grpc/BUILD +++ b/third_party/java/grpc/BUILD @@ -23,6 +23,11 @@ java_library( exports = ["@io_grpc_grpc_all//jar"], ) +java_library( + name = "api", + exports = ["@io_grpc_grpc_api//jar"], +) + java_library( name = "core", exports = ["@io_grpc_grpc_core//jar"], @@ -35,7 +40,7 @@ java_library( java_library( name = "context", - exports = ["@io_grpc_grpc_context//jar"], + exports = [":api"], ) java_library( diff --git a/workspace_defs.bzl b/workspace_defs.bzl index a99ec44..da0aa30 100644 --- a/workspace_defs.bzl +++ b/workspace_defs.bzl @@ -309,6 +309,14 @@ def google_common_workspace_rules(): ) GRPC_VERSION = "1.58.0" + maven_import( + group_id = "io.grpc", + artifact_id = "grpc-api", + version = GRPC_VERSION, + licenses = ["notice"], + sha256 = "d688d25f4f533979df2fcd0881e1e30c2928e5b654ff09bf1440923282b0d945", + ) + maven_import( group_id = "io.grpc", artifact_id = "grpc-core",