Skip to content

Commit

Permalink
Add missing alias targets for C++ util libraries (#15783)
Browse files Browse the repository at this point in the history
Until recently, these targets were dependencies of `//:protobuf` and could thus
be accessed through that target. But now that we are adhering to the layering
check, we need to provide proper access in a way that respects that check. This
change uses top-level alias targets following the existing pattern.

PiperOrigin-RevId: 605123979
  • Loading branch information
acozzette committed Feb 8, 2024
1 parent 777d29e commit 62e7a56
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 12 deletions.
36 changes: 36 additions & 0 deletions BUILD.bazel
Expand Up @@ -295,6 +295,42 @@ alias(
visibility = ["//visibility:public"],
)

alias(
name = "delimited_message_util",
actual = "//src/google/protobuf/util:delimited_message_util",
visibility = ["//visibility:public"],
)

alias(
name = "differencer",
actual = "//src/google/protobuf/util:differencer",
visibility = ["//visibility:public"],
)

alias(
name = "field_mask_util",
actual = "//src/google/protobuf/util:field_mask_util",
visibility = ["//visibility:public"],
)

alias(
name = "json_util",
actual = "//src/google/protobuf/util:json_util",
visibility = ["//visibility:public"],
)

alias(
name = "time_util",
actual = "//src/google/protobuf/util:time_util",
visibility = ["//visibility:public"],
)

alias(
name = "type_resolver",
actual = "//src/google/protobuf/util:type_resolver",
visibility = ["//visibility:public"],
)

################################################################################
# Java support
################################################################################
Expand Down
6 changes: 3 additions & 3 deletions conformance/BUILD.bazel
Expand Up @@ -149,7 +149,7 @@ cc_library(
"//src/google/protobuf:protobuf_lite",
"//src/google/protobuf/util:differencer",
"//src/google/protobuf/util:json_util",
"//src/google/protobuf/util:type_resolver_util",
"//src/google/protobuf/util:type_resolver",
"@com_google_absl//absl/container:btree",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/log:absl_check",
Expand All @@ -174,7 +174,7 @@ cc_library(
"//src/google/protobuf/editions:test_messages_proto2_editions_cc_proto",
"//src/google/protobuf/editions:test_messages_proto3_editions_cc_proto",
"//src/google/protobuf/json",
"//src/google/protobuf/util:type_resolver_util",
"//src/google/protobuf/util:type_resolver",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/log:die_if_null",
Expand Down Expand Up @@ -232,7 +232,7 @@ cc_binary(
"//src/google/protobuf/editions:test_messages_proto3_editions_cc_proto",
"//src/google/protobuf/stubs",
"//src/google/protobuf/util:json_util",
"//src/google/protobuf/util:type_resolver_util",
"//src/google/protobuf/util:type_resolver",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/status",
Expand Down
2 changes: 1 addition & 1 deletion pkg/BUILD.bazel
Expand Up @@ -173,7 +173,7 @@ cc_dist_library(
"//src/google/protobuf/util:field_mask_util",
"//src/google/protobuf/util:json_util",
"//src/google/protobuf/util:time_util",
"//src/google/protobuf/util:type_resolver_util",
"//src/google/protobuf/util:type_resolver",
],
)

Expand Down
12 changes: 6 additions & 6 deletions src/google/protobuf/json/BUILD.bazel
Expand Up @@ -25,7 +25,7 @@ cc_library(
"//src/google/protobuf/io",
"//src/google/protobuf/io:zero_copy_sink",
"//src/google/protobuf/stubs",
"//src/google/protobuf/util:type_resolver_util",
"//src/google/protobuf/util:type_resolver",
"@com_google_absl//absl/base",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/log:absl_log",
Expand Down Expand Up @@ -53,7 +53,7 @@ cc_test(
"//src/google/protobuf/stubs",
"//src/google/protobuf/util:json_format_cc_proto",
"//src/google/protobuf/util:json_format_proto3_cc_proto",
"//src/google/protobuf/util:type_resolver_util",
"//src/google/protobuf/util:type_resolver",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
Expand Down Expand Up @@ -110,7 +110,7 @@ cc_library(
"//src/google/protobuf:type_cc_proto",
"//src/google/protobuf/io",
"//src/google/protobuf/stubs",
"//src/google/protobuf/util:type_resolver_util",
"//src/google/protobuf/util:type_resolver",
"//third_party/utf8_range:utf8_validity",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/log:absl_check",
Expand Down Expand Up @@ -199,7 +199,7 @@ cc_library(
":untyped_message",
"//src/google/protobuf",
"//src/google/protobuf:port",
"//src/google/protobuf/util:type_resolver_util",
"//src/google/protobuf/util:type_resolver",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
Expand Down Expand Up @@ -230,7 +230,7 @@ cc_library(
"//src/google/protobuf/io",
"//src/google/protobuf/io:zero_copy_sink",
"//src/google/protobuf/stubs",
"//src/google/protobuf/util:type_resolver_util",
"//src/google/protobuf/util:type_resolver",
"@com_google_absl//absl/base",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down Expand Up @@ -266,7 +266,7 @@ cc_library(
"//src/google/protobuf:type_cc_proto",
"//src/google/protobuf/io",
"//src/google/protobuf/stubs",
"//src/google/protobuf/util:type_resolver_util",
"//src/google/protobuf/util:type_resolver",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
Expand Down
4 changes: 2 additions & 2 deletions src/google/protobuf/util/BUILD.bazel
Expand Up @@ -195,7 +195,7 @@ cc_test(
)

cc_library(
name = "type_resolver_util",
name = "type_resolver",
srcs = ["type_resolver_util.cc"],
hdrs = [
"type_resolver.h",
Expand Down Expand Up @@ -228,7 +228,7 @@ cc_test(
":json_format_cc_proto",
":json_format_proto3_cc_proto",
":json_util",
":type_resolver_util",
":type_resolver",
"//src/google/protobuf",
"//src/google/protobuf:any_cc_proto",
"//src/google/protobuf:cc_test_protos",
Expand Down

0 comments on commit 62e7a56

Please sign in to comment.