-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
Copy pathBUILD.bazel
87 lines (81 loc) · 2.56 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
load("@rules_jvm_external//:defs.bzl", "artifact")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//:java_grpc_library.bzl", "java_grpc_library")
java_library(
name = "alts_internal",
srcs = glob([
"src/main/java/io/grpc/alts/internal/*.java",
]),
deps = [
":handshaker_java_grpc",
":handshaker_java_proto",
"//api",
"//core:internal",
"//grpclb",
"//netty",
"//stub",
"@com_google_protobuf//:protobuf_java",
"@com_google_protobuf//:protobuf_java_util",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
artifact("io.netty:netty-buffer"),
artifact("io.netty:netty-codec"),
artifact("io.netty:netty-common"),
artifact("io.netty:netty-handler"),
artifact("io.netty:netty-transport"),
],
)
java_library(
name = "alts",
srcs = glob([
"src/main/java/io/grpc/alts/*.java",
]),
visibility = ["//visibility:public"],
deps = [
":alts_internal",
":handshaker_java_grpc",
":handshaker_java_proto",
"//api",
"//auth",
"//core:internal",
"//netty",
artifact("com.google.auth:google-auth-library-oauth2-http"),
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
artifact("io.netty:netty-common"),
artifact("io.netty:netty-handler"),
artifact("io.netty:netty-transport"),
],
)
# bazel only accepts proto import with absolute path.
genrule(
name = "protobuf_imports",
srcs = glob(["src/main/proto/grpc/gcp/*.proto"]),
outs = [
"protobuf_out/grpc/gcp/altscontext.proto",
"protobuf_out/grpc/gcp/handshaker.proto",
"protobuf_out/grpc/gcp/transport_security_common.proto",
],
cmd = "for fname in $(SRCS); do " +
"sed 's,import \",import \"alts/protobuf_out/,g' $$fname > " +
"$(@D)/protobuf_out/grpc/gcp/$$(basename $$fname); done",
)
proto_library(
name = "handshaker_proto",
srcs = [
"protobuf_out/grpc/gcp/altscontext.proto",
"protobuf_out/grpc/gcp/handshaker.proto",
"protobuf_out/grpc/gcp/transport_security_common.proto",
],
)
java_proto_library(
name = "handshaker_java_proto",
deps = [":handshaker_proto"],
)
java_grpc_library(
name = "handshaker_java_grpc",
srcs = [":handshaker_proto"],
deps = [":handshaker_java_proto"],
)