From 220548f30c81120a3fd63761690603d0120754f2 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Wed, 7 Feb 2024 15:56:12 -0800 Subject: [PATCH] Add missing alias targets for C++ util libraries 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 --- BUILD.bazel | 36 ++++++++++++++++++++++++++++ conformance/BUILD.bazel | 6 ++--- pkg/BUILD.bazel | 2 +- src/google/protobuf/json/BUILD.bazel | 12 +++++----- src/google/protobuf/util/BUILD.bazel | 4 ++-- 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index af75be8c6d..5b74244ce1 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -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 ################################################################################ diff --git a/conformance/BUILD.bazel b/conformance/BUILD.bazel index f9533eb469..ab8f485212 100644 --- a/conformance/BUILD.bazel +++ b/conformance/BUILD.bazel @@ -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", @@ -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", @@ -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", diff --git a/pkg/BUILD.bazel b/pkg/BUILD.bazel index af5881984f..42641ec233 100644 --- a/pkg/BUILD.bazel +++ b/pkg/BUILD.bazel @@ -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", ], ) diff --git a/src/google/protobuf/json/BUILD.bazel b/src/google/protobuf/json/BUILD.bazel index 96a62f5724..72c41364ed 100644 --- a/src/google/protobuf/json/BUILD.bazel +++ b/src/google/protobuf/json/BUILD.bazel @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", diff --git a/src/google/protobuf/util/BUILD.bazel b/src/google/protobuf/util/BUILD.bazel index b0b1506846..e11bce8f06 100644 --- a/src/google/protobuf/util/BUILD.bazel +++ b/src/google/protobuf/util/BUILD.bazel @@ -195,7 +195,7 @@ cc_test( ) cc_library( - name = "type_resolver_util", + name = "type_resolver", srcs = ["type_resolver_util.cc"], hdrs = [ "type_resolver.h", @@ -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",