diff --git a/.bazelversion b/.bazelversion index ba7f754d0..af813d8c4 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.4.0 +9.0.0rc3 diff --git a/MODULE.bazel b/MODULE.bazel index 19a49858f..6bad1b2f3 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -4,20 +4,20 @@ module( compatibility_level = 1, ) -bazel_dep(name = "platforms", version = "0.0.5") +bazel_dep(name = "platforms", version = "1.0.0") bazel_dep(name = "rules_license", version = "1.0.0") -bazel_dep(name = "rules_java", version = "8.13.0") -bazel_dep(name = "rules_cc", version = "0.1.1") -bazel_dep(name = "rules_shell", version = "0.1.2") +bazel_dep(name = "rules_java", version = "9.0.3") +bazel_dep(name = "rules_cc", version = "0.2.14") +bazel_dep(name = "rules_shell", version = "0.6.1") bazel_dep(name = "stardoc", version = "0.7.2", dev_dependency = True) rules_java_toolchains = use_extension("@rules_java//java:extensions.bzl", "toolchains") use_repo(rules_java_toolchains, "remote_java_tools") -bazel_dep(name = "protobuf", version = "31.1", repo_name = "com_google_protobuf") -bazel_dep(name = "rules_jvm_external", version = "6.6") -bazel_dep(name = "bazel_skylib", version = "1.0.3") +bazel_dep(name = "protobuf", version = "33.0", repo_name = "com_google_protobuf") +bazel_dep(name = "rules_jvm_external", version = "6.7") +bazel_dep(name = "bazel_skylib", version = "1.8.1") bazel_dep(name = "rules_robolectric", version = "4.14.1.2", repo_name = "robolectric") register_toolchains("//toolchains/android:all") @@ -25,11 +25,11 @@ register_toolchains("//toolchains/android:all") register_toolchains("//toolchains/android_sdk:all") # go-related dependency setup -bazel_dep(name = "rules_go", version = "0.51.0-rc2", repo_name = "io_bazel_rules_go") -bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") +bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "io_bazel_rules_go") +bazel_dep(name = "gazelle", version = "0.47.0", repo_name = "bazel_gazelle") bazel_dep(name = "abseil-py", version = "2.1.0", repo_name = "py_absl") -bazel_dep(name = "bazel_worker_api", version = "0.0.4") -bazel_dep(name = "bazel_worker_java", version = "0.0.4") +bazel_dep(name = "bazel_worker_api", version = "0.0.6") +bazel_dep(name = "bazel_worker_java", version = "0.0.6") go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk") go_sdk.download(version = "1.22.4") @@ -46,7 +46,7 @@ use_repo( ) # python-related dependency setup -bazel_dep(name = "rules_python", version = "0.37.1", repo_name = "rules_python") +bazel_dep(name = "rules_python", version = "1.6.0", repo_name = "rules_python") python = use_extension("@rules_python//python/extensions:python.bzl", "python") python.toolchain( @@ -55,10 +55,21 @@ python.toolchain( ) # proto-related dependency setup -bazel_dep(name = "rules_proto", version = "6.0.2", repo_name = "rules_proto") +bazel_dep(name = "rules_proto", version = "7.1.0", repo_name = "rules_proto") maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") +# Shared maven repository for bazel_worker_java and protobuf dependencies +maven.install( + artifacts = [ + "com.google.protobuf:protobuf-java:4.33.0", + "com.google.protobuf:protobuf-java-util:4.33.0", + ], + repositories = [ + "https://repo1.maven.org/maven2", + ], +) + # Maven for android_ide_common need to be separated into their own separate maven_install for now # due to compatibility issues with newer versions. maven.install( @@ -79,8 +90,8 @@ maven.install( # These technically aren't needed, but the protobuf version pulled # in by these older deps has compatibility issues with the newer # protobuf runtimes. - "com.google.protobuf:protobuf-java:4.31.1", - "com.google.protobuf:protobuf-java-util:4.31.1", + "com.google.protobuf:protobuf-java:4.33.0", + "com.google.protobuf:protobuf-java-util:4.33.0", ], repositories = [ "https://maven.google.com", @@ -89,6 +100,7 @@ maven.install( use_starlark_android_rules = True, ) use_repo(maven, "android_ide_common_30_1_3") + maven.install( name = "rules_android_maven", aar_import_bzl_label = "@rules_android//rules:rules.bzl", @@ -117,8 +129,8 @@ maven.install( "jakarta.inject:jakarta.inject-api:2.0.1", "junit:junit:4.13.2", "com.beust:jcommander:1.82", - "com.google.protobuf:protobuf-java:4.31.1", - "com.google.protobuf:protobuf-java-util:4.31.1", + "com.google.protobuf:protobuf-java:4.33.0", + "com.google.protobuf:protobuf-java-util:4.33.0", "com.google.code.findbugs:jsr305:3.0.2", "androidx.databinding:databinding-compiler:8.7.0", "org.ow2.asm:asm:9.6", @@ -160,7 +172,6 @@ maven.install( # lock_file = "//:rules_android_maven_install.json", use_starlark_android_rules = True, ) - use_repo( maven, "rules_android_maven", @@ -177,7 +188,7 @@ bazel_dep( ) bazel_dep( name = "cgrindel_bazel_starlib", - version = "0.17.0", + version = "0.18.0", dev_dependency = True, ) @@ -187,7 +198,7 @@ bazel_binaries = use_extension( dev_dependency = True, ) bazel_binaries.download(version = "last_green") -use_repo(bazel_binaries, "bazel_binaries") +use_repo(bazel_binaries, "bazel_binaries", "bazel_binaries_bazelisk", "build_bazel_bazel_last_green") # extension for apksignerextensions apksig_extension = use_extension("//bzlmod_extensions:apksig.bzl", "apksig_extension") diff --git a/examples/basicapp/MODULE.bazel b/examples/basicapp/MODULE.bazel index 997e5292b..257e523bf 100644 --- a/examples/basicapp/MODULE.bazel +++ b/examples/basicapp/MODULE.bazel @@ -2,8 +2,9 @@ module( name = "basicapp", ) -bazel_dep(name = "rules_java", version = "8.12.0") -bazel_dep(name = "bazel_skylib", version = "1.3.0") +bazel_dep(name = "rules_java", version = "9.0.3") +bazel_dep(name = "bazel_skylib", version = "1.8.1") +bazel_dep(name = "rules_jvm_external", version = "6.7") bazel_dep( name = "rules_android", @@ -19,6 +20,18 @@ local_path_override( path = "../../", ) +# Shared maven repository for bazel_worker_java and protobuf dependencies +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") +maven.install( + artifacts = [ + "com.google.protobuf:protobuf-java:4.33.0", + "com.google.protobuf:protobuf-java-util:4.33.0", + ], + repositories = [ + "https://repo1.maven.org/maven2", + ], +) + remote_android_extensions = use_extension( "@rules_android//bzlmod_extensions:android_extensions.bzl", "remote_android_tools_extensions") diff --git a/prereqs.bzl b/prereqs.bzl index ca22a430b..1a395cbbe 100644 --- a/prereqs.bzl +++ b/prereqs.bzl @@ -25,17 +25,17 @@ def rules_android_prereqs(dev_mode = False): http_archive, name = "rules_java", urls = [ - "https://github.com/bazelbuild/rules_java/releases/download/8.13.0/rules_java-8.13.0.tar.gz", + "https://github.com/bazelbuild/rules_java/releases/download/9.0.3/rules_java-9.0.3.tar.gz", ], - sha256 = "b6c6d92ca9dbb77de31fb6c6a794d20427072663ce41c2b047902ffcc123e3ef", + sha256 = "865b3d334bd0f769587737447410d8042d6a95134cc45be5380805fdbacd7152", ) maybe( http_archive, name = "rules_cc", - urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.1.1/rules_cc-0.1.1.tar.gz"], - sha256 = "712d77868b3152dd618c4d64faaddefcc5965f90f5de6e6dd1d5ddcd0be82d42", - strip_prefix = "rules_cc-0.1.1", + urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.2.14/rules_cc-0.2.14.tar.gz"], + sha256 = "a2fdfde2ab9b2176bd6a33afca14458039023edb1dd2e73e6823810809df4027", + strip_prefix = "rules_cc-0.2.14", ) maybe( @@ -45,8 +45,8 @@ def rules_android_prereqs(dev_mode = False): url = "https://mirror.bazel.build/bazel_android_tools/android_tools_pkg-0.31.0.tar", ) - RULES_JVM_EXTERNAL_TAG = "6.6" - RULES_JVM_EXTERNAL_SHA = "3afe5195069bd379373528899c03a3072f568d33bd96fe037bd43b1f590535e7" + RULES_JVM_EXTERNAL_TAG = "6.7" + RULES_JVM_EXTERNAL_SHA = "a1e351607f04fed296ba33c4977d3fe2a615ed50df7896676b67aac993c53c18" maybe( http_archive, name = "rules_jvm_external", @@ -55,8 +55,8 @@ def rules_android_prereqs(dev_mode = False): url = "https://github.com/bazelbuild/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG), ) - PROTOBUF_VERSION = "31.1" - PROTOBUF_HASH = "12bfd76d27b9ac3d65c00966901609e020481b9474ef75c7ff4601ac06fa0b82" + PROTOBUF_VERSION = "33.0" + PROTOBUF_HASH = "cbc536064706b628dcfe507bef386ef3e2214d563657612296f1781aa155ee07" maybe( http_archive, name = "com_google_protobuf", @@ -77,29 +77,29 @@ def rules_android_prereqs(dev_mode = False): http_archive( name = "bazel_skylib", - sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", + sha256 = "51b5105a760b353773f904d2bbc5e664d0987fbaf22265164de65d43e910d8ac", urls = [ - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.8.1/bazel-skylib-1.8.1.tar.gz", ], ) maybe( http_archive, name = "io_bazel_rules_go", - sha256 = "1101d7e81a6e7f9cee94dd947bed705144bf339257fbec1d73d620df87e58885", + sha256 = "68af54cb97fbdee5e5e8fe8d210d15a518f9d62abfd71620c3eaff3b26a5ff86", urls = [ - "https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.51.0-rc2/rules_go-v0.51.0-rc2.zip", - "https://github.com/bazel-contrib/rules_go/releases/download/v0.51.0-rc2/rules_go-v0.51.0-rc2.zip", + "https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.59.0/rules_go-v0.59.0.zip", + "https://github.com/bazel-contrib/rules_go/releases/download/v0.59.0/rules_go-v0.59.0.zip", ], ) maybe( http_archive, name = "bazel_gazelle", - sha256 = "a80893292ae1d78eaeedd50d1cab98f242a17e3d5741b1b9fb58b5fd9d2d57bc", + sha256 = "675114d8b433d0a9f54d81171833be96ebc4113115664b791e6f204d58e93446", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.40.0/bazel-gazelle-v0.40.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.40.0/bazel-gazelle-v0.40.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.47.0/bazel-gazelle-v0.47.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.47.0/bazel-gazelle-v0.47.0.tar.gz", ], ) @@ -133,21 +133,21 @@ def rules_android_prereqs(dev_mode = False): maybe( http_archive, name = "rules_proto", - sha256 = "0e5c64a2599a6e26c6a03d6162242d231ecc0de219534c38cb4402171def21e8", - strip_prefix = "rules_proto-7.0.2", - url = "https://github.com/bazelbuild/rules_proto/releases/download/7.0.2/rules_proto-7.0.2.tar.gz", + sha256 = "14a225870ab4e91869652cfd69ef2028277fc1dc4910d65d353b62d6e0ae21f4", + strip_prefix = "rules_proto-7.1.0", + url = "https://github.com/bazelbuild/rules_proto/releases/download/7.1.0/rules_proto-7.1.0.tar.gz", ) maybe( http_archive, name = "rules_python", - sha256 = "690e0141724abb568267e003c7b6d9a54925df40c275a870a4d934161dc9dd53", - strip_prefix = "rules_python-0.40.0", - url = "https://github.com/bazelbuild/rules_python/releases/download/0.40.0/rules_python-0.40.0.tar.gz", + sha256 = "fa7dd2c6b7d63b3585028dd8a90a6cf9db83c33b250959c2ee7b583a6c130e12", + strip_prefix = "rules_python-1.6.0", + url = "https://github.com/bazelbuild/rules_python/releases/download/1.6.0/rules_python-1.6.0.tar.gz", ) - BAZEL_WORKER_API_VERSION = "0.0.4" - BAZEL_WORKER_API_HASH = "79b30bcdab8cb0dce1523b28ff798067419715f5540a8a446bbccf393e5eb79c" + BAZEL_WORKER_API_VERSION = "0.0.6" + BAZEL_WORKER_API_HASH = "5aac6ae6a23015cc7984492a114dc539effc244ec5ac7f8f6b1539c15fb376eb" maybe( http_archive, name = "bazel_worker_api", @@ -171,19 +171,19 @@ def rules_android_prereqs(dev_mode = False): http_archive, name = "rules_shell", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_shell/releases/download/v0.3.0/rules_shell-v0.3.0.tar.gz", - "https://github.com/bazelbuild/rules_shell/releases/download/v0.3.0/rules_shell-v0.3.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_shell/releases/download/v0.6.1/rules_shell-v0.6.1.tar.gz", + "https://github.com/bazelbuild/rules_shell/releases/download/v0.6.1/rules_shell-v0.6.1.tar.gz", ], - sha256 = "d8cd4a3a91fc1dc68d4c7d6b655f09def109f7186437e3f50a9b60ab436a0c53", - strip_prefix = "rules_shell-0.3.0", + sha256 = "e6b87c89bd0b27039e3af2c5da01147452f240f75d505f5b6880874f31036307", + strip_prefix = "rules_shell-0.6.1", ) maybe( http_archive, name = "rules_cc", - urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.16/rules_cc-0.0.16.tar.gz"], - sha256 = "bbf1ae2f83305b7053b11e4467d317a7ba3517a12cef608543c1b1c5bf48a4df", - strip_prefix = "rules_cc-0.0.16", + urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.2.14/rules_cc-0.2.14.tar.gz"], + sha256 = "a2fdfde2ab9b2176bd6a33afca14458039023edb1dd2e73e6823810809df4027", + strip_prefix = "rules_cc-0.2.14", ) maybe( @@ -198,9 +198,9 @@ def rules_android_prereqs(dev_mode = False): maybe( http_archive, name = "bazel_skylib", - sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", + sha256 = "51b5105a760b353773f904d2bbc5e664d0987fbaf22265164de65d43e910d8ac", urls = [ - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.8.1/bazel-skylib-1.8.1.tar.gz", ], ) @@ -220,8 +220,8 @@ def rules_android_prereqs(dev_mode = False): maybe( http_archive, name = "cgrindel_bazel_starlib", - sha256 = "a8d25340956b429b56302d3fd702bb3df8b3a67db248dd32b3084891ad497964", + sha256 = "dfa423dbf5aac0a5217d3780b295abd3ea1c633d5f9198712b23f0f14f2e8d92", urls = [ - "https://github.com/cgrindel/bazel-starlib/releases/download/v0.17.0/bazel-starlib.v0.17.0.tar.gz", + "https://github.com/cgrindel/bazel-starlib/releases/download/v0.18.0/bazel-starlib.v0.18.0.tar.gz", ], ) diff --git a/src/common/golang/BUILD b/src/common/golang/BUILD index 03048a088..34b9f8856 100644 --- a/src/common/golang/BUILD +++ b/src/common/golang/BUILD @@ -1,8 +1,7 @@ # Description: # Common libraries and utilities. -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") package( default_applicable_licenses = ["//:license"], diff --git a/src/java/com/example/sampleapp/BUILD b/src/java/com/example/sampleapp/BUILD index 0e248017b..1ba04447c 100644 --- a/src/java/com/example/sampleapp/BUILD +++ b/src/java/com/example/sampleapp/BUILD @@ -1,5 +1,6 @@ # Sample app to demonstrate proper rule structuring and mobile-install usage. +load("@rules_cc//cc:cc_library.bzl", "cc_library") load("//rules:rules.bzl", "android_binary", "android_library") package(default_visibility = ["//src:__subpackages__"]) diff --git a/src/tools/ak/BUILD b/src/tools/ak/BUILD index e1752a7af..565c7db9f 100644 --- a/src/tools/ak/BUILD +++ b/src/tools/ak/BUILD @@ -1,8 +1,7 @@ # Description: # Top level package for ak, a "busybox" for various minor build-related tools. -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/bucketize/BUILD b/src/tools/ak/bucketize/BUILD index 3bf7fc08a..d4a38b7b9 100644 --- a/src/tools/ak/bucketize/BUILD +++ b/src/tools/ak/bucketize/BUILD @@ -2,7 +2,6 @@ # Package for bucketize module load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/compile/BUILD b/src/tools/ak/compile/BUILD index 4a7dea992..451d5a2ea 100644 --- a/src/tools/ak/compile/BUILD +++ b/src/tools/ak/compile/BUILD @@ -2,7 +2,6 @@ # Package for compile module load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/extractaar/BUILD b/src/tools/ak/extractaar/BUILD index f596b7dbf..447affd63 100644 --- a/src/tools/ak/extractaar/BUILD +++ b/src/tools/ak/extractaar/BUILD @@ -2,7 +2,6 @@ # Package for extractaar module load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/extractresources/BUILD b/src/tools/ak/extractresources/BUILD index 8d66696ae..450c473b8 100644 --- a/src/tools/ak/extractresources/BUILD +++ b/src/tools/ak/extractresources/BUILD @@ -2,7 +2,6 @@ # Package for the extractresources tool (formerly resource_extractor.py). load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/finalrjar/BUILD b/src/tools/ak/finalrjar/BUILD index c347db66c..63f3a7eb4 100644 --- a/src/tools/ak/finalrjar/BUILD +++ b/src/tools/ak/finalrjar/BUILD @@ -2,7 +2,6 @@ # Package for final R.jar module load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/generatemanifest/BUILD b/src/tools/ak/generatemanifest/BUILD index dc68bf565..ae8fae319 100644 --- a/src/tools/ak/generatemanifest/BUILD +++ b/src/tools/ak/generatemanifest/BUILD @@ -1,7 +1,6 @@ # Package for manifest generation module load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/link/BUILD b/src/tools/ak/link/BUILD index 6ebac6fe9..4362b9a1e 100644 --- a/src/tools/ak/link/BUILD +++ b/src/tools/ak/link/BUILD @@ -1,8 +1,7 @@ # Description: # Package for link module -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/liteparse/BUILD b/src/tools/ak/liteparse/BUILD index 6eacb3f24..a6ab3181c 100644 --- a/src/tools/ak/liteparse/BUILD +++ b/src/tools/ak/liteparse/BUILD @@ -2,7 +2,6 @@ # Package for parse module load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/manifest/BUILD b/src/tools/ak/manifest/BUILD index c15dc0527..542a8ab73 100644 --- a/src/tools/ak/manifest/BUILD +++ b/src/tools/ak/manifest/BUILD @@ -1,7 +1,6 @@ # Package for manifest compilation module -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/minsdkfloor/BUILD b/src/tools/ak/minsdkfloor/BUILD index b1b98b93a..41c3bcf31 100644 --- a/src/tools/ak/minsdkfloor/BUILD +++ b/src/tools/ak/minsdkfloor/BUILD @@ -2,7 +2,6 @@ # Package for tool to enforce min SDK floor on AndroidManifests load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/nativelib/BUILD b/src/tools/ak/nativelib/BUILD index 1c06b7441..38fc0b254 100644 --- a/src/tools/ak/nativelib/BUILD +++ b/src/tools/ak/nativelib/BUILD @@ -2,7 +2,6 @@ # Package for nativelib module load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/nativelib/testdata/BUILD b/src/tools/ak/nativelib/testdata/BUILD index df02afcd4..43c7fc3b4 100644 --- a/src/tools/ak/nativelib/testdata/BUILD +++ b/src/tools/ak/nativelib/testdata/BUILD @@ -1,8 +1,5 @@ # Creates test data for testing the nativelib action. -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") - package( default_applicable_licenses = ["//:license"], default_visibility = ["//src/tools/ak/nativelib:__subpackages__"], diff --git a/src/tools/ak/patch/BUILD b/src/tools/ak/patch/BUILD index 3c0d36fd7..f3851070d 100644 --- a/src/tools/ak/patch/BUILD +++ b/src/tools/ak/patch/BUILD @@ -2,7 +2,6 @@ # Package for patch module load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/repack/BUILD b/src/tools/ak/repack/BUILD index b2c4e6aea..1a72fb555 100644 --- a/src/tools/ak/repack/BUILD +++ b/src/tools/ak/repack/BUILD @@ -2,7 +2,6 @@ # Package for repack module load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/res/BUILD b/src/tools/ak/res/BUILD index d2c6d5a7b..0a62afb99 100644 --- a/src/tools/ak/res/BUILD +++ b/src/tools/ak/res/BUILD @@ -1,8 +1,7 @@ # Description: # Package for res module -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/res/proto/BUILD b/src/tools/ak/res/proto/BUILD index 04c8c26b0..36a4248d0 100644 --- a/src/tools/ak/res/proto/BUILD +++ b/src/tools/ak/res/proto/BUILD @@ -1,9 +1,8 @@ # Description # Android resources proto -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/res/respipe/BUILD b/src/tools/ak/res/respipe/BUILD index 1b5445e2e..b755123fa 100644 --- a/src/tools/ak/res/respipe/BUILD +++ b/src/tools/ak/res/respipe/BUILD @@ -1,5 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") package(default_applicable_licenses = ["//:license"]) diff --git a/src/tools/ak/res/resxml/BUILD b/src/tools/ak/res/resxml/BUILD index 20a1d7124..6277da92f 100644 --- a/src/tools/ak/res/resxml/BUILD +++ b/src/tools/ak/res/resxml/BUILD @@ -1,5 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") package(default_applicable_licenses = ["//:license"]) diff --git a/src/tools/ak/rjar/BUILD b/src/tools/ak/rjar/BUILD index f5e0f4002..9988ecb60 100644 --- a/src/tools/ak/rjar/BUILD +++ b/src/tools/ak/rjar/BUILD @@ -2,7 +2,6 @@ # Package for R.jar module load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/ak/rjar/testdata/BUILD b/src/tools/ak/rjar/testdata/BUILD index bc8a80287..36ede163a 100644 --- a/src/tools/ak/rjar/testdata/BUILD +++ b/src/tools/ak/rjar/testdata/BUILD @@ -1,8 +1,5 @@ # Creates test data for testing the rjar action. -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") - package(default_visibility = ["//src/tools/ak/rjar:__subpackages__"]) licenses(["notice"]) diff --git a/src/tools/bundletool_module_builder/BUILD b/src/tools/bundletool_module_builder/BUILD index fc031ba93..b5163d191 100644 --- a/src/tools/bundletool_module_builder/BUILD +++ b/src/tools/bundletool_module_builder/BUILD @@ -1,5 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_binary") package( default_applicable_licenses = ["//:license"], diff --git a/src/tools/deploy_info/BUILD b/src/tools/deploy_info/BUILD index 9e8840d5c..fbb87dc69 100644 --- a/src/tools/deploy_info/BUILD +++ b/src/tools/deploy_info/BUILD @@ -1,5 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_binary") package(default_applicable_licenses = ["//:license"]) diff --git a/src/tools/deploy_info/proto/BUILD b/src/tools/deploy_info/proto/BUILD index 2548ac6ef..914b36a34 100644 --- a/src/tools/deploy_info/proto/BUILD +++ b/src/tools/deploy_info/proto/BUILD @@ -1,6 +1,5 @@ load("@com_google_protobuf//bazel:java_proto_library.bzl", "java_proto_library") load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") proto_library( diff --git a/src/tools/extract_desugar_pgcfg_flags/BUILD b/src/tools/extract_desugar_pgcfg_flags/BUILD index 13a67aad5..361de5741 100644 --- a/src/tools/extract_desugar_pgcfg_flags/BUILD +++ b/src/tools/extract_desugar_pgcfg_flags/BUILD @@ -1,5 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_binary") load("@rules_shell//shell:sh_test.bzl", "sh_test") # Utility and test for extracting pgcfg flags from the desugar_jdk_libs config JSON file. diff --git a/src/tools/jar_to_module_info/BUILD b/src/tools/jar_to_module_info/BUILD index 28d036bba..42f72d77d 100644 --- a/src/tools/jar_to_module_info/BUILD +++ b/src/tools/jar_to_module_info/BUILD @@ -8,9 +8,8 @@ go_binary( go_library( name = "jar_to_module_info_lib", - importpath = "src/tools/jar_to_module_info/jar_to_module_info_lib", - srcs = ["jar_to_module_info.go"], + importpath = "src/tools/jar_to_module_info/jar_to_module_info_lib", visibility = ["//visibility:private"], deps = ["@org_bitbucket_creachadair_stringset//:stringset"], ) diff --git a/src/tools/javatests/com/google/devtools/build/android/r8/testdata/naming001/Reflect.java b/src/tools/javatests/com/google/devtools/build/android/r8/testdata/naming001/Reflect.java index 141c58c24..53632e086 100644 --- a/src/tools/javatests/com/google/devtools/build/android/r8/testdata/naming001/Reflect.java +++ b/src/tools/javatests/com/google/devtools/build/android/r8/testdata/naming001/Reflect.java @@ -23,7 +23,7 @@ * testing in the R8 repo. The class was actually there for testing some R8 renaming, and * CompatDexBuilderTest just happened to piggy-bag on this class. */ -@SuppressWarnings({"PrivateConstructorForUtilityClass", "ClassCanBeStatic"}) +@SuppressWarnings({"PrivateConstructorForUtilityClass", "ClassCanBeStatic", "ReturnValueIgnored"}) public class Reflect { void keep() throws ClassNotFoundException { Class.forName("naming001.Reflect2"); diff --git a/src/tools/javatests/com/google/devtools/build/android/xml/BUILD b/src/tools/javatests/com/google/devtools/build/android/xml/BUILD index 669bc1e81..6eae82e85 100644 --- a/src/tools/javatests/com/google/devtools/build/android/xml/BUILD +++ b/src/tools/javatests/com/google/devtools/build/android/xml/BUILD @@ -25,15 +25,15 @@ java_test( name = "ProtoXmlUtilsTest", size = "small", srcs = ["ProtoXmlUtilsTest.java"], + runtime_deps = [ + "@rules_android_maven//:com_google_guava_guava", + ], deps = [ "//src/tools/java/com/google/devtools/build/android:android_builder_lib", "//src/tools/java/com/google/devtools/build/android/proto:resources_java_proto", "@rules_android_maven//:com_google_truth_truth", "@rules_android_maven//:junit_junit", ], - runtime_deps = [ - "@rules_android_maven//:com_google_guava_guava", - ], ) java_test( diff --git a/src/tools/jdeps/BUILD b/src/tools/jdeps/BUILD index 2170f204a..a18b0f946 100644 --- a/src/tools/jdeps/BUILD +++ b/src/tools/jdeps/BUILD @@ -1,5 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_binary") load("@rules_shell//shell:sh_test.bzl", "sh_test") # Description: diff --git a/src/tools/jdeps/proto/BUILD b/src/tools/jdeps/proto/BUILD index a5566f856..aca7d9077 100644 --- a/src/tools/jdeps/proto/BUILD +++ b/src/tools/jdeps/proto/BUILD @@ -1,4 +1,3 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") go_proto_library( diff --git a/src/tools/mi/broker/BUILD b/src/tools/mi/broker/BUILD index ecb28d946..1fe4a34cd 100644 --- a/src/tools/mi/broker/BUILD +++ b/src/tools/mi/broker/BUILD @@ -1,8 +1,7 @@ # Description: # Device broker packages. -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") package(default_applicable_licenses = ["//:license"]) diff --git a/src/tools/mi/deployment/BUILD b/src/tools/mi/deployment/BUILD index 42c8b88bd..d594ecfd6 100644 --- a/src/tools/mi/deployment/BUILD +++ b/src/tools/mi/deployment/BUILD @@ -22,12 +22,11 @@ go_binary( go_library( name = "deployment", - importpath = "src/tools/mi/deployment/deployment", - srcs = [ "deploy.go", "deploy_utils.go", ], + importpath = "src/tools/mi/deployment/deployment", visibility = ["//src/tools/mi:__subpackages__"], deps = [ "//src/common/golang:pprint", diff --git a/src/tools/split_core_jar/BUILD b/src/tools/split_core_jar/BUILD index 1499bd599..4bebdf494 100644 --- a/src/tools/split_core_jar/BUILD +++ b/src/tools/split_core_jar/BUILD @@ -8,9 +8,8 @@ go_binary( go_library( name = "split_core_jar_lib", - importpath = "src/tools/split_core_jar/split_core_jar_lib", - srcs = ["split_core_jar.go"], + importpath = "src/tools/split_core_jar/split_core_jar_lib", visibility = ["//visibility:private"], deps = ["@org_bitbucket_creachadair_stringset//:stringset"], ) diff --git a/src/validations/aar_import_checks/BUILD b/src/validations/aar_import_checks/BUILD index 10086f05d..d0fa80422 100644 --- a/src/validations/aar_import_checks/BUILD +++ b/src/validations/aar_import_checks/BUILD @@ -60,4 +60,4 @@ alias( ":windows": "aar_import_checks.bat", "//conditions:default": "aar_import_checks.sh", }), -) \ No newline at end of file +) diff --git a/test/rules/android_binary/BUILD b/test/rules/android_binary/BUILD index 5cc48d946..1d37d42d4 100644 --- a/test/rules/android_binary/BUILD +++ b/test/rules/android_binary/BUILD @@ -1,5 +1,6 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc/toolchains:cc_toolchain.bzl", "cc_toolchain") load("@rules_java//java:java_library.bzl", "java_library") load("//rules:rules.bzl", "android_binary", "android_library") load(":test.bzl", "fake_cc_toolchain_config", "multiple_android_platforms_test") diff --git a/test/rules/android_binary/test.bzl b/test/rules/android_binary/test.bzl index 7a0814651..50226bd22 100644 --- a/test/rules/android_binary/test.bzl +++ b/test/rules/android_binary/test.bzl @@ -13,6 +13,8 @@ # limitations under the License. """Tests for android_binary.""" +load("@rules_cc//cc:defs.bzl", "CcToolchainConfigInfo") +load("@rules_cc//cc/common:cc_common.bzl", "cc_common") load("//rules:visibility.bzl", "PROJECT_VISIBILITY") load( "//test/utils:lib.bzl", @@ -50,6 +52,7 @@ def multiple_android_platforms_test_impl(ctx): Returns: The providers. """ + # This test only needs to run analysis on the android_binary # in target_under_test. env = analysistest.begin(ctx) diff --git a/test/rules/android_local_test/java_launcher_test.bzl b/test/rules/android_local_test/java_launcher_test.bzl index b96680610..98c567dea 100644 --- a/test/rules/android_local_test/java_launcher_test.bzl +++ b/test/rules/android_local_test/java_launcher_test.bzl @@ -16,9 +16,9 @@ launcher_test: Asserts that the executable is contained in the target's runfiles. """ -load("//rules:visibility.bzl", "PROJECT_VISIBILITY") load("@bazel_skylib//lib:sets.bzl", "sets") load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts") +load("//rules:visibility.bzl", "PROJECT_VISIBILITY") visibility(PROJECT_VISIBILITY) diff --git a/test/rules/android_local_test/test.bzl b/test/rules/android_local_test/test.bzl index 18f4303c3..b7fa87f82 100644 --- a/test/rules/android_local_test/test.bzl +++ b/test/rules/android_local_test/test.bzl @@ -16,10 +16,10 @@ rule_test: Inspect and assert on rule providers. """ +load("@rules_java//java/common:java_info.bzl", "JavaInfo") load("//providers:providers.bzl", "AndroidFilteredJdepsInfo") load("//rules:visibility.bzl", "PROJECT_VISIBILITY") load("//test/utils:asserts.bzl", "asserts") -load("@rules_java//java/common:java_info.bzl", "JavaInfo") visibility(PROJECT_VISIBILITY) diff --git a/test/rules/resources/test.bzl b/test/rules/resources/test.bzl index 23f319e7e..ba93d90e1 100644 --- a/test/rules/resources/test.bzl +++ b/test/rules/resources/test.bzl @@ -13,6 +13,14 @@ # limitations under the License. """Test rule for resource processing.""" +load( + "@bazel_skylib//lib:unittest.bzl", + "analysistest", + "asserts", + "unittest", +) +load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo") +load("@rules_java//java/common:java_common.bzl", "java_common") load("//providers:providers.bzl", "StarlarkAndroidResourcesInfo") load("//rules:attrs.bzl", "ANDROID_BINARY_ATTRS") load("//rules:common.bzl", _common = "common") @@ -31,14 +39,6 @@ load( "//test/utils:asserts.bzl", _asserts = "asserts", ) -load("@rules_java//java/common:java_common.bzl", "java_common") -load( - "@bazel_skylib//lib:unittest.bzl", - "analysistest", - "asserts", - "unittest", -) -load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo") visibility(PROJECT_VISIBILITY) diff --git a/test/utils/BUILD b/test/utils/BUILD index d98d0f7f2..d8f5d8231 100644 --- a/test/utils/BUILD +++ b/test/utils/BUILD @@ -30,7 +30,7 @@ bzl_library( deps = [ "//providers:providers_bzl", "//rules:visibility_bzl", - "@rules_java//java:core_rules", "@bazel_skylib//lib:unittest", + "@rules_java//java:core_rules", ], ) diff --git a/test/utils/lib.bzl b/test/utils/lib.bzl index c22790a28..5e4fcf385 100644 --- a/test/utils/lib.bzl +++ b/test/utils/lib.bzl @@ -13,11 +13,11 @@ # limitations under the License. """Bazel Android testing libs.""" -load("//rules:visibility.bzl", "PROJECT_VISIBILITY") load( "@bazel_skylib//lib:unittest.bzl", _asserts = "asserts", ) +load("//rules:visibility.bzl", "PROJECT_VISIBILITY") load( ":file.bzl", _file = "file", diff --git a/test/utils/unittest.bzl b/test/utils/unittest.bzl index 1a3e3e744..a0b300ac7 100644 --- a/test/utils/unittest.bzl +++ b/test/utils/unittest.bzl @@ -13,13 +13,13 @@ # limitations under the License. """Bazel lib that provides test helpers for testing.""" -load("//rules:visibility.bzl", "PROJECT_VISIBILITY") -load("@rules_java//java:java_library.bzl", "java_library") load( "@bazel_skylib//lib:unittest.bzl", _analysistest = "analysistest", _unittest = "unittest", ) +load("@rules_java//java:java_library.bzl", "java_library") +load("//rules:visibility.bzl", "PROJECT_VISIBILITY") load(":file.bzl", _file = "file") visibility(PROJECT_VISIBILITY)