Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit bc1774e

Browse files
g-easyBogdan Drutu
authored andcommitted
Use proto best practices. (#325)
* Use proto best practices. * proto_library * cc_proto_library * cc_grpc_library * format
1 parent df271c4 commit bc1774e

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

examples/grpc/BUILD

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,21 @@ licenses(["notice"]) # Apache License 2.0
1919

2020
package(default_visibility = ["//visibility:private"])
2121

22-
cc_grpc_library(
22+
proto_library(
2323
name = "hello_proto",
2424
srcs = ["hello.proto"],
25-
proto_only = False,
26-
use_external = True,
27-
well_known_protos = False,
28-
deps = [],
25+
)
26+
27+
cc_proto_library(
28+
name = "hello_cc_proto",
29+
deps = [":hello_proto"],
30+
)
31+
32+
cc_grpc_library(
33+
name = "hello_cc_grpc",
34+
srcs = [":hello_proto"],
35+
grpc_only = True,
36+
deps = [":hello_cc_proto"],
2937
)
3038

3139
cc_library(
@@ -45,7 +53,8 @@ cc_binary(
4553
srcs = ["hello_client.cc"],
4654
copts = DEFAULT_COPTS,
4755
deps = [
48-
":hello_proto",
56+
":hello_cc_grpc",
57+
":hello_cc_proto",
4958
":stackdriver",
5059
"//opencensus/exporters/stats/stackdriver:stackdriver_exporter",
5160
"//opencensus/exporters/stats/stdout:stdout_exporter",
@@ -64,7 +73,8 @@ cc_binary(
6473
srcs = ["hello_server.cc"],
6574
copts = DEFAULT_COPTS,
6675
deps = [
67-
":hello_proto",
76+
":hello_cc_grpc",
77+
":hello_cc_proto",
6878
":stackdriver",
6979
"//opencensus/exporters/stats/prometheus:prometheus_exporter",
7080
"//opencensus/exporters/stats/stackdriver:stackdriver_exporter",

0 commit comments

Comments
 (0)