BUILD.bazel 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. # This is an API workspace, having public visibility by default makes perfect sense.
  2. package(default_visibility = ["//visibility:public"])
  3. ##############################################################################
  4. # Common
  5. ##############################################################################
  6. load("@rules_proto//proto:defs.bzl", "proto_library")
  7. load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
  8. proto_library(
  9. name = "storage_proto",
  10. srcs = [
  11. "arrow.proto",
  12. "avro.proto",
  13. "protobuf.proto",
  14. "storage.proto",
  15. "stream.proto",
  16. "table.proto",
  17. ],
  18. deps = [
  19. "//google/api:annotations_proto",
  20. "//google/api:client_proto",
  21. "//google/api:field_behavior_proto",
  22. "//google/api:resource_proto",
  23. "//google/rpc:status_proto",
  24. "@com_google_protobuf//:descriptor_proto",
  25. "@com_google_protobuf//:empty_proto",
  26. "@com_google_protobuf//:timestamp_proto",
  27. "@com_google_protobuf//:wrappers_proto",
  28. ],
  29. )
  30. proto_library_with_info(
  31. name = "storage_proto_with_info",
  32. deps = [
  33. ":storage_proto",
  34. "//google/cloud:common_resources_proto",
  35. ],
  36. )
  37. ##############################################################################
  38. # Java
  39. ##############################################################################
  40. load(
  41. "@com_google_googleapis_imports//:imports.bzl",
  42. "java_gapic_assembly_gradle_pkg",
  43. "java_gapic_library",
  44. "java_gapic_test",
  45. "java_grpc_library",
  46. "java_proto_library",
  47. )
  48. java_proto_library(
  49. name = "storage_java_proto",
  50. deps = [":storage_proto"],
  51. )
  52. java_grpc_library(
  53. name = "storage_java_grpc",
  54. srcs = [":storage_proto"],
  55. deps = [":storage_java_proto"],
  56. )
  57. java_gapic_library(
  58. name = "storage_java_gapic",
  59. srcs = [":storage_proto_with_info"],
  60. gapic_yaml = "bigquerystorage_gapic.yaml",
  61. grpc_service_config = "bigquerystorage_grpc_service_config.json",
  62. rest_numeric_enums = False,
  63. test_deps = [
  64. ":storage_java_grpc",
  65. ],
  66. transport = "grpc",
  67. deps = [
  68. ":storage_java_proto",
  69. ],
  70. )
  71. java_gapic_test(
  72. name = "storage_java_gapic_test_suite",
  73. test_classes = [
  74. "com.google.cloud.bigquery.storage.v1beta2.BaseBigQueryReadClientTest",
  75. ],
  76. runtime_deps = [":storage_java_gapic_test"],
  77. )
  78. # Open Source Packages
  79. java_gapic_assembly_gradle_pkg(
  80. name = "google-cloud-bigquery-storage-v1beta2-java",
  81. include_samples = True,
  82. transport = "grpc",
  83. deps = [
  84. ":storage_java_gapic",
  85. ":storage_java_grpc",
  86. ":storage_java_proto",
  87. ":storage_proto",
  88. ],
  89. )
  90. ##############################################################################
  91. # Go
  92. ##############################################################################
  93. load(
  94. "@com_google_googleapis_imports//:imports.bzl",
  95. "go_gapic_assembly_pkg",
  96. "go_gapic_library",
  97. "go_proto_library",
  98. "go_test",
  99. )
  100. go_proto_library(
  101. name = "storage_go_proto",
  102. compilers = ["@io_bazel_rules_go//proto:go_grpc"],
  103. importpath = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta2",
  104. protos = [":storage_proto"],
  105. deps = [
  106. "//google/api:annotations_go_proto",
  107. "//google/rpc:status_go_proto",
  108. ],
  109. )
  110. go_gapic_library(
  111. name = "storage_go_gapic",
  112. srcs = [":storage_proto_with_info"],
  113. grpc_service_config = "bigquerystorage_grpc_service_config.json",
  114. importpath = "cloud.google.com/go/bigquery/storage/apiv1beta2;storage",
  115. rest_numeric_enums = False,
  116. service_yaml = "bigquerystorage_v1beta2.yaml",
  117. deps = [
  118. ":storage_go_proto",
  119. ],
  120. )
  121. go_test(
  122. name = "storage_go_gapic_test",
  123. srcs = [":storage_go_gapic_srcjar_test"],
  124. embed = [":storage_go_gapic"],
  125. importpath = "cloud.google.com/go/bigquery/storage/apiv1beta2",
  126. )
  127. # Open Source Packages
  128. go_gapic_assembly_pkg(
  129. name = "gapi-cloud-bigquery-storage-v1beta2-go",
  130. deps = [
  131. ":storage_go_gapic",
  132. ":storage_go_gapic_srcjar-test.srcjar",
  133. ":storage_go_proto",
  134. ],
  135. )
  136. ##############################################################################
  137. # Python
  138. ##############################################################################
  139. load(
  140. "@com_google_googleapis_imports//:imports.bzl",
  141. "py_gapic_assembly_pkg",
  142. "py_gapic_library",
  143. )
  144. py_gapic_library(
  145. name = "storage_py_gapic",
  146. srcs = [":storage_proto"],
  147. grpc_service_config = "bigquerystorage_grpc_service_config.json",
  148. opt_args = [
  149. "python-gapic-namespace=google.cloud",
  150. "python-gapic-name=bigquery_storage",
  151. ],
  152. rest_numeric_enums = False,
  153. transport = "grpc",
  154. )
  155. py_test(
  156. name = "storage_py_gapic_test",
  157. srcs = [
  158. "storage_py_gapic_pytest.py",
  159. "storage_py_gapic_test.py",
  160. ],
  161. legacy_create_init = False,
  162. deps = [":storage_py_gapic"],
  163. )
  164. py_gapic_assembly_pkg(
  165. name = "bigquery-storage-v1beta2-py",
  166. deps = [
  167. ":storage_py_gapic",
  168. ],
  169. )
  170. ##############################################################################
  171. # PHP
  172. ##############################################################################
  173. load(
  174. "@com_google_googleapis_imports//:imports.bzl",
  175. "php_gapic_assembly_pkg",
  176. "php_gapic_library",
  177. "php_grpc_library",
  178. "php_proto_library",
  179. )
  180. php_proto_library(
  181. name = "storage_php_proto",
  182. deps = [":storage_proto"],
  183. )
  184. php_grpc_library(
  185. name = "storage_php_grpc",
  186. srcs = [":storage_proto"],
  187. deps = [":storage_php_proto"],
  188. )
  189. php_gapic_library(
  190. name = "storage_php_gapic",
  191. srcs = [":storage_proto_with_info"],
  192. grpc_service_config = "bigquerystorage_grpc_service_config.json",
  193. rest_numeric_enums = False,
  194. transport = "grpc+rest",
  195. deps = [
  196. ":storage_php_grpc",
  197. ":storage_php_proto",
  198. ],
  199. )
  200. # Open Source Packages
  201. php_gapic_assembly_pkg(
  202. name = "google-cloud-bigquery-storage-v1beta2-php",
  203. deps = [
  204. ":storage_php_gapic",
  205. ":storage_php_grpc",
  206. ":storage_php_proto",
  207. ],
  208. )
  209. ##############################################################################
  210. # Node.js
  211. ##############################################################################
  212. load(
  213. "@com_google_googleapis_imports//:imports.bzl",
  214. "nodejs_gapic_assembly_pkg",
  215. "nodejs_gapic_library",
  216. )
  217. nodejs_gapic_library(
  218. name = "storage_nodejs_gapic",
  219. src = ":storage_proto_with_info",
  220. extra_protoc_parameters = ["metadata"],
  221. grpc_service_config = "bigquerystorage_grpc_service_config.json",
  222. package = "google.cloud.bigquery.storage.v1beta2",
  223. rest_numeric_enums = False,
  224. service_yaml = "bigquerystorage_v1beta2.yaml",
  225. transport = "grpc+rest",
  226. deps = [],
  227. )
  228. nodejs_gapic_assembly_pkg(
  229. name = "bigquery-storage-v1beta2-nodejs",
  230. deps = [
  231. ":storage_nodejs_gapic",
  232. ":storage_proto",
  233. ],
  234. )
  235. ##############################################################################
  236. # Ruby
  237. ##############################################################################
  238. # load(
  239. # "@com_google_googleapis_imports//:imports.bzl",
  240. # "ruby_gapic_assembly_pkg",
  241. # "ruby_cloud_gapic_library",
  242. # "ruby_grpc_library",
  243. # "ruby_proto_library",
  244. # )
  245. # ruby_proto_library(
  246. # name = "storage_ruby_proto",
  247. # deps = [":storage_proto"],
  248. # )
  249. # ruby_grpc_library(
  250. # name = "storage_ruby_grpc",
  251. # srcs = [":storage_proto"],
  252. # deps = [":storage_ruby_proto"],
  253. # )
  254. # ruby_cloud_gapic_library(
  255. # name = "storage_ruby_gapic",
  256. # srcs = [":storage_proto_with_info",],
  257. # extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-bigquery-storage-v1beta2"],
  258. # deps = [
  259. # ":storage_ruby_grpc",
  260. # ":storage_ruby_proto",
  261. # ],
  262. # )
  263. # ruby_gapic_assembly_pkg(
  264. # name = "google-cloud-bigquery-storage-v1beta2-ruby",
  265. # deps = [
  266. # ":storage_ruby_gapic",
  267. # ":storage_ruby_grpc",
  268. # ":storage_ruby_proto",
  269. # ],
  270. # )
  271. ##############################################################################
  272. # C#
  273. ##############################################################################
  274. load(
  275. "@com_google_googleapis_imports//:imports.bzl",
  276. "csharp_gapic_assembly_pkg",
  277. "csharp_gapic_library",
  278. "csharp_grpc_library",
  279. "csharp_proto_library",
  280. )
  281. csharp_proto_library(
  282. name = "storage_csharp_proto",
  283. deps = [":storage_proto"],
  284. )
  285. csharp_grpc_library(
  286. name = "storage_csharp_grpc",
  287. srcs = [":storage_proto"],
  288. deps = [":storage_csharp_proto"],
  289. )
  290. csharp_gapic_library(
  291. name = "storage_csharp_gapic",
  292. srcs = [":storage_proto_with_info"],
  293. common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
  294. grpc_service_config = "bigquerystorage_grpc_service_config.json",
  295. rest_numeric_enums = False,
  296. service_yaml = "bigquerystorage_v1beta2.yaml",
  297. deps = [
  298. ":storage_csharp_grpc",
  299. ":storage_csharp_proto",
  300. ],
  301. )
  302. # Open Source Packages
  303. csharp_gapic_assembly_pkg(
  304. name = "google-cloud-bigquery-storage-v1beta2-csharp",
  305. deps = [
  306. ":storage_csharp_gapic",
  307. ":storage_csharp_grpc",
  308. ":storage_csharp_proto",
  309. ],
  310. )
  311. ##############################################################################
  312. # C++
  313. ##############################################################################
  314. load(
  315. "@com_google_googleapis_imports//:imports.bzl",
  316. "cc_grpc_library",
  317. "cc_proto_library",
  318. )
  319. cc_proto_library(
  320. name = "storage_cc_proto",
  321. deps = [":storage_proto"],
  322. )
  323. cc_grpc_library(
  324. name = "storage_cc_grpc",
  325. srcs = [":storage_proto"],
  326. generate_mocks = True,
  327. grpc_only = True,
  328. deps = [":storage_cc_proto"],
  329. )