Skip to content

Commit 38ba2ef

Browse files
committed
fix (build): Use @io_grpc_grpc_java from grpc.io instead rules-proto-grpc.com (fixes #202)
1 parent 4641c45 commit 38ba2ef

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

MODULE.bazel

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ maven.install(
3434
"com.google.protobuf:protobuf-java-util:4.0.0-rc-2",
3535
# gRPC
3636
"com.google.api.grpc:proto-google-common-protos:2.29.0",
37+
# Keep gRPC version in sync with WORKSPACE.bazel
3738
"io.grpc:grpc-netty:1.54.1", # Alternative: grpc-netty-shaded
3839
"io.grpc:grpc-stub:1.54.1",
3940
"io.grpc:grpc-core:1.54.1", # for inprocess

WORKSPACE.bazel

+22-10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,27 @@
1616

1717
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1818

19+
# Keep gRPC version in sync with MODULE.bazel
20+
GRPC_JAVA_VERSION = "1.54.1"
21+
# https://github.com/grpc/grpc-java/
22+
# https://github.com/enola-dev/enola/issues/202
23+
# https://github.com/grpc/grpc-java/issues/10215
24+
# TODO replace with bazel_dep in MODULE.bazel
25+
# when https://github.com/bazelbuild/bazel-central-registry/issues/353
26+
# (AKA https://github.com/grpc/grpc-java/issues/9559) is available.
27+
http_archive(
28+
name = "io_grpc_grpc_java",
29+
sha256 = "78bf175f9a8fa23cda724bbef52ad9d0d555cdd1122bcb06484b91174f931239",
30+
strip_prefix = "grpc-java-%s" % GRPC_JAVA_VERSION,
31+
url = "https://github.com/grpc/grpc-java/archive/v%s.zip" % GRPC_JAVA_VERSION,
32+
)
33+
load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS")
34+
35+
# load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")
36+
# grpc_java_repositories()
37+
# load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
38+
# protobuf_deps()
39+
1940
# https://rules-proto-grpc.com/en/latest/#installation
2041
http_archive(
2142
name = "rules_proto_grpc",
@@ -46,16 +67,7 @@ load("@rules_proto_grpc//buf:repositories.bzl", rules_proto_grpc_buf_repos = "bu
4667

4768
rules_proto_grpc_buf_repos()
4869

49-
# https://rules-proto-grpc.com/en/latest/lang/java.html#java-grpc-library
50-
load("@rules_proto_grpc//java:repositories.bzl", rules_proto_grpc_java_repos = "java_repos")
51-
52-
rules_proto_grpc_java_repos()
53-
54-
load(
55-
"@io_grpc_grpc_java//:repositories.bzl",
56-
"IO_GRPC_GRPC_JAVA_ARTIFACTS",
57-
"IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS",
58-
)
70+
# https://github.com/grpc/grpc-java/blob/master/examples/WORKSPACE
5971
load("@rules_jvm_external//:defs.bzl", "maven_install")
6072

6173
# TODO Declare Maven dependencies in 1 single place, instead of both here as well as in maven.install() of MODULE.bazel

core/lib/BUILD

-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
# https://github.com/enola-dev/enola/issues/202
1818
# https://github.com/grpc/grpc-java/issues/10215
19-
# TODO replace with bazel_dep in MODULE.bazel
20-
# when https://github.com/bazelbuild/bazel-central-registry/issues/353
21-
# (AKA https://github.com/grpc/grpc-java/issues/9559) is available.
2219
load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library")
2320

2421
# https://github.com/bazelbuild/rules_go/blob/master/proto/core.rst#go_proto_library

0 commit comments

Comments
 (0)