Skip to content

Commit b11d9f0

Browse files
hvadehrarules_java Copybara
authored andcommitted
Use @protobuf instead of @rules_proto in rules_java
`rules_proto` is still kept as a dependency for `@remote_java_tools` PiperOrigin-RevId: 682247564 Change-Id: I50535d2d23aa84cf62a2c7f9dec9fe1b360fcf2c
1 parent 2c8f7f4 commit b11d9f0

File tree

6 files changed

+45
-8
lines changed

6 files changed

+45
-8
lines changed

BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ licenses(["notice"])
33
exports_files([
44
"LICENSE",
55
"WORKSPACE",
6+
"protobuf_29.0-rc1.patch",
67
])
78

89
filegroup(

MODULE.bazel

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ bazel_dep(name = "platforms", version = "0.0.4")
99
bazel_dep(name = "rules_cc", version = "0.0.10")
1010
bazel_dep(name = "bazel_features", version = "1.11.0")
1111
bazel_dep(name = "bazel_skylib", version = "1.6.1")
12+
bazel_dep(name = "protobuf", version = "29.0-rc1")
13+
single_version_override(
14+
module_name = "protobuf",
15+
patch_strip = 1,
16+
patches = ["//:protobuf_29.0-rc1.patch"],
17+
version = "29.0-rc1",
18+
)
1219

1320
# Required by @remote_java_tools, which is loaded via module extension.
1421
bazel_dep(name = "rules_proto", version = "6.0.2")
@@ -92,9 +99,3 @@ REMOTE_JDK_REPOS = [(("remote_jdk" if version == "8" else "remotejdk") + version
9299
# Dev dependencies
93100
bazel_dep(name = "rules_pkg", version = "0.9.1", dev_dependency = True)
94101
bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True)
95-
96-
# Override rules_python version to deal with #161 and https://github.com/bazelbuild/bazel/issues/20458
97-
single_version_override(
98-
module_name = "rules_python",
99-
version = "0.24.0",
100-
)

java/bazel/rules/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ bzl_library(
3030
"@bazel_skylib//lib:paths",
3131
"@rules_cc//cc:find_cc_toolchain_bzl",
3232
"@rules_cc//cc/common",
33-
"@rules_proto//proto:defs",
3433
],
3534
)
3635

java/common/rules/impl/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ bzl_library(
1212
name = "impl",
1313
srcs = glob(["*.bzl"]),
1414
visibility = ["//java:__subpackages__"],
15+
deps = [
16+
"@protobuf//bazel/common:proto_info_bzl",
17+
],
1518
)
1619

1720
filegroup(

java/common/rules/impl/java_binary_impl.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
""" Implementation of java_binary for bazel """
1616

17+
load("@protobuf//bazel/common:proto_info.bzl", "ProtoInfo")
1718
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
1819
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
19-
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
2020
load("//java/common:java_common.bzl", "java_common")
2121
load("//java/common:java_info.bzl", "JavaInfo")
2222
load("//java/common:java_semantics.bzl", "semantics")

protobuf_29.0-rc1.patch

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
diff --git a/bazel/common/BUILD b/bazel/common/BUILD
2+
index c79d22280..9ab40ff05 100644
3+
--- a/bazel/common/BUILD
4+
+++ b/bazel/common/BUILD
5+
@@ -22,7 +22,8 @@ bzl_library(
6+
],
7+
visibility = ["//visibility:public"],
8+
deps = [
9+
- "//bazel/private:native_bzl",
10+
+ "//bazel/private:proto_info_bzl",
11+
+ "@proto_bazel_features//:features",
12+
],
13+
)
14+
15+
diff --git a/bazel/private/BUILD b/bazel/private/BUILD
16+
index 9b04c1f86..8e5207f3a 100644
17+
--- a/bazel/private/BUILD
18+
+++ b/bazel/private/BUILD
19+
@@ -108,6 +108,14 @@ bzl_library(
20+
],
21+
)
22+
23+
+bzl_library(
24+
+ name = "proto_info_bzl",
25+
+ srcs = [
26+
+ "proto_info.bzl",
27+
+ ],
28+
+ visibility = ["//bazel:__subpackages__"],
29+
+)
30+
+
31+
native_bool_flag(
32+
name = "experimental_proto_descriptor_sets_include_source_info",
33+
flag = "experimental_proto_descriptor_sets_include_source_info",

0 commit comments

Comments
 (0)