xref: /aosp_15_r20/external/bazelbuild-rules_rust/examples/android/WORKSPACE.bazel (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1*d4726bddSHONG Yifanworkspace(name = "android_examples")
2*d4726bddSHONG Yifan
3*d4726bddSHONG Yifan# Users of `rules_rust` will commonly be unable to load it
4*d4726bddSHONG Yifan# using a `local_repository`. Instead, to setup the rules,
5*d4726bddSHONG Yifan# please see https://bazelbuild.github.io/rules_rust/#setup
6*d4726bddSHONG Yifanlocal_repository(
7*d4726bddSHONG Yifan    name = "rules_rust",
8*d4726bddSHONG Yifan    path = "../..",
9*d4726bddSHONG Yifan)
10*d4726bddSHONG Yifan
11*d4726bddSHONG Yifanload("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
12*d4726bddSHONG Yifan
13*d4726bddSHONG Yifanrules_rust_dependencies()
14*d4726bddSHONG Yifan
15*d4726bddSHONG Yifanrust_register_toolchains(
16*d4726bddSHONG Yifan    edition = "2018",
17*d4726bddSHONG Yifan    extra_target_triples = [
18*d4726bddSHONG Yifan        "aarch64-linux-android",
19*d4726bddSHONG Yifan    ],
20*d4726bddSHONG Yifan)
21*d4726bddSHONG Yifan
22*d4726bddSHONG Yifanload("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
23*d4726bddSHONG Yifan
24*d4726bddSHONG Yifanhttp_archive(
25*d4726bddSHONG Yifan    name = "build_bazel_rules_android",
26*d4726bddSHONG Yifan    sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
27*d4726bddSHONG Yifan    strip_prefix = "rules_android-0.1.1",
28*d4726bddSHONG Yifan    urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"],
29*d4726bddSHONG Yifan)
30*d4726bddSHONG Yifan
31*d4726bddSHONG Yifanhttp_archive(
32*d4726bddSHONG Yifan    name = "bazelci_rules",
33*d4726bddSHONG Yifan    sha256 = "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e",
34*d4726bddSHONG Yifan    strip_prefix = "bazelci_rules-1.0.0",
35*d4726bddSHONG Yifan    url = "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz",
36*d4726bddSHONG Yifan)
37*d4726bddSHONG Yifan
38*d4726bddSHONG Yifanload("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig")
39*d4726bddSHONG Yifan
40*d4726bddSHONG Yifan# Creates a default toolchain config for RBE.
41*d4726bddSHONG Yifan# Use this as is if you are using the rbe_ubuntu16_04 container,
42*d4726bddSHONG Yifan# otherwise refer to RBE docs.
43*d4726bddSHONG Yifanrbe_preconfig(
44*d4726bddSHONG Yifan    name = "buildkite_config",
45*d4726bddSHONG Yifan    toolchain = "ubuntu1804-bazel-java11",
46*d4726bddSHONG Yifan)
47*d4726bddSHONG Yifan
48*d4726bddSHONG Yifanandroid_sdk_repository(
49*d4726bddSHONG Yifan    name = "androidsdk",
50*d4726bddSHONG Yifan)
51*d4726bddSHONG Yifan
52*d4726bddSHONG Yifanhttp_archive(
53*d4726bddSHONG Yifan    name = "rules_android_ndk",
54*d4726bddSHONG Yifan    sha256 = "b1a5ddd784e6ed915c2035c0db536a278b5f50c64412128c06877115991391ef",
55*d4726bddSHONG Yifan    strip_prefix = "rules_android_ndk-877c68ef34c9f3353028bf490d269230c1990483",
56*d4726bddSHONG Yifan    url = "https://github.com/bazelbuild/rules_android_ndk/archive/877c68ef34c9f3353028bf490d269230c1990483.zip",
57*d4726bddSHONG Yifan)
58*d4726bddSHONG Yifan
59*d4726bddSHONG Yifanload("@rules_android_ndk//:rules.bzl", "android_ndk_repository")
60*d4726bddSHONG Yifan
61*d4726bddSHONG Yifanandroid_ndk_repository(
62*d4726bddSHONG Yifan    name = "androidndk",
63*d4726bddSHONG Yifan)
64