Skip to content

Commit

Permalink
Upgrade protobuf to 28.3 and add proto rules loads
Browse files Browse the repository at this point in the history
Upgrade protobuf to 28.3, this version has loads.
Call py_repositories, that's needed by protobuf.
Remove rules_proto, they've been deprecated.
Add @com_google_protobuf//java/core:lite to _SHADED_TARGETS. Protobuf has an alias pointing to that target. It can't be used directly though, because it's private.
Upgrade Bazel version to 6.5.0. Without that protobuf doesn't compile.

PiperOrigin-RevId: 696176142
  • Loading branch information
copybara-androidxtest committed Nov 13, 2024
1 parent 8047902 commit 9bb3ee6
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.0
6.5.0
21 changes: 11 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,19 @@ http_archive(
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)

# rules_proto defines proto_library, as well as @com_google_protobuf_javalite
# protobuf defines proto_library, as well as @com_google_protobuf_javalite
http_archive(
name = "rules_proto",
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
strip_prefix = "rules_proto-5.3.0-21.7",
urls = [
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
],
name = "com_google_protobuf",
sha256 = "7c3ebd7aaedd86fa5dc479a0fda803f602caaf78d8aff7ce83b89e1b8ae7442a",
strip_prefix = "protobuf-28.3",
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protobuf-28.3.tar.gz"],
)
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()

load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

Expand Down
1 change: 1 addition & 0 deletions build_extensions/maven/maven_registry.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ _TARGET_TO_MAVEN_ARTIFACT = {

_SHADED_TARGETS = [
"@com_google_protobuf//:protobuf_javalite",
"@com_google_protobuf//java/core:lite",
"//opensource/proto:any_java_proto_lite",
"@com_google_protobuf//:any_proto",
"//opensource/dagger:dagger",
Expand Down
2 changes: 2 additions & 0 deletions espresso/remote/java/androidx/test/espresso/proto/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Protocol buffer definitions for remote UI interactions

load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")

licenses(["notice"])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Protocol buffer definitions for remote UI interactions view matchers

load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")

licenses(["notice"])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Protocol buffer definitions for remote view assertions

load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")

licenses(["notice"])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Protocol buffer definitions for remote root, view and hamcrest matchers (v1.3)

load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")

licenses(["notice"])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Protocol buffer definitions for remote web actions

load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")

licenses(["notice"])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Protocol buffer definitions for remote web assertions

load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")

licenses(["notice"])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Protocol buffer definitions for remote web matchers

load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")

licenses(["notice"])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Protocol buffer definitions for remote web model atoms

load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")

licenses(["notice"])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Protocol buffer definitions for remote web sugar atoms

load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")

licenses(["notice"])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Protocol buffer definitions for remote web driver atoms

load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")

licenses(["notice"])
Expand Down
3 changes: 3 additions & 0 deletions espresso/remote/javatests/androidx/test/espresso/proto/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Protocol buffer definitions for any proto transformers. Only used in tests!

load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")

licenses(["notice"])

package(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")
load("//build_extensions:kt_android_library.bzl", "kt_android_library")

Expand Down
3 changes: 3 additions & 0 deletions services/storage/java/androidx/test/services/storage/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# Exposes sd card storage to tests regardless of permissions.

load("@build_bazel_rules_android//android:rules.bzl", "android_library")
load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:java_proto_library.bzl", "java_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")
load("//build_extensions:api_checks.bzl", "api_checks")
load("//build_extensions/maven:axt_android_aar.bzl", "axt_android_aar")
Expand Down

0 comments on commit 9bb3ee6

Please sign in to comment.