Skip to content

Commit

Permalink
fix(build_gen): include httpbody import for java/go (#3329)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdietz committed Jan 20, 2021
1 parent f9cf185 commit f3dedfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ private Set<String> mapJavaGapicDeps(Set<String> protoImports) {
for (String protoImport : protoImports) {
if (protoImport.endsWith(":iam_policy_proto") || protoImport.endsWith(":policy_proto")) {
javaImports.add(replaceLabelName(protoImport, ":iam_java_proto"));
} else if (protoImport.endsWith(":service_proto")) {
} else if (protoImport.endsWith(":service_proto")
|| protoImport.endsWith(":httpbody_proto")) {
javaImports.add(replaceLabelName(protoImport, ":api_java_proto"));
}
}
Expand Down Expand Up @@ -257,6 +258,8 @@ private Set<String> mapGoGapicDeps(Set<String> protoImports) {
goImports.add(replaceLabelName(protoImport, ":iam_go_proto"));
} else if (protoImport.endsWith(":service_proto")) {
goImports.add(replaceLabelName(protoImport, ":serviceconfig_go_proto"));
} else if (protoImport.endsWith(":httpbody_proto")) {
goImports.add(replaceLabelName(protoImport, ":httpbody_go_proto"));
}
}
return goImports;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ proto_library(
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:field_behavior_proto",
"//google/api:httpbody_proto",
"//google/api:resource_proto",
"@com_google_protobuf//:empty_proto",
],
Expand Down Expand Up @@ -73,6 +74,7 @@ java_gapic_library(
],
deps = [
":library_java_proto",
"//google/api:api_java_proto",
],
)

Expand Down Expand Up @@ -113,6 +115,7 @@ go_proto_library(
protos = [":library_proto"],
deps = [
"//google/api:annotations_go_proto",
"//google/api:httpbody_go_proto",
],
)

Expand All @@ -124,6 +127,7 @@ go_gapic_library(
service_yaml = "//google/example/library:library_example_v1.yaml",
deps = [
":library_go_proto",
"//google/api:httpbody_go_proto",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/api/httpbody.proto";
import "google/protobuf/empty.proto";

option go_package = "google.golang.org/genproto/googleapis/example/library/v1;library";
Expand Down

0 comments on commit f3dedfb

Please sign in to comment.