BUILD.bazel 8.6 KB

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