|
| 1 | +local_repository( |
| 2 | + name = "rules_android", |
| 3 | + path = "../..", # rules_android's WORKSPACE relative to this inner workspace |
| 4 | +) |
| 5 | + |
| 6 | +# --SNIP--: Everything below this line goes into the example WORKSPACE snippet in the release notes. |
| 7 | + |
| 8 | +# Android rules dependencies |
| 9 | +load("@rules_android//:prereqs.bzl", "rules_android_prereqs") |
| 10 | +rules_android_prereqs() |
| 11 | + |
| 12 | +##### rules_java setup for rules_android ##### |
| 13 | +load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies") |
| 14 | +rules_java_dependencies() |
| 15 | +# note that the following line is what is minimally required from protobuf for the java rules |
| 16 | +# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl |
| 17 | +load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features") # buildifier: disable=bzl-visibility |
| 18 | +proto_bazel_features(name = "proto_bazel_features") |
| 19 | +# register toolchains |
| 20 | +load("@rules_java//java:repositories.bzl", "rules_java_toolchains") |
| 21 | +rules_java_toolchains() |
| 22 | + |
| 23 | +##### rules_jvm_external setup for rules_android ##### |
| 24 | +load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") |
| 25 | +rules_jvm_external_deps() |
| 26 | +load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") |
| 27 | +rules_jvm_external_setup() |
| 28 | + |
| 29 | +load("@rules_jvm_external//:defs.bzl", "maven_install") |
| 30 | + |
| 31 | +maven_install( |
| 32 | + name = "maven", |
| 33 | + artifacts = [ |
| 34 | + "androidx.annotation:annotation-jvm:1.9.1", |
| 35 | + "androidx.databinding:databinding-runtime:8.7.0", |
| 36 | + "com.google.protobuf:protobuf-java:4.27.2", |
| 37 | + "com.google.protobuf:protobuf-java-util:4.27.2", |
| 38 | + ], |
| 39 | + repositories = [ |
| 40 | + "https://maven.google.com", |
| 41 | + "https://repo1.maven.org/maven2", |
| 42 | + "https://repo.gradle.org/gradle/libs-releases", |
| 43 | + ], |
| 44 | +) |
| 45 | + |
| 46 | +##### rules_android setup ##### |
| 47 | +load("@rules_android//:defs.bzl", "rules_android_workspace") |
| 48 | +rules_android_workspace() |
| 49 | + |
| 50 | +# Android SDK setup |
| 51 | +load("@rules_android//rules:rules.bzl", "android_sdk_repository") |
| 52 | +android_sdk_repository( |
| 53 | + name = "androidsdk", |
| 54 | +) |
| 55 | + |
| 56 | +register_toolchains( |
| 57 | + "@rules_android//toolchains/android:android_default_toolchain", |
| 58 | + "@rules_android//toolchains/android_sdk:android_sdk_tools", |
| 59 | +) |
0 commit comments