BUILD.bazel 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. # This file was automatically generated by BuildFileGenerator
  2. # https://github.com/googleapis/rules_gapic/tree/master/bazel
  3. # Most of the manual changes to this file will be overwritten.
  4. # It's **only** allowed to change the following rule attribute values:
  5. # - names of *_gapic_assembly_* rules
  6. # - certain parameters of *_gapic_library rules, including but not limited to:
  7. # * extra_protoc_parameters
  8. # * extra_protoc_file_parameters
  9. # The complete list of preserved parameters can be found in the source code.
  10. ##############################################################################
  11. # Common
  12. ##############################################################################
  13. load("@rules_proto//proto:defs.bzl", "proto_library")
  14. load(
  15. "@com_google_googleapis_imports//:imports.bzl",
  16. "cc_grpc_library",
  17. "cc_proto_library",
  18. "csharp_gapic_assembly_pkg",
  19. "csharp_gapic_library",
  20. "csharp_grpc_library",
  21. "csharp_proto_library",
  22. "go_gapic_assembly_pkg",
  23. "go_gapic_library",
  24. "go_proto_library",
  25. "go_test",
  26. "java_gapic_assembly_gradle_pkg",
  27. "java_gapic_library",
  28. "java_gapic_test",
  29. "java_grpc_library",
  30. "java_proto_library",
  31. "nodejs_gapic_assembly_pkg",
  32. "nodejs_gapic_library",
  33. "php_gapic_assembly_pkg",
  34. "php_gapic_library",
  35. "php_grpc_library",
  36. "php_proto_library",
  37. "proto_library_with_info",
  38. "py_gapic_assembly_pkg",
  39. "py_gapic_library",
  40. "py_test",
  41. "ruby_cloud_gapic_library",
  42. "ruby_gapic_assembly_pkg",
  43. "ruby_grpc_library",
  44. "ruby_proto_library",
  45. )
  46. # This is an API workspace, having public visibility by default makes perfect sense.
  47. package(default_visibility = ["//visibility:public"])
  48. proto_library(
  49. name = "library_proto",
  50. srcs = [
  51. "library.proto",
  52. ],
  53. deps = [
  54. "//google/api:annotations_proto",
  55. "//google/api:client_proto",
  56. "//google/api:field_behavior_proto",
  57. "//google/api:resource_proto",
  58. "@com_google_protobuf//:empty_proto",
  59. "@com_google_protobuf//:field_mask_proto",
  60. ],
  61. )
  62. proto_library_with_info(
  63. name = "library_proto_with_info",
  64. deps = [
  65. ":library_proto",
  66. "//google/cloud:common_resources_proto",
  67. ],
  68. )
  69. java_proto_library(
  70. name = "library_java_proto",
  71. deps = [":library_proto"],
  72. )
  73. java_grpc_library(
  74. name = "library_java_grpc",
  75. srcs = [":library_proto"],
  76. deps = [":library_java_proto"],
  77. )
  78. java_gapic_library(
  79. name = "library_java_gapic",
  80. srcs = [":library_proto_with_info"],
  81. gapic_yaml = "library_example_gapic.yaml",
  82. grpc_service_config = "library_grpc_service_config.json",
  83. rest_numeric_enums = False,
  84. test_deps = [
  85. ":library_java_grpc",
  86. ],
  87. transport = "grpc+rest",
  88. deps = [
  89. ":library_java_proto",
  90. ],
  91. )
  92. java_gapic_test(
  93. name = "library_java_gapic_test_suite",
  94. test_classes = [
  95. "com.google.cloud.example.library.v1.LibraryServiceClientHttpJsonTest",
  96. "com.google.cloud.example.library.v1.LibraryServiceClientTest",
  97. ],
  98. runtime_deps = [":library_java_gapic_test"],
  99. )
  100. # Open Source Packages
  101. java_gapic_assembly_gradle_pkg(
  102. name = "google-cloud-example-library-v1-java",
  103. include_samples = True,
  104. transport = "grpc+rest",
  105. deps = [
  106. ":library_java_gapic",
  107. ":library_java_grpc",
  108. ":library_java_proto",
  109. ":library_proto",
  110. ],
  111. )
  112. go_proto_library(
  113. name = "library_go_proto",
  114. compilers = ["@io_bazel_rules_go//proto:go_grpc"],
  115. importpath = "google.golang.org/genproto/googleapis/example/library/v1",
  116. protos = [":library_proto"],
  117. deps = [
  118. "//google/api:annotations_go_proto",
  119. ],
  120. )
  121. go_gapic_library(
  122. name = "library_go_gapic",
  123. srcs = [":library_proto_with_info"],
  124. grpc_service_config = "library_grpc_service_config.json",
  125. importpath = "google.golang.org/google/example/library/v1;library",
  126. metadata = True,
  127. rest_numeric_enums = False,
  128. service_yaml = "//google/example/library:library_example_v1.yaml",
  129. transport = "grpc+rest",
  130. deps = [
  131. ":library_go_proto",
  132. ],
  133. )
  134. go_test(
  135. name = "library_go_gapic_test",
  136. srcs = [":library_go_gapic_srcjar_test"],
  137. embed = [":library_go_gapic"],
  138. importpath = "google.golang.org/google/example/library/v1",
  139. )
  140. # Open Source Packages
  141. go_gapic_assembly_pkg(
  142. name = "gapi-cloud-example-library-v1-go",
  143. deps = [
  144. ":library_go_gapic",
  145. ":library_go_gapic_srcjar-metadata.srcjar",
  146. ":library_go_gapic_srcjar-test.srcjar",
  147. ":library_go_proto",
  148. ],
  149. )
  150. py_gapic_library(
  151. name = "library_py_gapic",
  152. srcs = [":library_proto"],
  153. grpc_service_config = "library_grpc_service_config.json",
  154. rest_numeric_enums = False,
  155. transport = "grpc",
  156. )
  157. py_test(
  158. name = "library_py_gapic_test",
  159. srcs = [
  160. "library_py_gapic_pytest.py",
  161. "library_py_gapic_test.py",
  162. ],
  163. legacy_create_init = False,
  164. deps = [":library_py_gapic"],
  165. )
  166. # Open Source Packages
  167. py_gapic_assembly_pkg(
  168. name = "example-library-v1-py",
  169. deps = [
  170. ":library_py_gapic",
  171. ],
  172. )
  173. php_proto_library(
  174. name = "library_php_proto",
  175. deps = [":library_proto"],
  176. )
  177. php_grpc_library(
  178. name = "library_php_grpc",
  179. srcs = [":library_proto"],
  180. deps = [":library_php_proto"],
  181. )
  182. php_gapic_library(
  183. name = "library_php_gapic",
  184. srcs = [":library_proto_with_info"],
  185. grpc_service_config = "library_grpc_service_config.json",
  186. rest_numeric_enums = False,
  187. service_yaml = "//google/example/library:library_example_v1.yaml",
  188. transport = "grpc+rest",
  189. deps = [
  190. ":library_php_grpc",
  191. ":library_php_proto",
  192. ],
  193. )
  194. # Open Source Packages
  195. php_gapic_assembly_pkg(
  196. name = "google-cloud-example-library-v1-php",
  197. deps = [
  198. ":library_php_gapic",
  199. ":library_php_grpc",
  200. ":library_php_proto",
  201. ],
  202. )
  203. nodejs_gapic_library(
  204. name = "library_nodejs_gapic",
  205. package_name = "@google-cloud/library",
  206. src = ":library_proto_with_info",
  207. extra_protoc_parameters = ["metadata"],
  208. grpc_service_config = "library_grpc_service_config.json",
  209. package = "google.cloud.example.library.v1",
  210. rest_numeric_enums = False,
  211. service_yaml = "//google/example/library:library_example_v1.yaml",
  212. transport = "grpc+rest",
  213. deps = [],
  214. )
  215. nodejs_gapic_assembly_pkg(
  216. name = "example-library-v1-nodejs",
  217. deps = [
  218. ":library_nodejs_gapic",
  219. ":library_proto",
  220. ],
  221. )
  222. ruby_proto_library(
  223. name = "library_ruby_proto",
  224. deps = [":library_proto"],
  225. )
  226. ruby_grpc_library(
  227. name = "library_ruby_grpc",
  228. srcs = [":library_proto"],
  229. deps = [":library_ruby_proto"],
  230. )
  231. # Uncomment the following once the space issue has been fixed.
  232. ruby_cloud_gapic_library(
  233. name = "library_ruby_gapic",
  234. srcs = [":library_proto_with_info"],
  235. extra_protoc_parameters = [
  236. "ruby-cloud-gem-name=google-cloud-example_library-v1",
  237. "ruby-cloud-env-prefix=LIBRARY",
  238. "ruby-cloud-product-url=https://cloud.google.com",
  239. "ruby-cloud-api-id=library-example.googleapis.com",
  240. "ruby-cloud-api-shortname=library",
  241. ],
  242. grpc_service_config = "library_grpc_service_config.json",
  243. rest_numeric_enums = False,
  244. ruby_cloud_description = "This is a Google example service representing a simple digital library. It manages a collection of shelf resources, and each shelf owns a collection of book resources.",
  245. ruby_cloud_title = "Example Library V1",
  246. deps = [
  247. ":library_ruby_grpc",
  248. ":library_ruby_proto",
  249. ],
  250. )
  251. # Open Source Packages
  252. ruby_gapic_assembly_pkg(
  253. name = "google-cloud-example-library-v1-ruby",
  254. deps = [
  255. ":library_ruby_gapic",
  256. ":library_ruby_grpc",
  257. ":library_ruby_proto",
  258. ],
  259. )
  260. csharp_proto_library(
  261. name = "library_csharp_proto",
  262. deps = [":library_proto"],
  263. )
  264. csharp_grpc_library(
  265. name = "library_csharp_grpc",
  266. srcs = [":library_proto"],
  267. deps = [":library_csharp_proto"],
  268. )
  269. csharp_gapic_library(
  270. name = "library_csharp_gapic",
  271. srcs = [":library_proto_with_info"],
  272. common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
  273. grpc_service_config = "library_grpc_service_config.json",
  274. rest_numeric_enums = False,
  275. service_yaml = "//google/example/library:library_example_v1.yaml",
  276. deps = [
  277. ":library_csharp_grpc",
  278. ":library_csharp_proto",
  279. ],
  280. )
  281. # Open Source Packages
  282. csharp_gapic_assembly_pkg(
  283. name = "google-cloud-example-library-v1-csharp",
  284. deps = [
  285. ":library_csharp_gapic",
  286. ":library_csharp_grpc",
  287. ":library_csharp_proto",
  288. ],
  289. )
  290. cc_proto_library(
  291. name = "library_cc_proto",
  292. deps = [":library_proto"],
  293. )
  294. cc_grpc_library(
  295. name = "library_cc_grpc",
  296. srcs = [":library_proto"],
  297. grpc_only = True,
  298. deps = [":library_cc_proto"],
  299. )