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
pull/16309/head
Sandy Zhang 11 months ago
parent b4e1870807
commit 22f11700bc
  1. 8
      java/core/BUILD.bazel
  2. 2
      java/core/generate-sources-build.xml
  3. 2
      java/core/pom.xml
  4. 0
      java/core/src/main/resources/google/protobuf/java_features.proto
  5. 2
      java/pom.xml
  6. 2
      src/google/protobuf/editions/golden/editions_transform_proto2.proto

@ -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",
]) + [

@ -5,7 +5,7 @@
<arg value="--java_out=${generated.sources.dir}"/>
<arg value="--proto_path=${protobuf.source.dir}"/>
<arg value="--proto_path=${protobuf.java_source.dir}"/>
<arg value="${protobuf.java_source.dir}/main/java/com/google/protobuf/java_features.proto"/>
<arg value="${protobuf.java_source.dir}/google/protobuf/java_features.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/any.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/api.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/descriptor.proto"/>

@ -62,7 +62,7 @@
<resource>
<directory>${protobuf.java_source.dir}</directory>
<includes>
<include>main/java/com/google/protobuf/java_features.proto</include>
<include>google/protobuf/java_features.proto</include>
</includes>
</resource>
</resources>

@ -33,7 +33,7 @@
<!-- These are relative to the submodules -->
<protobuf.basedir>${project.basedir}/../..</protobuf.basedir>
<protobuf.source.dir>${protobuf.basedir}/src</protobuf.source.dir>
<protobuf.java_source.dir>${protobuf.basedir}/java/core/src</protobuf.java_source.dir>
<protobuf.java_source.dir>${protobuf.basedir}/java/core/src/main/resources</protobuf.java_source.dir>
<protoc>${protobuf.basedir}/protoc</protoc>
<test.proto.dir>src/test/proto</test.proto.dir>
<generated.sources.dir>${project.build.directory}/generated-sources</generated.sources.dir>

@ -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";

Loading…
Cancel
Save