Skip to content

Commit

Permalink
bazel: Bazel services + grpc_proto dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
perezd authored and dapengzhang0 committed Mar 15, 2019
1 parent 1735adc commit e0477bb
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
11 changes: 11 additions & 0 deletions repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def grpc_java_repositories(
omit_com_google_truth_truth = False,
omit_com_squareup_okhttp = False,
omit_com_squareup_okio = False,
omit_io_grpc_grpc_proto = False,
omit_io_netty_buffer = False,
omit_io_netty_common = False,
omit_io_netty_transport = False,
Expand Down Expand Up @@ -80,6 +81,8 @@ def grpc_java_repositories(
com_squareup_okhttp()
if not omit_com_squareup_okio:
com_squareup_okio()
if not omit_io_grpc_grpc_proto:
io_grpc_grpc_proto()
if not omit_io_netty_buffer:
io_netty_buffer()
if not omit_io_netty_common:
Expand Down Expand Up @@ -299,6 +302,14 @@ def com_squareup_okio():
licenses = ["notice"], # Apache 2.0
)

def io_grpc_grpc_proto():
http_archive(
name = "io_grpc_grpc_proto",
sha256 = "873f3fdec7ed052f899aef83fc897926729713d96d7ccdb2df22843dc702ef3a",
strip_prefix = "grpc-proto-96ecba6941c67b1da2af598330c60cf9b0336051",
urls = ["https://github.com/grpc/grpc-proto/archive/96ecba6941c67b1da2af598330c60cf9b0336051.zip"],
)

def io_netty_buffer():
jvm_maven_import_external(
name = "io_netty_netty_buffer",
Expand Down
84 changes: 84 additions & 0 deletions services/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
load("//:java_grpc_library.bzl", "java_grpc_library")

package(default_visibility = ["//visibility:public"])

java_library(
name = "binarylog",
srcs = [
"src/main/java/io/grpc/services/BinaryLogProvider.java",
"src/main/java/io/grpc/services/BinaryLogProviderImpl.java",
"src/main/java/io/grpc/services/BinaryLogSink.java",
"src/main/java/io/grpc/services/BinlogHelper.java",
"src/main/java/io/grpc/services/InetAddressUtil.java",
"src/main/java/io/grpc/services/TempFileSink.java",
],
deps = [
"//context",
"//core",
"@com_google_code_findbugs_jsr305//jar",
"@com_google_guava_guava//jar",
"@com_google_protobuf//:protobuf_java",
"@com_google_protobuf//:protobuf_java_util",
"@com_google_re2j//jar",
"@io_grpc_grpc_proto//:binarylog_java_proto",
],
)

java_library(
name = "channelz",
srcs = [
"src/main/java/io/grpc/services/ChannelzProtoUtil.java",
"src/main/java/io/grpc/services/ChannelzService.java",
],
deps = [
":_channelz_java_grpc",
"//context",
"//core",
"//stub",
"@com_google_code_findbugs_jsr305//jar",
"@com_google_guava_guava//jar",
"@com_google_protobuf//:protobuf_java",
"@com_google_protobuf//:protobuf_java_util",
"@io_grpc_grpc_proto//:channelz_java_proto",
],
)

java_library(
name = "reflection",
srcs = [
"src/main/java/io/grpc/protobuf/services/ProtoReflectionService.java",
],
deps = [
":_reflection_java_grpc",
"//context",
"//core",
"//core:internal",
"//core:util",
"//protobuf",
"//stub",
"@com_google_code_findbugs_jsr305//jar",
"@com_google_guava_guava//jar",
"@com_google_protobuf//:protobuf_java",
"@com_google_protobuf//:protobuf_java_util",
"@com_google_re2j//jar",
"@io_grpc_grpc_proto//:reflection_java_proto_deprecated",
"@javax_annotation_javax_annotation_api//jar",
],
)

# These shouldn't be here, but this is better than having
# a circular dependency on grpc-proto and grpc-java.

java_grpc_library(
name = "_reflection_java_grpc",
srcs = ["@io_grpc_grpc_proto//:reflection_proto_deprecated"],
visibility = ["//visibility:private"],
deps = ["@io_grpc_grpc_proto//:reflection_java_proto_deprecated"],
)

java_grpc_library(
name = "_channelz_java_grpc",
srcs = ["@io_grpc_grpc_proto//:channelz_proto"],
visibility = ["//visibility:private"],
deps = ["@io_grpc_grpc_proto//:channelz_java_proto"],
)

0 comments on commit e0477bb

Please sign in to comment.