From 40ffd46cec1291e1320e46a134c47dd23a74ff43 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Fri, 14 Jun 2024 11:32:46 -0700 Subject: [PATCH] Automated rollback of commit a30b25578a0435c9c692f9a54b7b060a234dc6b3. PiperOrigin-RevId: 643407401 --- editions/BUILD | 16 ++-------------- java/core/BUILD.bazel | 6 ++++++ src/google/protobuf/BUILD.bazel | 6 ++++++ src/google/protobuf/compiler/cpp/helpers.cc | 2 ++ src/google/protobuf/compiler/java/BUILD.bazel | 1 + src/google/protobuf/compiler/java/generator.h | 2 +- .../protobuf/compiler/java/internal_helpers.h | 2 +- .../protobuf/compiler/java/kotlin_generator.h | 2 +- 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/editions/BUILD b/editions/BUILD index 09838afc802f5..fd5ddddaf0e91 100644 --- a/editions/BUILD +++ b/editions/BUILD @@ -87,18 +87,6 @@ cc_library( ], ) -cc_proto_library( - name = "cpp_features_cc_proto", - testonly = True, - deps = ["//src/google/protobuf:cpp_features_proto"], -) - -cc_proto_library( - name = "java_features_cc_proto", - testonly = True, - deps = ["//java/core:java_features_proto"], -) - cc_test( name = "defaults_test", srcs = ["defaults_test.cc"], @@ -109,11 +97,11 @@ cc_test( ":test_defaults_future", ], deps = [ - ":cpp_features_cc_proto", ":defaults_test_embedded", - ":java_features_cc_proto", "//:protobuf", + "//java/core:java_features_cc_proto", "//src/google/protobuf", + "//src/google/protobuf:cpp_features_cc_proto", "//src/google/protobuf:port", "//src/google/protobuf:protobuf_lite", "//src/google/protobuf:test_textproto", diff --git a/java/core/BUILD.bazel b/java/core/BUILD.bazel index 7ca8a85636965..d695ab0ad0336 100644 --- a/java/core/BUILD.bazel +++ b/java/core/BUILD.bazel @@ -196,6 +196,12 @@ proto_library( deps = ["//:descriptor_proto"], ) +cc_proto_library( + name = "java_features_cc_proto", + visibility = ["//editions:__pkg__"], + deps = [":java_features_proto"], +) + filegroup( name = "java_features_proto_srcs", srcs = ["src/main/resources/google/protobuf/java_features.proto"], diff --git a/src/google/protobuf/BUILD.bazel b/src/google/protobuf/BUILD.bazel index 97caa0ea8ebb6..0b2db2c77bf4d 100644 --- a/src/google/protobuf/BUILD.bazel +++ b/src/google/protobuf/BUILD.bazel @@ -231,6 +231,12 @@ proto_library( deps = [":descriptor_proto"], ) +cc_proto_library( + name = "cpp_features_cc_proto", + visibility = ["//editions:__pkg__"], + deps = [":cpp_features_proto"], +) + ################################################################################ # C++ Runtime Library ################################################################################ diff --git a/src/google/protobuf/compiler/cpp/helpers.cc b/src/google/protobuf/compiler/cpp/helpers.cc index 78e2832771d30..dbfc5f8e9a97f 100644 --- a/src/google/protobuf/compiler/cpp/helpers.cc +++ b/src/google/protobuf/compiler/cpp/helpers.cc @@ -1664,6 +1664,8 @@ bool GetBootstrapBasename(const Options& options, absl::string_view basename, "third_party/protobuf/descriptor"}, {"third_party/protobuf/cpp_features", "third_party/protobuf/cpp_features"}, + {"third_party/java/protobuf/java_features", + "third_party/java/protobuf/java_features_bootstrap"}, {"third_party/protobuf/compiler/plugin", "third_party/protobuf/compiler/plugin"}, {"net/proto2/compiler/proto/profile", diff --git a/src/google/protobuf/compiler/java/BUILD.bazel b/src/google/protobuf/compiler/java/BUILD.bazel index 40cd4a5fd8322..f188e07ca8757 100644 --- a/src/google/protobuf/compiler/java/BUILD.bazel +++ b/src/google/protobuf/compiler/java/BUILD.bazel @@ -86,6 +86,7 @@ cc_library( srcs = ["java_features.pb.cc"], hdrs = ["java_features.pb.h"], strip_include_prefix = "/src", + visibility = ["//editions:__pkg__"], deps = [ "//src/google/protobuf", "//src/google/protobuf:arena", diff --git a/src/google/protobuf/compiler/java/generator.h b/src/google/protobuf/compiler/java/generator.h index 53cb61607235e..1c49b86668051 100644 --- a/src/google/protobuf/compiler/java/generator.h +++ b/src/google/protobuf/compiler/java/generator.h @@ -18,8 +18,8 @@ #include #include -#include "google/protobuf/compiler/code_generator.h" #include "google/protobuf/compiler/java/java_features.pb.h" +#include "google/protobuf/compiler/code_generator.h" #include "google/protobuf/descriptor.pb.h" #include "google/protobuf/port.h" diff --git a/src/google/protobuf/compiler/java/internal_helpers.h b/src/google/protobuf/compiler/java/internal_helpers.h index 607669b26a1eb..720a34dccb07c 100644 --- a/src/google/protobuf/compiler/java/internal_helpers.h +++ b/src/google/protobuf/compiler/java/internal_helpers.h @@ -12,8 +12,8 @@ #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_INTERNAL_HELPERS_H__ #define GOOGLE_PROTOBUF_COMPILER_JAVA_INTERNAL_HELPERS_H__ -#include "google/protobuf/compiler/java/generator.h" #include "google/protobuf/compiler/java/java_features.pb.h" +#include "google/protobuf/compiler/java/generator.h" #include "google/protobuf/compiler/java/names.h" #include "google/protobuf/descriptor.h" #include "google/protobuf/descriptor.pb.h" diff --git a/src/google/protobuf/compiler/java/kotlin_generator.h b/src/google/protobuf/compiler/java/kotlin_generator.h index afc4085646cc7..a0d36816fb22e 100644 --- a/src/google/protobuf/compiler/java/kotlin_generator.h +++ b/src/google/protobuf/compiler/java/kotlin_generator.h @@ -12,8 +12,8 @@ #include -#include "google/protobuf/compiler/code_generator.h" #include "google/protobuf/compiler/java/java_features.pb.h" +#include "google/protobuf/compiler/code_generator.h" #include "google/protobuf/descriptor.pb.h" // Must be included last.