xref: /aosp_15_r20/external/grpc-grpc-java/examples/example-hostname/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/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
20java_library(
21    name = "hostname_greeter",
22    testonly = 1,
23    srcs = [
24        "src/main/java/io/grpc/examples/hostname/HostnameGreeter.java",
25    ],
26    deps = [
27        ":helloworld_java_grpc",
28        ":helloworld_java_proto",
29        "@io_grpc_grpc_java//stub",
30    ],
31)
32
33java_binary(
34    name = "hostname-server",
35    testonly = 1,
36    srcs = [
37        "src/main/java/io/grpc/examples/hostname/HostnameServer.java",
38    ],
39    main_class = "io.grpc.examples.hostname.HostnameServer",
40    runtime_deps = [
41        "@io_grpc_grpc_java//netty",
42    ],
43    deps = [
44        ":hostname_greeter",
45        "@io_grpc_grpc_java//api",
46        "@io_grpc_grpc_java//services:health",
47        "@io_grpc_grpc_java//services:reflection",
48        "@io_grpc_grpc_proto//:health_java_proto",
49    ],
50)
51