Skip to content

Commit

Permalink
Move java_features.proto to java/core/srce/main/resources
Browse files Browse the repository at this point in the history
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 #16155

PiperOrigin-RevId: 619015714
  • Loading branch information
zhangskz authored and copybara-github committed Mar 26, 2024
1 parent e879f6b commit 274bc7f
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions java/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ 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 = [
"//java/kotlin:__pkg__",
"//java/kotlin-lite:__pkg__",
Expand All @@ -184,7 +184,7 @@ proto_library(

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__"],
)

Expand Down Expand Up @@ -560,7 +560,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",
]) + [
Expand Down
2 changes: 1 addition & 1 deletion java/core/generate-sources-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down
2 changes: 1 addition & 1 deletion java/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion java/kotlin-lite/generate-sources-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<arg value="--kotlin_out=lite:${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"/>
Expand Down
2 changes: 1 addition & 1 deletion java/lite/generate-sources-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<arg value="--java_out=lite:${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"/>
Expand Down
2 changes: 1 addition & 1 deletion java/lite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,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>
Expand Down
2 changes: 1 addition & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ edition = "2023";
package protobuf_editions_test;

import "net/proto/proto1_features.proto";
import "third_party/java_src/protobuf/current/java/com/google/protobuf/java_features.proto";
import "third_party/java/protobuf/java_features.proto";
import "google/protobuf/cpp_features.proto";
import "google/protobuf/editions/proto/editions_transform_proto3.proto";

Expand Down

0 comments on commit 274bc7f

Please sign in to comment.