BUILD.bazel 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. load("@rules_proto//proto:defs.bzl", "proto_library")
  2. # This is an API workspace, having public visibility by default makes perfect sense.
  3. package(default_visibility = ["//visibility:public"])
  4. ##############################################################################
  5. # Common
  6. ##############################################################################
  7. load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
  8. proto_library(
  9. name = "operations_proto",
  10. srcs = ["operations.proto"],
  11. deps = [
  12. "//google/api:annotations_proto",
  13. "//google/api:client_proto",
  14. "//google/rpc:status_proto",
  15. "@com_google_protobuf//:any_proto",
  16. "@com_google_protobuf//:descriptor_proto",
  17. "@com_google_protobuf//:duration_proto",
  18. "@com_google_protobuf//:empty_proto",
  19. ],
  20. )
  21. proto_library_with_info(
  22. name = "longrunning_proto_with_info",
  23. deps = [":operations_proto"],
  24. )
  25. ##############################################################################
  26. # Java
  27. ##############################################################################
  28. load("@com_google_googleapis_imports//:imports.bzl", "java_grpc_library", "java_proto_library")
  29. java_proto_library(
  30. name = "longrunning_java_proto",
  31. deps = [":operations_proto"],
  32. )
  33. java_grpc_library(
  34. name = "longrunning_java_grpc",
  35. srcs = [":operations_proto"],
  36. deps = [":longrunning_java_proto"],
  37. )
  38. ##############################################################################
  39. # Go
  40. ##############################################################################
  41. load(
  42. "@com_google_googleapis_imports//:imports.bzl",
  43. "go_gapic_assembly_pkg",
  44. "go_gapic_library",
  45. "go_proto_library",
  46. "go_test",
  47. )
  48. go_proto_library(
  49. name = "longrunning_go_proto",
  50. compilers = ["@io_bazel_rules_go//proto:go_grpc"],
  51. importpath = "google.golang.org/genproto/googleapis/longrunning",
  52. protos = [":operations_proto"],
  53. visibility = ["//visibility:public"],
  54. deps = [
  55. "//google/api:annotations_go_proto",
  56. "//google/rpc:status_go_proto",
  57. ],
  58. )
  59. go_gapic_library(
  60. name = "longrunning_go_gapic",
  61. srcs = [":longrunning_proto_with_info"],
  62. grpc_service_config = "longrunning_grpc_service_config.json",
  63. importpath = "cloud.google.com/go/longrunning/autogen;longrunning",
  64. service_yaml = "//google/longrunning:longrunning.yaml",
  65. deps = [":longrunning_go_proto"],
  66. )
  67. go_test(
  68. name = "longrunning_go_gapic_test",
  69. srcs = [":longrunning_go_gapic_srcjar_test"],
  70. embed = [":longrunning_go_gapic"],
  71. importpath = "cloud.google.com/go/longrunning/autogen",
  72. )
  73. # Open Source Packages
  74. go_gapic_assembly_pkg(
  75. name = "gapi-cloud-longrunning-go",
  76. deps = [
  77. ":longrunning_go_gapic",
  78. ":longrunning_go_gapic_srcjar-test.srcjar",
  79. ":longrunning_go_proto",
  80. ],
  81. )
  82. ##############################################################################
  83. # C++
  84. ##############################################################################
  85. load(
  86. "@com_google_googleapis_imports//:imports.bzl",
  87. "cc_grpc_library",
  88. "cc_proto_library",
  89. )
  90. cc_proto_library(
  91. name = "longrunning_cc_proto",
  92. deps = [":operations_proto"],
  93. )
  94. cc_grpc_library(
  95. name = "longrunning_cc_grpc",
  96. srcs = [":operations_proto"],
  97. grpc_only = True,
  98. deps = [":longrunning_cc_proto"],
  99. )