Skip to content

Working version with bzlmod, rules_kotlin v2, rules_android (with my PR fork)#204

Open
pswaminathan wants to merge 6 commits intograb:masterfrom
pswaminathan:ergatta/main
Open

Working version with bzlmod, rules_kotlin v2, rules_android (with my PR fork)#204
pswaminathan wants to merge 6 commits intograb:masterfrom
pswaminathan:ergatta/main

Conversation

@pswaminathan
Copy link
Contributor

@pswaminathan pswaminathan commented Feb 18, 2026

This doesn't apply cleanly, but I figured I would at least show my work. I may try rebasing on master, but here is generally what I have:

  • Bazel, rules_kotlin upgrades: use rules_java, rules_kotlin without the prefix, rules_android
  • rules_kotlin change broke reflection-based worker classes. I switched those to use KSP and it all worked
  • bazel_common_maven for maven deps

This works as a dependency. You may also need (what we have in our main repository's MODULE.bazel:

archive_override(
    module_name = "rules_android",
    integrity = "sha256-8DVLM3hPM5HVCsbOy9eJscmRew05iX7OR5ppsfuKiqo=",
    strip_prefix = "rules_android-ce4a1a12735f406c71b8c6c63481b22ca1b5cd6d",
    urls = ["https://github.com/pswaminathan/rules_android/archive/ce4a1a12735f406c71b8c6c63481b22ca1b5cd6d.zip"],
)

This rules_android commit includes the databinding PR work that exposes the correct targets to databinding_exec.jar (i.e. obsoletes #200). Additionally, we have:

http_archive(
    name = "patched_android_tools",
    sha256 = "94a6fd8d814977edf76083bf9fd2aef22b005fe0354dd3acb813beb54dcec664",
    url = "https://an-internal-cdn-url.com/android_tools.tar.xz",
)

remote_android_extensions = use_extension("@rules_android//bzlmod_extensions:android_extensions.bzl", "remote_android_tools_extensions")

override_repo(
    remote_android_extensions,
    android_tools = "patched_android_tools",
)

Basically we took the android_tools jar from here and put it on a CDN. Bazel's override_repo makes it very straightforward to use this version without having to further patch rules_android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant