diff --git a/rules_java_gapic/java_gapic.bzl b/rules_java_gapic/java_gapic.bzl index 7e6442b8a4..26d87cacaf 100644 --- a/rules_java_gapic/java_gapic.bzl +++ b/rules_java_gapic/java_gapic.bzl @@ -14,6 +14,8 @@ load("@com_google_api_codegen//rules_gapic:gapic.bzl", "proto_custom_library", "unzipped_srcjar") +SERVICE_YAML_ALLOWLIST = ["googleads"] + def _java_gapic_postprocess_srcjar_impl(ctx): gapic_srcjar = ctx.file.gapic_srcjar output_srcjar_name = ctx.label.name @@ -91,9 +93,17 @@ def java_gapic_library( if grpc_service_config: file_args_dict[grpc_service_config] = "grpc-service-config" - # Currently a no-op. + # Check the allow-list. if service_yaml: - file_args_dict[service_yaml] = "gapic-service-config" + service_yaml_in_allowlist = False + for keyword in SERVICE_YAML_ALLOWLIST: + if keyword in service_yaml: + service_yaml_in_allowlist = True + break + if service_yaml_in_allowlist: + file_args_dict[service_yaml] = "gapic-service-config" + else: + fail("Service.yaml is no longer supported in the Java microgenerator") srcjar_name = name + "_srcjar" raw_srcjar_name = srcjar_name + "_raw" diff --git a/test/integration/BUILD.bazel b/test/integration/BUILD.bazel index c159d127e2..8ffe6cd1bf 100644 --- a/test/integration/BUILD.bazel +++ b/test/integration/BUILD.bazel @@ -46,7 +46,6 @@ java_gapic_library( srcs = ["@com_google_googleapis//google/cloud/asset/v1:asset_proto_with_info"], grpc_service_config = "@com_google_googleapis//google/cloud/asset/v1:cloudasset_grpc_service_config.json", package = "google.cloud.asset.v1", - service_yaml = "@com_google_googleapis//google/cloud/asset/v1:cloudasset_v1.yaml", test_deps = [ "@com_google_googleapis//google/cloud/asset/v1:asset_java_grpc", "@com_google_googleapis//google/iam/v1:iam_java_grpc", @@ -88,7 +87,6 @@ java_gapic_library( srcs = ["redis_proto_with_info"], grpc_service_config = "@com_google_googleapis//google/cloud/redis/v1:redis_grpc_service_config.json", package = "google.cloud.redis.v1", - service_yaml = "@com_google_googleapis//google/cloud/redis/v1:redis_v1.yaml", test_deps = [ "@com_google_googleapis//google/cloud/redis/v1:redis_java_grpc", ], @@ -113,7 +111,6 @@ java_gapic_library( srcs = ["@com_google_googleapis//google/logging/v2:logging_proto_with_info"], grpc_service_config = "@com_google_googleapis//google/logging/v2:logging_grpc_service_config.json", package = "google.logging.v2", - service_yaml = "@com_google_googleapis//google/logging/v2:logging.yaml", test_deps = [ "@com_google_googleapis//google/logging/v2:logging_java_grpc", ], diff --git a/test/integration/goldens/asset/package-info.java b/test/integration/goldens/asset/package-info.java index 519d666f43..e57f641808 100644 --- a/test/integration/goldens/asset/package-info.java +++ b/test/integration/goldens/asset/package-info.java @@ -15,9 +15,7 @@ */ /** - * A client to Cloud Asset API - * - *

The interfaces provided are listed below, along with usage samples. + * The interfaces provided are listed below, along with usage samples. * *

======================= AssetServiceClient ======================= * diff --git a/test/integration/goldens/logging/package-info.java b/test/integration/goldens/logging/package-info.java index f42783ea3f..13c3b7b556 100644 --- a/test/integration/goldens/logging/package-info.java +++ b/test/integration/goldens/logging/package-info.java @@ -15,9 +15,7 @@ */ /** - * A client to Cloud Logging API - * - *

The interfaces provided are listed below, along with usage samples. + * The interfaces provided are listed below, along with usage samples. * *

======================= LoggingServiceV2Client ======================= * diff --git a/test/integration/goldens/redis/package-info.java b/test/integration/goldens/redis/package-info.java index 8b83c3b636..3ed9ea15f2 100644 --- a/test/integration/goldens/redis/package-info.java +++ b/test/integration/goldens/redis/package-info.java @@ -15,9 +15,7 @@ */ /** - * A client to Google Cloud Memorystore for Redis API - * - *

The interfaces provided are listed below, along with usage samples. + * The interfaces provided are listed below, along with usage samples. * *

======================= CloudRedisClient ======================= *