Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netty: Add Bazel target similar to netty-shaded #6087

Merged
merged 1 commit into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions netty/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,11 @@ java_library(
"@io_perfmark_perfmark_api//jar",
],
)

# Not actually shaded, but mirrors the shaded dependencies included in the
# artifact on Maven Central for usage with maven_install's override_targets.
java_library(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this only work on Linux?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Epoll is Linux-only, by definition. It doesn't break on other platforms though.

name = "shaded",
visibility = ["//visibility:public"],
exports = ["//netty/shaded"],
)
10 changes: 10 additions & 0 deletions netty/shaded/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Publicly exposed in //netty package. Purposefully does not export any symbols.
java_library(
name = "shaded",
visibility = ["//netty:__pkg__"],
runtime_deps = [
"//netty",
"@io_netty_netty_tcnative_boringssl_static//jar",
"@io_netty_netty_transport_native_epoll//jar",
],
)
12 changes: 12 additions & 0 deletions repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def grpc_java_repositories(
omit_io_netty_buffer = False,
omit_io_netty_common = False,
omit_io_netty_transport = False,
omit_io_netty_transport_native_epoll = False,
omit_io_netty_codec = False,
omit_io_netty_codec_socks = False,
omit_io_netty_codec_http = False,
Expand Down Expand Up @@ -84,6 +85,8 @@ def grpc_java_repositories(
io_netty_common()
if not omit_io_netty_transport:
io_netty_transport()
if not omit_io_netty_transport_native_epoll:
io_netty_transport_native_epoll()
if not omit_io_netty_codec:
io_netty_codec()
if not omit_io_netty_codec_socks:
Expand Down Expand Up @@ -383,6 +386,15 @@ def io_netty_transport():
licenses = ["notice"], # Apache 2.0
)

def io_netty_transport_native_epoll():
jvm_maven_import_external(
name = "io_netty_netty_transport_native_epoll",
artifact = "io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.38.Final",
server_urls = ["http://central.maven.org/maven2"],
artifact_sha256 = "7933467e1cfc37bc6fb3f22af471ed69cb66bebaceab73d2041772bb6a38218a",
licenses = ["notice"], # Apache 2.0
)

def io_opencensus_api():
jvm_maven_import_external(
name = "io_opencensus_opencensus_api",
Expand Down