Skip to content

Commit

Permalink
netty: Add Bazel target similar to netty-shaded
Browse files Browse the repository at this point in the history
  • Loading branch information
ejona86 committed Aug 21, 2019
1 parent d5b63e9 commit 63661c7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
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(
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

0 comments on commit 63661c7

Please sign in to comment.