xref: /aosp_15_r20/external/grpc-grpc-java/examples/BUILD.bazel (revision e07d83d3ffcef9ecfc9f7f475418ec639ff0e5fe)
1load("@rules_proto//proto:defs.bzl", "proto_library")
2load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library")
3
4proto_library(
5    name = "helloworld_proto",
6    srcs = ["src/main/proto/helloworld.proto"],
7)
8
9java_proto_library(
10    name = "helloworld_java_proto",
11    deps = [":helloworld_proto"],
12)
13
14java_grpc_library(
15    name = "helloworld_java_grpc",
16    srcs = [":helloworld_proto"],
17    deps = [":helloworld_java_proto"],
18)
19
20proto_library(
21    name = "hello_streaming_proto",
22    srcs = [
23        "src/main/proto/hello_streaming.proto",
24    ],
25)
26
27java_proto_library(
28    name = "hello_streaming_java_proto",
29    deps = [":hello_streaming_proto"],
30)
31
32java_grpc_library(
33    name = "hello_streaming_java_grpc",
34    srcs = [":hello_streaming_proto"],
35    deps = [":hello_streaming_java_proto"],
36)
37
38proto_library(
39    name = "route_guide_proto",
40    srcs = ["src/main/proto/route_guide.proto"],
41)
42
43java_proto_library(
44    name = "route_guide_java_proto",
45    deps = [":route_guide_proto"],
46)
47
48java_grpc_library(
49    name = "route_guide_java_grpc",
50    srcs = [":route_guide_proto"],
51    deps = [":route_guide_java_proto"],
52)
53
54proto_library(
55    name = "echo_proto",
56    srcs = ["src/main/proto/grpc/examples/echo/echo.proto"],
57)
58
59java_proto_library(
60    name = "echo_java_proto",
61    deps = [":echo_proto"],
62)
63
64java_grpc_library(
65    name = "echo_java_grpc",
66    srcs = [":echo_proto"],
67    deps = [":echo_java_proto"],
68)
69
70java_library(
71    name = "examples",
72    testonly = 1,
73    srcs = glob(
74        ["src/main/java/**/*.java"],
75    ),
76    resources = glob(
77        ["src/main/resources/**"],
78    ),
79    runtime_deps = [
80        "@io_grpc_grpc_java//netty",
81    ],
82    deps = [
83        ":_health_java_grpc",
84        ":echo_java_grpc",
85        ":echo_java_proto",
86        ":hello_streaming_java_grpc",
87        ":hello_streaming_java_proto",
88        ":helloworld_java_grpc",
89        ":helloworld_java_proto",
90        ":route_guide_java_grpc",
91        ":route_guide_java_proto",
92        "@com_google_protobuf//:protobuf_java",
93        "@com_google_protobuf//:protobuf_java_util",
94        "@io_grpc_grpc_java//api",
95        "@io_grpc_grpc_java//context",
96        "@io_grpc_grpc_java//protobuf",
97        "@io_grpc_grpc_java//services:health",
98        "@io_grpc_grpc_java//services:healthlb",
99        "@io_grpc_grpc_java//stub",
100        "@io_grpc_grpc_proto//:health_proto",
101        "@io_grpc_grpc_proto//:health_java_proto",
102        "@maven//:com_google_api_grpc_proto_google_common_protos",
103        "@maven//:com_google_code_findbugs_jsr305",
104        "@maven//:com_google_code_gson_gson",
105        "@maven//:com_google_guava_guava",
106    ],
107)
108
109java_binary(
110    name = "hello-world-client",
111    testonly = 1,
112    main_class = "io.grpc.examples.helloworld.HelloWorldClient",
113    runtime_deps = [
114        ":examples",
115    ],
116)
117
118java_binary(
119    name = "hello-world-server",
120    testonly = 1,
121    main_class = "io.grpc.examples.helloworld.HelloWorldServer",
122    runtime_deps = [
123        ":examples",
124    ],
125)
126
127java_binary(
128    name = "route-guide-client",
129    testonly = 1,
130    main_class = "io.grpc.examples.routeguide.RouteGuideClient",
131    runtime_deps = [
132        ":examples",
133    ],
134)
135
136java_binary(
137    name = "route-guide-server",
138    testonly = 1,
139    main_class = "io.grpc.examples.routeguide.RouteGuideServer",
140    runtime_deps = [
141        ":examples",
142    ],
143)
144
145java_binary(
146    name = "manual-flow-control-client",
147    testonly = 1,
148    main_class = "io.grpc.examples.manualflowcontrol.ManualFlowControlClient",
149    runtime_deps = [
150        ":examples",
151    ],
152)
153
154java_binary(
155    name = "manual-flow-control-server",
156    testonly = 1,
157    main_class = "io.grpc.examples.manualflowcontrol.ManualFlowControlServer",
158    runtime_deps = [
159        ":examples",
160    ],
161)
162
163java_binary(
164    name = "load-balance-client",
165    testonly = 1,
166    main_class = "io.grpc.examples.loadbalance.LoadBalanceClient",
167    runtime_deps = [
168        ":examples",
169    ],
170)
171
172java_binary(
173    name = "load-balance-server",
174    testonly = 1,
175    main_class = "io.grpc.examples.loadbalance.LoadBalanceServer",
176    runtime_deps = [
177        ":examples",
178    ],
179)
180
181java_binary(
182    name = "custom-load-balance-client",
183    testonly = 1,
184    main_class = "io.grpc.examples.customloadbalance.CustomLoadBalanceClient",
185    runtime_deps = [
186        ":examples",
187    ],
188)
189
190java_binary(
191    name = "name-resolve-client",
192    testonly = 1,
193    main_class = "io.grpc.examples.nameresolve.NameResolveClient",
194    runtime_deps = [
195        ":examples",
196    ],
197)
198
199java_binary(
200    name = "name-resolve-server",
201    testonly = 1,
202    main_class = "io.grpc.examples.nameresolve.NameResolveServer",
203    runtime_deps = [
204        ":examples",
205    ],
206)
207
208java_binary(
209    name = "deadline-server",
210    testonly = 1,
211    main_class = "io.grpc.examples.deadline.DeadlineServer",
212    runtime_deps = [
213        ":examples",
214    ],
215)
216
217java_binary(
218    name = "deadline-client",
219    testonly = 1,
220    main_class = "io.grpc.examples.deadline.DeadlineClient",
221    runtime_deps = [
222        ":examples",
223    ],
224)
225
226java_binary(
227    name = "healthservice-server",
228    testonly = 1,
229    main_class = "io.grpc.examples.healthservice.HealthServiceServer",
230    runtime_deps = [
231        ":examples",
232    ],
233)
234
235java_binary(
236    name = "healthservice-client",
237    testonly = 1,
238    main_class = "io.grpc.examples.healthservice.HealthServiceClient",
239    runtime_deps = [
240        ":examples",
241    ],
242)
243
244java_grpc_library(
245    name = "_health_java_grpc",
246    srcs = ["@io_grpc_grpc_proto//:health_proto"],
247    visibility = ["//visibility:private"],
248    deps = ["@io_grpc_grpc_proto//:health_java_proto"],
249)
250
251