|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| .bazelci/ | H | 25-Apr-2025 | - | 49 | 45 |
| android/ | H | 25-Apr-2025 | - | 102 | 94 |
| examples/basicapp/ | H | 25-Apr-2025 | - | 198 | 149 |
| kokoro/presubmit/ | H | 25-Apr-2025 | - | 168 | 72 |
| mobile_install/ | H | 25-Apr-2025 | - | 2,674 | 2,362 |
| rules/ | H | 25-Apr-2025 | - | 18,862 | 16,724 |
| src/ | H | 25-Apr-2025 | - | 16,996 | 13,028 |
| test/ | H | 25-Apr-2025 | - | 4,929 | 3,607 |
| toolchains/ | H | 25-Apr-2025 | - | 518 | 468 |
| tools/ | H | 25-Apr-2025 | - | 197 | 153 |
| .bazelignore | H A D | 25-Apr-2025 | 9 | 2 | 1 |
| .bazelrc | H A D | 25-Apr-2025 | 92 | 3 | 2 |
| .gitignore | H A D | 25-Apr-2025 | 74 | 6 | 5 |
| AUTHORS | H A D | 25-Apr-2025 | 298 | 10 | 7 |
| BUILD | H A D | 25-Apr-2025 | 1.2 KiB | 56 | 47 |
| CONTRIBUTING.md | H A D | 25-Apr-2025 | 2 KiB | 40 | 34 |
| CONTRIBUTORS | H A D | 25-Apr-2025 | 643 | 17 | 16 |
| LICENSE | H A D | 25-Apr-2025 | 11.1 KiB | 203 | 169 |
| METADATA | H A D | 25-Apr-2025 | 471 | 19 | 17 |
| MODULE.bazel | H A D | 25-Apr-2025 | 2.7 KiB | 85 | 69 |
| MODULE_LICENSE_APACHE2 | HD | 25-Apr-2025 | 0 | | |
| README.md | H A D | 25-Apr-2025 | 2.1 KiB | 61 | 45 |
| ROADMAP.md | H A D | 25-Apr-2025 | 121 | 4 | 3 |
| WORKSPACE | H A D | 25-Apr-2025 | 902 | 34 | 22 |
| WORKSPACE.bzlmod | H A D | 25-Apr-2025 | 656 | 20 | 16 |
| android_sdk_supplemental_repository.bzl | H A D | 25-Apr-2025 | 2.1 KiB | 68 | 59 |
| defs.bzl | H A D | 25-Apr-2025 | 3.6 KiB | 100 | 83 |
| defs_dev.bzl | H A D | 25-Apr-2025 | 1.1 KiB | 32 | 26 |
| go.mod | H A D | 25-Apr-2025 | 219 | 11 | 8 |
| go.sum | H A D | 25-Apr-2025 | 1.1 KiB | 13 | 12 |
| groups | H A D | 25-Apr-2025 | 146 | 5 | 4 |
| prereqs.bzl | H A D | 25-Apr-2025 | 5.9 KiB | 154 | 137 |
| project.config | H A D | 25-Apr-2025 | 174 | 8 | 7 |
| rules_android_maven_install.json | H A D | 25-Apr-2025 | 223.6 KiB | 3,628 | 3,627 |
README.md
1# Android support in Bazel
2
3## Disclaimer
4
5NOTE: This branch is a development preview of the Starlark implementation of Android rules for Bazel. This code is incomplete and may not function as-is.
6
7A version of Bazel built at or near head or a recent pre-release and the following flags are necessary to use these rules:
8
9```
10--experimental_enable_android_migration_apis
11--experimental_google_legacy_api
12--incompatible_java_common_parameters
13--android_databinding_use_v3_4_args
14--experimental_android_databinding_v2
15```
16
17## Overview
18
19This repository contains the Starlark implementation of Android rules in Bazel.
20
21The rules are being incrementally converted from their native implementations
22in the [Bazel source
23tree](https://source.bazel.build/bazel/+/master:src/main/java/com/google/devtools/build/lib/rules/android/).
24
25For the list of Android rules, see the Bazel [documentation](https://docs.bazel.build/versions/master/be/android.html).
26
27## Getting Started
28To use the Starlark Bazel Android rules, add the following to your WORKSPACE file:
29
30 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
31
32 # Or a later commit
33 RULES_ANDROID_COMMIT= "0bf3093bd011acd35de3c479c8990dd630d552aa"
34 RULES_ANDROID_SHA = "b75a673a66c157138ab53f4d8612a6e655d38b69bb14207c1a6675f0e10afa61"
35 http_archive(
36 name = "rules_android",
37 url = "https://github.com/bazelbuild/rules_android/archive/%s.zip" % RULES_ANDROID_COMMIT,
38 sha256 = RULES_ANDROID_SHA,
39 strip_prefix = "rules_android-%s" % RULES_ANDROID_COMMIT,
40 )
41 load("@rules_android//:prereqs.bzl", "rules_android_prereqs")
42 rules_android_prereqs()
43 load("@rules_android//:defs.bzl", "rules_android_workspace")
44 rules_android_workspace()
45
46 register_toolchains(
47 "@rules_android//toolchains/android:android_default_toolchain",
48 "@rules_android//toolchains/android_sdk:android_sdk_tools",
49 )
50
51Then, in your BUILD files, import and use the rules:
52
53 load("@rules_android//rules:rules.bzl", "android_binary", "android_library")
54 android_binary(
55 ...
56 )
57
58 android_library(
59 ...
60 )
61