diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index c0046507..fd2cf91e 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -2,7 +2,7 @@ bcr_test_module: module_path: examples/basicapp matrix: platform: ["ubuntu2004", "macos", "windows"] - bazel: ["7.2.1", "7.4.0", "8.x", "rolling"] + bazel: ["7.4.1", "8.0.0", "rolling"] tasks: run_test_module: name: "Verify build targets with bzlmod" diff --git a/MODULE.bazel b/MODULE.bazel index 43208ba0..6c8cb95b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -17,14 +17,7 @@ use_repo(rules_java_toolchains, "remote_java_tools") bazel_dep(name = "protobuf", version = "29.0", 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 = "rules_robolectric", version = "4.14.1", repo_name = "robolectric") - -# To include PR #123 -git_override( - module_name = "rules_robolectric", - commit = "f38b7365361f382ecdad255af69b37413dd48ead", - remote = "https://github.com/robolectric/robolectric-bazel", -) +bazel_dep(name = "rules_robolectric", version = "4.14.1.2", repo_name = "robolectric") register_toolchains("//toolchains/android:all") diff --git a/README.md b/README.md index e0b6e3a4..072389b3 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,37 @@ To use the Starlark Bazel Android rules, add the following to your WORKSPACE fil load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_android", - sha256 = "fc6b022e97c2d5893aa3dd01b480f37cd386d82fc7e14edbcba393cd390a244e", - strip_prefix = "rules_android-0.6.0", - url = "https://github.com/bazelbuild/rules_android/releases/download/v0.6.0/rules_android-v0.6.0.tar.gz", + sha256 = "fe3d8c4955857b44019d83d05a0b15c2a0330a6a0aab990575bb397e9570ff1b", + strip_prefix = "rules_android-0.6.0-alpha1", + url = "https://github.com/bazelbuild/rules_android/releases/download/v0.6.0-alpha1/rules_android-v0.6.0-alpha1.tar.gz", ) + +# Android rules dependencies load("@rules_android//:prereqs.bzl", "rules_android_prereqs") rules_android_prereqs() + +##### rules_java setup for rules_android ##### +load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies") +rules_java_dependencies() +# note that the following line is what is minimally required from protobuf for the java rules +# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl +load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features") # buildifier: disable=bzl-visibility +proto_bazel_features(name = "proto_bazel_features") +# register toolchains +load("@rules_java//java:repositories.bzl", "rules_java_toolchains") +rules_java_toolchains() + +##### rules_jvm_external setup for rules_android ##### +load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") +rules_jvm_external_deps() +load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") +rules_jvm_external_setup() + +##### rules_android setup ##### load("@rules_android//:defs.bzl", "rules_android_workspace") rules_android_workspace() +# Android SDK setup load("@rules_android//rules:rules.bzl", "android_sdk_repository") android_sdk_repository( name = "androidsdk", @@ -75,4 +97,4 @@ android_binary( android_library( ... ) -``` \ No newline at end of file +```