Skip to content

Commit 5428e91

Browse files
Google APIscopybara-github
authored andcommitted
chore: migrate example/library retry configs, fix C#/PHP/Ruby GAPICs
Committer: @miraleung PiperOrigin-RevId: 359640308
1 parent e41506d commit 5428e91

5 files changed

Lines changed: 191 additions & 390 deletions

File tree

google/example/library/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
exports_files(glob(["*.yaml"]))
2-
3-

google/example/library/v1/BUILD.bazel

Lines changed: 77 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file was automatically generated by BuildFileGenerator
2-
# https://github.com/googleapis/gapic-generator/tree/master/rules_gapic/bazel
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
33

44
# Most of the manual changes to this file will be overwritten.
55
# It's **only** allowed to change the following rule attribute values:
@@ -9,14 +9,42 @@
99
# * extra_protoc_file_parameters
1010
# The complete list of preserved parameters can be found in the source code.
1111

12-
# This is an API workspace, having public visibility by default makes perfect sense.
13-
package(default_visibility = ["//visibility:public"])
14-
1512
##############################################################################
1613
# Common
1714
##############################################################################
1815
load("@rules_proto//proto:defs.bzl", "proto_library")
19-
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
16+
load(
17+
"@com_google_googleapis_imports//:imports.bzl",
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+
"ruby_cloud_gapic_library",
41+
"ruby_gapic_assembly_pkg",
42+
"ruby_grpc_library",
43+
"ruby_proto_library",
44+
)
45+
46+
# This is an API workspace, having public visibility by default makes perfect sense.
47+
package(default_visibility = ["//visibility:public"])
2048

2149
proto_library(
2250
name = "library_proto",
@@ -29,6 +57,7 @@ proto_library(
2957
"//google/api:field_behavior_proto",
3058
"//google/api:resource_proto",
3159
"@com_google_protobuf//:empty_proto",
60+
"@com_google_protobuf//:field_mask_proto",
3261
],
3362
)
3463

@@ -40,18 +69,6 @@ proto_library_with_info(
4069
],
4170
)
4271

43-
##############################################################################
44-
# Java
45-
##############################################################################
46-
load(
47-
"@com_google_googleapis_imports//:imports.bzl",
48-
"java_gapic_assembly_gradle_pkg",
49-
"java_gapic_library",
50-
"java_gapic_test",
51-
"java_grpc_library",
52-
"java_proto_library",
53-
)
54-
5572
java_proto_library(
5673
name = "library_java_proto",
5774
deps = [":library_proto"],
@@ -67,6 +84,7 @@ java_gapic_library(
6784
name = "library_java_gapic",
6885
srcs = [":library_proto_with_info"],
6986
gapic_yaml = "library_example_gapic.yaml",
87+
grpc_service_config = "library_grpc_service_config.json",
7088
test_deps = [
7189
":library_java_grpc",
7290
],
@@ -94,17 +112,6 @@ java_gapic_assembly_gradle_pkg(
94112
],
95113
)
96114

97-
##############################################################################
98-
# Go
99-
##############################################################################
100-
load(
101-
"@com_google_googleapis_imports//:imports.bzl",
102-
"go_gapic_assembly_pkg",
103-
"go_gapic_library",
104-
"go_proto_library",
105-
"go_test",
106-
)
107-
108115
go_proto_library(
109116
name = "library_go_proto",
110117
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
@@ -118,8 +125,9 @@ go_proto_library(
118125
go_gapic_library(
119126
name = "library_go_gapic",
120127
srcs = [":library_proto_with_info"],
121-
grpc_service_config = "",
122-
importpath = "cloud.google.com/go/example/library/apiv1;library",
128+
grpc_service_config = "library_grpc_service_config.json",
129+
importpath = "google.golang.org/google/example/library/v1;library",
130+
metadata = True,
123131
service_yaml = "//google/example/library:library_example_v1.yaml",
124132
deps = [
125133
":library_go_proto",
@@ -130,32 +138,24 @@ go_test(
130138
name = "library_go_gapic_test",
131139
srcs = [":library_go_gapic_srcjar_test"],
132140
embed = [":library_go_gapic"],
133-
importpath = "cloud.google.com/go/example/library/apiv1",
141+
importpath = "google.golang.org/google/example/library/v1",
134142
)
135143

136144
# Open Source Packages
137145
go_gapic_assembly_pkg(
138146
name = "gapi-cloud-example-library-v1-go",
139147
deps = [
140148
":library_go_gapic",
149+
":library_go_gapic_srcjar-metadata.srcjar",
141150
":library_go_gapic_srcjar-test.srcjar",
142151
":library_go_proto",
143152
],
144153
)
145154

146-
##############################################################################
147-
# Python
148-
##############################################################################
149-
load(
150-
"@com_google_googleapis_imports//:imports.bzl",
151-
"py_gapic_assembly_pkg",
152-
"py_gapic_library",
153-
)
154-
155155
py_gapic_library(
156156
name = "library_py_gapic",
157157
srcs = [":library_proto"],
158-
grpc_service_config = None,
158+
grpc_service_config = "library_grpc_service_config.json",
159159
)
160160

161161
# Open Source Packages
@@ -166,17 +166,6 @@ py_gapic_assembly_pkg(
166166
],
167167
)
168168

169-
##############################################################################
170-
# PHP
171-
##############################################################################
172-
load(
173-
"@com_google_googleapis_imports//:imports.bzl",
174-
"php_gapic_assembly_pkg",
175-
"php_gapic_library",
176-
"php_grpc_library",
177-
"php_proto_library",
178-
)
179-
180169
php_proto_library(
181170
name = "library_php_proto",
182171
deps = [":library_proto"],
@@ -192,6 +181,7 @@ php_gapic_library(
192181
name = "library_php_gapic",
193182
src = ":library_proto_with_info",
194183
gapic_yaml = "library_example_gapic.yaml",
184+
grpc_service_config = "library_grpc_service_config.json",
195185
package = "google.example.library.v1",
196186
service_yaml = "//google/example/library:library_example_v1.yaml",
197187
deps = [
@@ -210,21 +200,13 @@ php_gapic_assembly_pkg(
210200
],
211201
)
212202

213-
##############################################################################
214-
# Node.js
215-
##############################################################################
216-
load(
217-
"@com_google_googleapis_imports//:imports.bzl",
218-
"nodejs_gapic_assembly_pkg",
219-
"nodejs_gapic_library",
220-
)
221-
222203
nodejs_gapic_library(
223204
name = "library_nodejs_gapic",
205+
package_name = "@google-cloud/library",
224206
src = ":library_proto_with_info",
225207
extra_protoc_parameters = ["metadata"],
226-
grpc_service_config = None,
227-
package = "google.example.library.v1",
208+
grpc_service_config = "library_grpc_service_config.json",
209+
package = "google.cloud.example.library.v1",
228210
service_yaml = "//google/example/library:library_example_v1.yaml",
229211
deps = [],
230212
)
@@ -237,17 +219,6 @@ nodejs_gapic_assembly_pkg(
237219
],
238220
)
239221

240-
##############################################################################
241-
# Ruby
242-
##############################################################################
243-
load(
244-
"@com_google_googleapis_imports//:imports.bzl",
245-
"ruby_gapic_assembly_pkg",
246-
"ruby_gapic_library",
247-
"ruby_grpc_library",
248-
"ruby_proto_library",
249-
)
250-
251222
ruby_proto_library(
252223
name = "library_ruby_proto",
253224
deps = [":library_proto"],
@@ -259,12 +230,20 @@ ruby_grpc_library(
259230
deps = [":library_ruby_proto"],
260231
)
261232

262-
ruby_gapic_library(
233+
# Uncomment the following once the space issue has been fixed.
234+
ruby_cloud_gapic_library(
263235
name = "library_ruby_gapic",
264-
src = ":library_proto_with_info",
265-
gapic_yaml = "library_example_gapic.yaml",
266-
package = "google.example.library.v1",
267-
service_yaml = "//google/example/library:library_example_v1.yaml",
236+
srcs = [":library_proto_with_info"],
237+
extra_protoc_parameters = [
238+
"ruby-cloud-gem-name=google-cloud-example_library-v1",
239+
"ruby-cloud-env-prefix=LIBRARY",
240+
"ruby-cloud-product-url=https://cloud.google.com",
241+
"ruby-cloud-api-id=library-example.googleapis.com",
242+
"ruby-cloud-api-shortname=library",
243+
],
244+
grpc_service_config = "library_grpc_service_config.json",
245+
ruby_cloud_title = "Example Library V1",
246+
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.",
268247
deps = [
269248
":library_ruby_grpc",
270249
":library_ruby_proto",
@@ -281,17 +260,6 @@ ruby_gapic_assembly_pkg(
281260
],
282261
)
283262

284-
##############################################################################
285-
# C#
286-
##############################################################################
287-
load(
288-
"@com_google_googleapis_imports//:imports.bzl",
289-
"csharp_gapic_assembly_pkg",
290-
"csharp_gapic_library",
291-
"csharp_grpc_library",
292-
"csharp_proto_library",
293-
)
294-
295263
csharp_proto_library(
296264
name = "library_csharp_proto",
297265
deps = [":library_proto"],
@@ -303,26 +271,26 @@ csharp_grpc_library(
303271
deps = [":library_csharp_proto"],
304272
)
305273

306-
# Invalid resource-reference, cannot build.
307-
# csharp_gapic_library(
308-
# name = "library_csharp_gapic",
309-
# srcs = [":library_proto_with_info"],
310-
# common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
311-
# deps = [
312-
# ":library_csharp_grpc",
313-
# ":library_csharp_proto",
314-
# ],
315-
# )
274+
csharp_gapic_library(
275+
name = "library_csharp_gapic",
276+
srcs = [":library_proto_with_info"],
277+
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
278+
grpc_service_config = "library_grpc_service_config.json",
279+
deps = [
280+
":library_csharp_grpc",
281+
":library_csharp_proto",
282+
],
283+
)
316284

317-
# # Open Source Packages
318-
# csharp_gapic_assembly_pkg(
319-
# name = "google-cloud-example-library-v1-csharp",
320-
# deps = [
321-
# ":library_csharp_gapic",
322-
# ":library_csharp_grpc",
323-
# ":library_csharp_proto",
324-
# ],
325-
# )
285+
# Open Source Packages
286+
csharp_gapic_assembly_pkg(
287+
name = "google-cloud-example-library-v1-csharp",
288+
deps = [
289+
":library_csharp_gapic",
290+
":library_csharp_grpc",
291+
":library_csharp_proto",
292+
],
293+
)
326294

327295
##############################################################################
328296
# C++

0 commit comments

Comments
 (0)