• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

.bazelci/23-Nov-2023-2314

rules/23-Nov-2023-9,0568,012

test/rules/resources/23-Nov-2023-54

toolchains/23-Nov-2023-311266

tools/23-Nov-2023-11282

AUTHORSD23-Nov-2023298 107

CODEOWNERSD23-Nov-202356 21

CONTRIBUTING.mdD23-Nov-20232 KiB4034

CONTRIBUTORSD23-Nov-2023643 1716

LICENSED23-Nov-202311.1 KiB203169

METADATAD23-Nov-2023471 1917

MODULE_LICENSE_APACHE2D23-Nov-20230

README.mdD23-Nov-20231.8 KiB5239

ROADMAP.mdD23-Nov-20232.5 KiB7252

WORKSPACED23-Nov-2023104 42

README.md

1# Android support in Bazel
2
3## Disclaimer
4
5NOTE: This branch contains a development preview of the Starlark implementation of Android rules for Bazel. This code is incomplete and may not function as-is.
6
7Bazel 4.0.0 or newer and the following flags are necessary to use these rules:
8```
9--experimental_enable_android_migration_apis
10--experimental_google_legacy_api
11--incompatible_java_common_parameters
12--android_databinding_use_v3_4_args
13--experimental_android_databinding_v2
14```
15
16Also, register the Android toolchains in the `WORKSPACE` file with:
17```
18register_toolchains(
19  "@build_bazel_rules_android//toolchains/android:android_default_toolchain",
20  "@build_bazel_rules_android//toolchains/android_sdk:android_sdk_tools",
21)
22```
23(Assuming that the Android rules repository in the `WORKSPACE` file is named `build_bazel_rules_android`.)
24
25## Overview
26
27This repository contains the Starlark implementation of Android rules in Bazel.
28
29The rules are being incrementally converted from their native implementations
30in the [Bazel source
31tree](https://source.bazel.build/bazel/+/master:src/main/java/com/google/devtools/build/lib/rules/android/).
32
33For the list of Android rules, see the Bazel [documentation](https://docs.bazel.build/versions/master/be/android.html).
34
35## Getting Started
36To use the new Bazel Android rules, add the following to your WORKSPACE file:
37
38    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
39    http_archive(
40        name = "build_bazel_rules_android",
41        urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"],
42        sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
43        strip_prefix = "rules_android-0.1.1",
44    )
45
46Then, in your BUILD files, import and use the rules:
47
48    load("@build_bazel_rules_android//rules:rules.bzl", "android_library")
49    android_library(
50        ...
51    )
52