From 4de02a811384539826f563c633eec8e6b7ef0fe5 Mon Sep 17 00:00:00 2001 From: Mai Hussien Date: Mon, 14 Aug 2023 11:50:07 -0700 Subject: [PATCH] Fix `intellij-ext` service dependencies to build with Bazel PiperOrigin-RevId: 556864915 --- WORKSPACE | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ ext/BUILD | 26 +++++++++++++------------- ext/proto/BUILD | 5 ++--- 3 files changed, 64 insertions(+), 16 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 73db25e11ec..238fcee136a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -623,3 +623,52 @@ jvm_maven_import_external( licenses = ["notice"], # Apache 2.0 server_urls = ["https://repo1.maven.org/maven2"], ) + +http_archive( + name = "io_bazel_rules_go", + sha256 = "6b65cb7917b4d1709f9410ffe00ecf3e160edf674b78c54a894471320862184f", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.39.0/rules_go-v0.39.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.39.0/rules_go-v0.39.0.zip", + ], +) + +# gRPC Java +http_archive( + name = "io_grpc_grpc_java", + sha256 = "4a021ea9ebb96f5841a135c168209cf2413587a0f8ce71a2bf37b3aad847b0d0", + strip_prefix = "grpc-java-1.57.1", + url = "https://github.com/grpc/grpc-java/archive/v1.57.1.tar.gz", +) + +jvm_maven_import_external( + name = "netty4_common", + artifact = "io.netty:netty-common:4.1.96.Final", + artifact_sha256 = "da104e80db830922eaf860eb1c5e957cd1d124068253d02e9c7a7843bc66427a", + licenses = ["notice"], # Apache 2.0 + server_urls = ["https://repo1.maven.org/maven2"], +) + +jvm_maven_import_external( + name = "netty4_transport", + artifact = "io.netty:netty-transport:4.1.96.Final", + artifact_sha256 = "8fe3afbe8b094a7b9f1eb27becf1cf017e5572343c1744d2b6040d5f331e84e3", + licenses = ["notice"], # Apache 2.0 + server_urls = ["https://repo1.maven.org/maven2"], +) + +jvm_maven_import_external( + name = "netty4_transport_native_epoll", + artifact = "io.netty:netty-transport-native-epoll:4.1.96.Final", + artifact_sha256 = "33d8f491e47a5a365a9bab0c279ae3d47313f00f305c3d0333ae7fdba6762786", + licenses = ["notice"], # Apache 2.0 + server_urls = ["https://repo1.maven.org/maven2"], +) + +jvm_maven_import_external( + name = "netty4_transport_native_unix_common", + artifact = "io.netty:netty-transport-native-unix-common:4.1.96.Final", + artifact_sha256 = "4f96297a06a544a4cdb6fe6af8b868640f100fa96969e2196be216bd41adef13", + licenses = ["notice"], # Apache 2.0 + server_urls = ["https://repo1.maven.org/maven2"], +) diff --git a/ext/BUILD b/ext/BUILD index 10a2991639e..b0411f5c59c 100644 --- a/ext/BUILD +++ b/ext/BUILD @@ -13,13 +13,13 @@ java_library( deps = [ "//ext/proto:intellijext_java_grpc", "//ext/proto:intellijext_java_proto", - "//third_party/java/grpc:core", - "//third_party/java/grpc:netty", - "//third_party/java/netty4:common", - "//third_party/java/netty4:transport", - "//third_party/java/netty4:transport_native_epoll", - "//third_party/java/netty4:transport_native_unix_common", "@com_google_guava_guava//jar", + "@io_grpc_grpc_java//core", + "@io_grpc_grpc_java//netty", + "@netty4_common//jar", + "@netty4_transport//jar", + "@netty4_transport_native_epoll//jar", + "@netty4_transport_native_unix_common//jar", ], ) @@ -30,13 +30,13 @@ java_binary( deps = [ "//ext/proto:intellijext_java_grpc", "//ext/proto:intellijext_java_proto", - "//third_party/java/grpc:core", - "//third_party/java/grpc:netty", "//third_party/java/grpc:stub", - "//third_party/java/netty4:common", - "//third_party/java/netty4:transport", - "//third_party/java/netty4:transport_native_epoll", - "//third_party/java/netty4:transport_native_unix_common", + "@io_grpc_grpc_java//core", + "@io_grpc_grpc_java//netty", + "@netty4_common//jar", + "@netty4_transport//jar", + "@netty4_transport_native_epoll//jar", + "@netty4_transport_native_unix_common//jar", ], ) @@ -50,7 +50,7 @@ java_test( deps = [ ":intellijext", "//ext/proto:intellijext_java_proto", - "//third_party/java/grpc:core", + "@io_grpc_grpc_java//core", "@junit//jar", "@truth//jar", ], diff --git a/ext/proto/BUILD b/ext/proto/BUILD index 4f53b727069..b3d63ddbb6a 100644 --- a/ext/proto/BUILD +++ b/ext/proto/BUILD @@ -1,10 +1,9 @@ -load("//third_party/java/grpc:build_defs.bzl", "java_grpc_library") -load("//net/grpc/go/build_defs:go_grpc_library.bzl", "go_grpc_library") +load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_grpc_library", "go_proto_library") proto_library( name = "intellijext_proto", srcs = ["intellijext.proto"], - has_services = 1, use_java_stubby_library = True, )