rules_robolectric 4.17-beta-2Latest published <1h ago
MODULE.bazel
bazel_dep(name = "rules_robolectric", version = "4.17-beta-2")
README

robolectric-bazel

This project provides build rules for integrating Robolectric into Bazel projects.

Releases


Installation

Follow instructions in the release notes from the release you use: https://github.com/robolectric/robolectric-bazel/releases

Usage

In your android_local_test targets in the BUILD files, depend on the Robolectric targets @maven//:org_robolectric_robolectric and @robolectric//bazel:android-all:

android_local_test(
    name = "greeter_activity_test",
    srcs = ["GreeterTest.java"],
    manifest = "TestManifest.xml",
    test_class = "com.example.bazel.GreeterTest",
    deps = [
        ":greeter_activity",
        "@maven//:org_robolectric_robolectric",
        "@robolectric//bazel:android-all",
    ],
)

Updating Android Versions

update-versions.py walks org.robolectric:android-all-instrumented on Maven Central and rewrites bazel/robolectric.bzl in place: it bumps the version and sha256 of any Android API group that has a newer release, and inserts new entries for any numeric API newer than the highest one currently listed.

./update-versions.py            # apply updates
./update-versions.py --dry-run  # preview without writing

Publishing Releases

A new release can be published by just pushing a tag.

Once the tag is pushed, GitHub Actions will build, test, and publish a release to both GitHub releases and the BCR.

Example:

git tag 4.11.1
git push origin 4.11.1

About

Bazel support for Robolectric (https://github.com/robolectric/robolectric)

@robolectric/robolectric-bazel@robolectric
Homepage
16stars
7:16 AM (6 minutes ago)
@publish-to-bcr-bot#9782 rules_robolectric@4.17-beta-2...

Languages

Python60.7%
Starlark39.3%

Maintainers

@Bencodes

Compatibility

Versions

4.17-beta-2 +15h2026-07-23
4.17-beta-1 +6.0mo2026-07-22
4.16.1 +4.5mo2026-01-23
4.16 +2.5mo2025-09-08
4.15.1 +9h2025-06-24
4.15 +<1h2025-06-23
4.15-beta-1 +6.6mo2025-06-23
4.14.1.2 +8d79% 112024-12-06
4.14.1 +4.7mo7% 12024-11-27
4.13 +1h2024-07-09
4.12.2 +3.2mo2024-07-09
4.12.1 +3d2024-04-04
4.12 +5.0mo2024-04-01
4.11.1 +22h14% 22023-11-02
4.11 +5.3mo2023-11-02
4.10.3 +13d2023-05-25
4.10.2 +9d2023-05-12
4.10.1 +14d2023-05-03
4.102023-04-18