@@ -135,7 +135,7 @@ def _java_gapic_srcjar(
135
135
136
136
if grpc_service_config :
137
137
file_args_dict [grpc_service_config ] = "grpc-service-config"
138
- elif transport != "rest " :
138
+ elif not transport or transport == "grpc " :
139
139
for keyword in NO_GRPC_CONFIG_ALLOWLIST :
140
140
if keyword not in name :
141
141
fail ("Missing a gRPC service config file" )
@@ -230,16 +230,25 @@ def java_gapic_library(
230
230
"@javax_annotation_javax_annotation_api//jar" ,
231
231
]
232
232
233
- if transport == "rest" :
233
+ if not transport or transport == "grpc" :
234
+ actual_deps += [
235
+ "@com_google_api_gax_java//gax-grpc:gax_grpc" ,
236
+ "@io_grpc_grpc_java//core:core" ,
237
+ "@io_grpc_grpc_java//protobuf:protobuf" ,
238
+ ]
239
+ elif transport == "rest" :
234
240
actual_deps += [
235
241
"@com_google_api_gax_java//gax-httpjson:gax_httpjson" ,
236
242
]
237
- else :
243
+ elif transport == "grpc+rest" :
238
244
actual_deps += [
239
245
"@com_google_api_gax_java//gax-grpc:gax_grpc" ,
240
246
"@io_grpc_grpc_java//core:core" ,
241
247
"@io_grpc_grpc_java//protobuf:protobuf" ,
248
+ "@com_google_api_gax_java//gax-httpjson:gax_httpjson" ,
242
249
]
250
+ else :
251
+ fail ("Unknown transport: %s" % transport )
243
252
244
253
native .java_library (
245
254
name = name ,
@@ -256,18 +265,29 @@ def java_gapic_library(
256
265
"@junit_junit//jar" ,
257
266
]
258
267
259
- if transport == "rest" :
268
+ if not transport or transport == "grpc" :
269
+ actual_test_deps += [
270
+ "@com_google_api_gax_java//gax-grpc:gax_grpc_testlib" ,
271
+ "@io_grpc_grpc_java//auth:auth" ,
272
+ "@io_grpc_grpc_netty_shaded//jar" ,
273
+ "@io_grpc_grpc_java//stub:stub" ,
274
+ "@io_opencensus_opencensus_contrib_grpc_metrics//jar" ,
275
+ ]
276
+ elif transport == "rest" :
260
277
actual_test_deps += [
261
278
"@com_google_api_gax_java//gax-httpjson:gax_httpjson_testlib" ,
262
279
]
263
- else :
280
+ elif transport == "grpc+rest" :
264
281
actual_test_deps += [
265
282
"@com_google_api_gax_java//gax-grpc:gax_grpc_testlib" ,
266
283
"@io_grpc_grpc_java//auth:auth" ,
267
284
"@io_grpc_grpc_netty_shaded//jar" ,
268
285
"@io_grpc_grpc_java//stub:stub" ,
269
286
"@io_opencensus_opencensus_contrib_grpc_metrics//jar" ,
287
+ "@com_google_api_gax_java//gax-httpjson:gax_httpjson_testlib" ,
270
288
]
289
+ else :
290
+ fail ("Unknown transport: %s" % transport )
271
291
272
292
_append_dep_without_duplicates (actual_test_deps , test_deps )
273
293
_append_dep_without_duplicates (actual_test_deps , actual_deps )
0 commit comments