Skip to content

Commit

Permalink
Fix intellij-ext service dependencies to build with Bazel
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 556864915
  • Loading branch information
mai93 authored and copybara-github committed Aug 14, 2023
1 parent 5843e0b commit dce9aa0
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 18 deletions.
82 changes: 82 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -623,3 +623,85 @@ 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 = "io_netty_netty_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 = "io_netty_netty_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 = "io_netty_netty_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 = "io_netty_netty_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"],
)

# io_grpc_grpc_java dependencies
load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS", "grpc_java_repositories")
grpc_java_repositories()

# Java Maven-based repositories.
http_archive(
name = "rules_jvm_external",
sha256 = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca",
strip_prefix = "rules_jvm_external-4.2",
url = "https://github.com/bazelbuild/rules_jvm_external/archive/4.2.zip",
)

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
rules_jvm_external_deps()

load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")
rules_jvm_external_setup()

load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = IO_GRPC_GRPC_JAVA_ARTIFACTS,
generate_compat_repositories = True,
override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS,
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
"https://repository.mulesoft.org/nexus/content/repositories/public",
],
)

load("@maven//:compat.bzl", "compat_repositories")
compat_repositories()
26 changes: 13 additions & 13 deletions ext/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"@io_netty_netty_common//jar",
"@io_netty_netty_transport//jar",
"@io_netty_netty_transport_native_epoll//jar",
"@io_netty_netty_transport_native_unix_common//jar",
],
)

Expand All @@ -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",
"@io_netty_netty_common//jar",
"@io_netty_netty_transport//jar",
"@io_netty_netty_transport_native_epoll//jar",
"@io_netty_netty_transport_native_unix_common//jar",
],
)

Expand All @@ -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",
],
Expand Down
7 changes: 2 additions & 5 deletions ext/proto/BUILD
Original file line number Diff line number Diff line change
@@ -1,11 +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,
)

java_proto_library(
Expand All @@ -29,7 +27,6 @@ go_proto_library(

go_grpc_library(
name = "intellijext_go_grpc",
srcs = [":intellijext_proto"],
visibility = ["//visibility:public"],
deps = [":intellijext_go_proto"],
)

0 comments on commit dce9aa0

Please sign in to comment.