Compare the generating result between bazel build and generate_library.sh, google/cloud/location/locations.proto should not be generated even though name: '*google.cloud.location.Locations'* is found in dlp_v2.yaml.
The protoc command in bazel build is (omit unrelevent contents):
protoc --experimental_allow_proto3_optional --plugin=protoc-gen-java_gapic=protoc-gen-java_gapic --java_gapic_out=metadata:dlp_java_gapic_srcjar_raw.srcjar.zip --java_gapic_opt=transport=grpc+rest,rest-numeric-enums,grpc-service-config=google/privacy/dlp/v2/dlp_grpc_service_config.json,gapic-config=google/privacy/dlp/v2/dlp_gapic.yaml,api-service-config=google/privacy/dlp/v2/dlp_v2.yaml google/privacy/dlp/v2/dlp.proto google/privacy/dlp/v2/storage.proto google/cloud/common_resources.proto
The protoc command in generate_library.sh is:
protoc --experimental_allow_proto3_optional --plugin=protoc-gen-java_gapic=gapic-generator-java-wrapper --java_gapic_out=metadata:java_gapic_srcjar_raw.srcjar.zip --java_gapic_opt=transport=grpc+rest,rest-numeric-enums,grpc-service-config=google/privacy/dlp/v2/dlp_grpc_service_config.json,gapic-config=google/privacy/dlp/v2/dlp_gapic.yaml,api-service-config=google/privacy/dlp/v2/dlp_v2.yaml google/privacy/dlp/v2/dlp.proto google/privacy/dlp/v2/storage.proto google/cloud/common_resources.proto google/cloud/location/locations.proto
Remove google/cloud/location/locations.proto in the protoc command can generate the right result.
Compare the generating result between
bazel buildandgenerate_library.sh,google/cloud/location/locations.protoshould not be generated even thoughname: '*google.cloud.location.Locations'*is found in dlp_v2.yaml.The protoc command in
bazel buildis (omit unrelevent contents):The protoc command in
generate_library.shis:Remove
google/cloud/location/locations.protoin the protoc command can generate the right result.