1load("//:java_grpc_library.bzl", "java_grpc_library") 2 3java_library( 4 name = "alts_internal", 5 srcs = glob([ 6 "src/main/java/io/grpc/alts/internal/*.java", 7 ]), 8 deps = [ 9 ":handshaker_java_grpc", 10 ":handshaker_java_proto", 11 "//core", 12 "//core:internal", 13 "//netty", 14 "//stub", 15 "@com_google_code_findbugs_jsr305//jar", 16 "@com_google_guava_guava//jar", 17 "@com_google_protobuf//:protobuf_java", 18 "@com_google_protobuf//:protobuf_java_util", 19 "@io_netty_netty_buffer//jar", 20 "@io_netty_netty_codec//jar", 21 "@io_netty_netty_common//jar", 22 "@io_netty_netty_handler//jar", 23 "@io_netty_netty_transport//jar", 24 ], 25) 26 27java_library( 28 name = "alts", 29 srcs = glob([ 30 "src/main/java/io/grpc/alts/*.java", 31 ]), 32 visibility = ["//visibility:public"], 33 runtime_deps = ["//grpclb"], 34 deps = [ 35 ":alts_internal", 36 ":handshaker_java_grpc", 37 "//core", 38 "//core:internal", 39 "//auth", 40 "//netty", 41 "@com_google_auth_google_auth_library_oauth2_http//jar", 42 "@com_google_code_findbugs_jsr305//jar", 43 "@com_google_guava_guava//jar", 44 "@io_netty_netty_common//jar", 45 "@io_netty_netty_handler//jar", 46 "@io_netty_netty_transport//jar", 47 "@org_apache_commons_commons_lang3//jar", 48 ], 49) 50 51# bazel only accepts proto import with absolute path. 52genrule( 53 name = "protobuf_imports", 54 srcs = glob(["src/main/proto/grpc/gcp/*.proto"]), 55 outs = [ 56 "protobuf_out/grpc/gcp/altscontext.proto", 57 "protobuf_out/grpc/gcp/handshaker.proto", 58 "protobuf_out/grpc/gcp/transport_security_common.proto", 59 ], 60 cmd = "for fname in $(SRCS); do " + 61 "sed 's,import \",import \"alts/protobuf_out/,g' $$fname > " + 62 "$(@D)/protobuf_out/grpc/gcp/$$(basename $$fname); done", 63) 64 65proto_library( 66 name = "handshaker_proto", 67 srcs = [ 68 "protobuf_out/grpc/gcp/altscontext.proto", 69 "protobuf_out/grpc/gcp/handshaker.proto", 70 "protobuf_out/grpc/gcp/transport_security_common.proto", 71 ], 72) 73 74java_proto_library( 75 name = "handshaker_java_proto", 76 deps = [":handshaker_proto"], 77) 78 79java_grpc_library( 80 name = "handshaker_java_grpc", 81 srcs = [":handshaker_proto"], 82 deps = [":handshaker_java_proto"], 83) 84