• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15licenses(["notice"])  # 3-clause BSD
16
17package(default_visibility = ["//visibility:public"])
18
19load("@grpc_python_dependencies//:requirements.bzl", "requirement")
20load("@rules_proto//proto:defs.bzl", "proto_library")
21load("//bazel:cc_grpc_library.bzl", "cc_grpc_library")
22load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
23load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library")
24
25grpc_proto_library(
26    name = "auth_sample",
27    srcs = ["protos/auth_sample.proto"],
28)
29
30grpc_proto_library(
31    name = "hellostreamingworld",
32    srcs = ["protos/hellostreamingworld.proto"],
33)
34
35# The following three rules demonstrate the usage of the cc_grpc_library rule in
36# in a mode compatible with the native proto_library and cc_proto_library rules.
37proto_library(
38    name = "helloworld_proto",
39    srcs = ["protos/helloworld.proto"],
40)
41
42cc_proto_library(
43    name = "helloworld_cc_proto",
44    deps = [":helloworld_proto"],
45)
46
47cc_grpc_library(
48    name = "helloworld_cc_grpc",
49    srcs = [":helloworld_proto"],
50    grpc_only = True,
51    deps = [":helloworld_cc_proto"],
52)
53
54grpc_proto_library(
55    name = "route_guide",
56    srcs = ["protos/route_guide.proto"],
57)
58
59grpc_proto_library(
60    name = "keyvaluestore",
61    srcs = ["protos/keyvaluestore.proto"],
62)
63
64proto_library(
65    name = "protos/helloworld_proto",
66    srcs = ["protos/helloworld.proto"],
67)
68
69py_proto_library(
70    name = "helloworld_py_pb2",
71    deps = [":protos/helloworld_proto"],
72)
73
74py_grpc_library(
75    name = "helloworld_py_pb2_grpc",
76    srcs = [":protos/helloworld_proto"],
77    deps = [":helloworld_py_pb2"],
78)
79
80cc_binary(
81    name = "greeter_client",
82    srcs = ["cpp/helloworld/greeter_client.cc"],
83    defines = ["BAZEL_BUILD"],
84    deps = [
85        ":helloworld_cc_grpc",
86        "//:grpc++",
87    ],
88)
89
90cc_binary(
91    name = "greeter_async_client",
92    srcs = ["cpp/helloworld/greeter_async_client.cc"],
93    defines = ["BAZEL_BUILD"],
94    deps = [
95        ":helloworld_cc_grpc",
96        "//:grpc++",
97    ],
98)
99
100cc_binary(
101    name = "greeter_async_client2",
102    srcs = ["cpp/helloworld/greeter_async_client2.cc"],
103    defines = ["BAZEL_BUILD"],
104    deps = [
105        ":helloworld_cc_grpc",
106        "//:grpc++",
107    ],
108)
109
110cc_binary(
111    name = "greeter_server",
112    srcs = ["cpp/helloworld/greeter_server.cc"],
113    defines = ["BAZEL_BUILD"],
114    deps = [
115        ":helloworld_cc_grpc",
116        "//:grpc++",
117        "//:grpc++_reflection",
118    ],
119)
120
121cc_binary(
122    name = "greeter_async_server",
123    srcs = ["cpp/helloworld/greeter_async_server.cc"],
124    defines = ["BAZEL_BUILD"],
125    deps = [
126        ":helloworld_cc_grpc",
127        "//:grpc++",
128    ],
129)
130
131cc_binary(
132    name = "metadata_client",
133    srcs = ["cpp/metadata/greeter_client.cc"],
134    defines = ["BAZEL_BUILD"],
135    deps = [
136        ":helloworld_cc_grpc",
137        "//:grpc++",
138    ],
139)
140
141cc_binary(
142    name = "metadata_server",
143    srcs = ["cpp/metadata/greeter_server.cc"],
144    defines = ["BAZEL_BUILD"],
145    deps = [
146        ":helloworld_cc_grpc",
147        "//:grpc++",
148    ],
149)
150
151cc_binary(
152    name = "lb_client",
153    srcs = ["cpp/load_balancing/greeter_client.cc"],
154    defines = ["BAZEL_BUILD"],
155    deps = [
156        ":helloworld_cc_grpc",
157        "//:grpc++",
158    ],
159)
160
161cc_binary(
162    name = "lb_server",
163    srcs = ["cpp/load_balancing/greeter_server.cc"],
164    defines = ["BAZEL_BUILD"],
165    deps = [
166        ":helloworld_cc_grpc",
167        "//:grpc++",
168    ],
169)
170
171cc_binary(
172    name = "compression_client",
173    srcs = ["cpp/compression/greeter_client.cc"],
174    defines = ["BAZEL_BUILD"],
175    deps = [
176        ":helloworld_cc_grpc",
177        "//:grpc++",
178    ],
179)
180
181cc_binary(
182    name = "compression_server",
183    srcs = ["cpp/compression/greeter_server.cc"],
184    defines = ["BAZEL_BUILD"],
185    deps = [
186        ":helloworld_cc_grpc",
187        "//:grpc++",
188    ],
189)
190
191cc_binary(
192    name = "keyvaluestore_client",
193    srcs = [
194        "cpp/keyvaluestore/caching_interceptor.h",
195        "cpp/keyvaluestore/client.cc",
196    ],
197    defines = ["BAZEL_BUILD"],
198    deps = [
199        ":keyvaluestore",
200        "//:grpc++",
201    ],
202)
203
204cc_binary(
205    name = "keyvaluestore_server",
206    srcs = ["cpp/keyvaluestore/server.cc"],
207    defines = ["BAZEL_BUILD"],
208    deps = [
209        ":keyvaluestore",
210        "//:grpc++",
211    ],
212)
213
214cc_binary(
215    name = "route_guide_client",
216    srcs = [
217        "cpp/route_guide/helper.cc",
218        "cpp/route_guide/helper.h",
219        "cpp/route_guide/route_guide_client.cc",
220    ],
221    data = ["cpp/route_guide/route_guide_db.json"],
222    defines = ["BAZEL_BUILD"],
223    deps = [
224        ":route_guide",
225        "//:grpc++",
226    ],
227)
228
229cc_binary(
230    name = "route_guide_server",
231    srcs = [
232        "cpp/route_guide/helper.cc",
233        "cpp/route_guide/helper.h",
234        "cpp/route_guide/route_guide_server.cc",
235    ],
236    data = ["cpp/route_guide/route_guide_db.json"],
237    defines = ["BAZEL_BUILD"],
238    deps = [
239        ":route_guide",
240        "//:grpc++",
241    ],
242)
243
244proto_library(
245    name = "route_guide_proto",
246    srcs = ["protos/route_guide.proto"],
247)
248