Imported Upstream version 1.21.0
[platform/upstream/grpc.git] / examples / BUILD
1 # Copyright 2017 gRPC authors.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 licenses(["notice"])  # 3-clause BSD
16
17 package(default_visibility = ["//visibility:public"])
18
19 load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
20 load("//bazel:cc_grpc_library.bzl", "cc_grpc_library")
21 load("//bazel:python_rules.bzl", "py_proto_library")
22
23 grpc_proto_library(
24     name = "auth_sample",
25     srcs = ["protos/auth_sample.proto"],
26 )
27
28 grpc_proto_library(
29     name = "hellostreamingworld",
30     srcs = ["protos/hellostreamingworld.proto"],
31 )
32
33 # The following three rules demonstrate the usage of the cc_grpc_library rule in
34 # in a mode compatible with the native proto_library and cc_proto_library rules.
35 proto_library(
36     name = "helloworld_proto",
37     srcs = ["protos/helloworld.proto"],
38 )
39
40 cc_proto_library(
41     name = "helloworld_cc_proto",
42     deps = [":helloworld_proto"],
43 )
44
45 cc_grpc_library(
46     name = "helloworld_cc_grpc",
47     srcs = [":helloworld_proto"],
48     grpc_only = True,
49     deps = [":helloworld_cc_proto"],
50 )
51
52 grpc_proto_library(
53     name = "route_guide",
54     srcs = ["protos/route_guide.proto"],
55 )
56
57 grpc_proto_library(
58     name = "keyvaluestore",
59     srcs = ["protos/keyvaluestore.proto"],
60 )
61
62 proto_library(
63     name = "helloworld_proto_descriptor",
64     srcs = ["protos/helloworld.proto"],
65 )
66
67 py_proto_library(
68     name = "py_helloworld",
69     deps = [":helloworld_proto_descriptor"],
70 )
71
72 cc_binary(
73     name = "greeter_client",
74     srcs = ["cpp/helloworld/greeter_client.cc"],
75     defines = ["BAZEL_BUILD"],
76     deps = [
77         ":helloworld_cc_grpc",
78         "//:grpc++",
79     ],
80 )
81
82 cc_binary(
83     name = "greeter_async_client",
84     srcs = ["cpp/helloworld/greeter_async_client.cc"],
85     defines = ["BAZEL_BUILD"],
86     deps = [
87         ":helloworld_cc_grpc",
88         "//:grpc++",
89     ],
90 )
91
92 cc_binary(
93     name = "greeter_async_client2",
94     srcs = ["cpp/helloworld/greeter_async_client2.cc"],
95     defines = ["BAZEL_BUILD"],
96     deps = [
97         ":helloworld_cc_grpc",
98         "//:grpc++",
99     ],
100 )
101
102 cc_binary(
103     name = "greeter_server",
104     srcs = ["cpp/helloworld/greeter_server.cc"],
105     defines = ["BAZEL_BUILD"],
106     deps = [
107         ":helloworld_cc_grpc",
108         "//:grpc++",
109     ],
110 )
111
112 cc_binary(
113     name = "greeter_async_server",
114     srcs = ["cpp/helloworld/greeter_async_server.cc"],
115     defines = ["BAZEL_BUILD"],
116     deps = [
117         ":helloworld_cc_grpc",
118         "//:grpc++",
119     ],
120 )
121
122 cc_binary(
123     name = "metadata_client",
124     srcs = ["cpp/metadata/greeter_client.cc"],
125     defines = ["BAZEL_BUILD"],
126     deps = [
127         ":helloworld_cc_grpc",
128         "//:grpc++",
129     ],
130 )
131
132 cc_binary(
133     name = "metadata_server",
134     srcs = ["cpp/metadata/greeter_server.cc"],
135     defines = ["BAZEL_BUILD"],
136     deps = [
137         ":helloworld_cc_grpc",
138         "//:grpc++",
139     ],
140 )
141
142 cc_binary(
143     name = "lb_client",
144     srcs = ["cpp/load_balancing/greeter_client.cc"],
145     defines = ["BAZEL_BUILD"],
146     deps = [
147         ":helloworld_cc_grpc",
148         "//:grpc++",
149     ],
150 )
151
152 cc_binary(
153     name = "lb_server",
154     srcs = ["cpp/load_balancing/greeter_server.cc"],
155     defines = ["BAZEL_BUILD"],
156     deps = [
157         ":helloworld_cc_grpc",
158         "//:grpc++",
159     ],
160 )
161
162 cc_binary(
163     name = "compression_client",
164     srcs = ["cpp/compression/greeter_client.cc"],
165     defines = ["BAZEL_BUILD"],
166     deps = [
167         ":helloworld_cc_grpc",
168         "//:grpc++",
169     ],
170 )
171
172 cc_binary(
173     name = "compression_server",
174     srcs = ["cpp/compression/greeter_server.cc"],
175     defines = ["BAZEL_BUILD"],
176     deps = [
177         ":helloworld_cc_grpc",
178         "//:grpc++",
179     ],
180 )
181
182 cc_binary(
183     name = "keyvaluestore_client",
184     srcs = [
185         "cpp/keyvaluestore/caching_interceptor.h",
186         "cpp/keyvaluestore/client.cc",
187     ],
188     defines = ["BAZEL_BUILD"],
189     deps = [
190         ":keyvaluestore",
191         "//:grpc++",
192     ],
193 )
194
195 cc_binary(
196     name = "keyvaluestore_server",
197     srcs = ["cpp/keyvaluestore/server.cc"],
198     defines = ["BAZEL_BUILD"],
199     deps = [
200         ":keyvaluestore",
201         "//:grpc++",
202     ],
203 )
204
205 cc_binary(
206     name = "route_guide_client",
207     srcs = [
208         "cpp/route_guide/helper.cc",
209         "cpp/route_guide/helper.h",
210         "cpp/route_guide/route_guide_client.cc",
211     ],
212     data = ["cpp/route_guide/route_guide_db.json"],
213     defines = ["BAZEL_BUILD"],
214     deps = [
215         ":route_guide",
216         "//:grpc++",
217     ],
218 )
219
220 cc_binary(
221     name = "route_guide_server",
222     srcs = [
223         "cpp/route_guide/helper.cc",
224         "cpp/route_guide/helper.h",
225         "cpp/route_guide/route_guide_server.cc",
226     ],
227     data = ["cpp/route_guide/route_guide_db.json"],
228     defines = ["BAZEL_BUILD"],
229     deps = [
230         ":route_guide",
231         "//:grpc++",
232     ],
233 )