From 22f11700bc7b352308a3f49ba99639f9de8aaffa Mon Sep 17 00:00:00 2001 From: Sandy Zhang Date: Tue, 19 Mar 2024 15:09:00 -0700 Subject: [PATCH 1/2] Move java_features.proto to java/core/srce/main/resources This also fixes maven to package this correctly as google/protobuf/java_features.proto (same dir as WKT/descriptor.proto) instead of com/google/protobuf/java_features.proto. Fixes https://github.com/protocolbuffers/protobuf/issues/16155 PiperOrigin-RevId: 617307475 --- java/core/BUILD.bazel | 8 ++++---- java/core/generate-sources-build.xml | 2 +- java/core/pom.xml | 2 +- .../com => resources}/google/protobuf/java_features.proto | 0 java/pom.xml | 2 +- .../editions/golden/editions_transform_proto2.proto | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) rename java/core/src/main/{java/com => resources}/google/protobuf/java_features.proto (100%) diff --git a/java/core/BUILD.bazel b/java/core/BUILD.bazel index 92d9982815bf..9999fdf92dc3 100644 --- a/java/core/BUILD.bazel +++ b/java/core/BUILD.bazel @@ -168,15 +168,15 @@ protobuf_java_library( proto_library( name = "java_features_proto", - srcs = ["src/main/java/com/google/protobuf/java_features.proto"], - strip_import_prefix = "/java/core/src/main/java/com", + srcs = ["src/main/resources/google/protobuf/java_features.proto"], + strip_import_prefix = "/java/core/src/main/resources", visibility = ["//pkg:__pkg__"], deps = ["//:descriptor_proto"], ) filegroup( name = "java_features_proto_srcs", - srcs = ["src/main/java/com/google/protobuf/java_features.proto"], + srcs = ["src/main/resources/google/protobuf/java_features.proto"], visibility = ["//pkg:__pkg__"], ) @@ -552,7 +552,7 @@ pkg_files( name = "dist_files", srcs = glob([ "src/main/java/com/google/protobuf/*.java", - "src/main/java/com/google/protobuf/*.proto", + "src/main/resources/google/protobuf/*.proto", "src/test/java/**/*.java", "src/test/proto/**/*.proto", ]) + [ diff --git a/java/core/generate-sources-build.xml b/java/core/generate-sources-build.xml index 4ffd4384dc41..7021aa8e2231 100644 --- a/java/core/generate-sources-build.xml +++ b/java/core/generate-sources-build.xml @@ -5,7 +5,7 @@ - + diff --git a/java/core/pom.xml b/java/core/pom.xml index d52b903842b8..2d3977cbd33b 100644 --- a/java/core/pom.xml +++ b/java/core/pom.xml @@ -62,7 +62,7 @@ ${protobuf.java_source.dir} - main/java/com/google/protobuf/java_features.proto + google/protobuf/java_features.proto diff --git a/java/core/src/main/java/com/google/protobuf/java_features.proto b/java/core/src/main/resources/google/protobuf/java_features.proto similarity index 100% rename from java/core/src/main/java/com/google/protobuf/java_features.proto rename to java/core/src/main/resources/google/protobuf/java_features.proto diff --git a/java/pom.xml b/java/pom.xml index 440fd3c696b5..65d9c4bb1734 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -33,7 +33,7 @@ ${project.basedir}/../.. ${protobuf.basedir}/src - ${protobuf.basedir}/java/core/src + ${protobuf.basedir}/java/core/src/main/resources ${protobuf.basedir}/protoc src/test/proto ${project.build.directory}/generated-sources diff --git a/src/google/protobuf/editions/golden/editions_transform_proto2.proto b/src/google/protobuf/editions/golden/editions_transform_proto2.proto index c8e9fb2b3eb6..1a00ad8fe6ee 100644 --- a/src/google/protobuf/editions/golden/editions_transform_proto2.proto +++ b/src/google/protobuf/editions/golden/editions_transform_proto2.proto @@ -14,7 +14,7 @@ edition = "2023"; package protobuf_editions_test; -import "third_party/java_src/protobuf/current/java/com/google/protobuf/java_features.proto"; +import "google/protobuf/java_features.proto"; import "google/protobuf/cpp_features.proto"; import "google/protobuf/editions/proto/editions_transform_proto3.proto"; From a2f5303916d00725cbd63ee92445b330f70d71a6 Mon Sep 17 00:00:00 2001 From: Sandy Zhang Date: Mon, 25 Mar 2024 20:42:41 -0400 Subject: [PATCH 2/2] Update cmake stalenes --- src/file_lists.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file_lists.cmake b/src/file_lists.cmake index 3c97ff1980c5..33740dbd25b9 100644 --- a/src/file_lists.cmake +++ b/src/file_lists.cmake @@ -602,7 +602,7 @@ set(plugin_proto_files # @//java/core:java_features_proto set(java_features_proto_proto_srcs - ${protobuf_SOURCE_DIR}/java/core/src/main/java/com/google/protobuf/java_features.proto + ${protobuf_SOURCE_DIR}/java/core/src/main/resources/google/protobuf/java_features.proto ) # @//java/core:java_features_proto