1
1
# FIXME(alexeagle): move to bzlmod
2
2
load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
3
3
4
- # Requires ANDROID_HOME set to the path of your Android SDK.
5
- android_sdk_repository (name = "androidsdk" )
6
-
7
- android_ndk_repository (name = "androidndk" )
8
-
9
4
RULES_JVM_EXTERNAL_TAG = "5.3"
10
5
11
6
RULES_JVM_EXTERNAL_SHA = "d31e369b854322ca5098ea12c69d7175ded971435e55c18dd9dd5f29cc5249ac"
@@ -27,7 +22,6 @@ maven_install(
27
22
"com.android.support.constraint:constraint-layout:1.0.2" ,
28
23
"com.google.code.gson:gson:2.8.2" ,
29
24
],
30
- fetch_sources = True ,
31
25
# See https://github.com/bazelbuild/rules_jvm_external/#repository-aliases
32
26
# This can be removed if none of your external dependencies uses `maven_jar`.
33
27
generate_compat_repositories = True ,
@@ -37,6 +31,8 @@ maven_install(
37
31
"https://repo1.maven.org/maven2" ,
38
32
],
39
33
version_conflict_policy = "pinned" ,
34
+ use_starlark_android_rules = True ,
35
+ aar_import_bzl_label = "@rules_android//rules:rules.bzl" ,
40
36
)
41
37
42
38
load ("@maven//:compat.bzl" , "compat_repositories" )
@@ -55,16 +51,27 @@ http_archive(
55
51
url = "https://github.com/bazelbuild/tools_android/archive/%s.tar.gz" % TOOLS_ANDROID_COMMIT ,
56
52
)
57
53
54
+ RULES_ANDROID_COMMIT = "93e27030d3f0defa39cbbc35195638cb772b0c27"
55
+
58
56
http_archive (
59
57
name = "rules_android" ,
60
- sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806 " ,
61
- strip_prefix = "rules_android-0.1.1" ,
62
- urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1. zip" ],
58
+ sha256 = "71cae2413868a24f17d43fd595af6f3905d2e5b3235f76514f54800bfd90c903 " ,
59
+ strip_prefix = "rules_android-" + RULES_ANDROID_COMMIT ,
60
+ urls = ["https://github.com/bazelbuild/rules_android/archive/%s. zip" % RULES_ANDROID_COMMIT ],
63
61
)
64
62
65
- http_archive (
66
- name = "rules_cc" ,
67
- sha256 = "5f862a44bbd032e1b48ed53c9c211ba2a1da60e10c5baa01c97369c249299ecb" ,
68
- strip_prefix = "rules_cc-c8c38f8c710cbbf834283e4777916b68261b359c" ,
69
- url = "https://github.com/bazelbuild/rules_cc/archive/c8c38f8c710cbbf834283e4777916b68261b359c.zip" ,
63
+ load ("@rules_android//:prereqs.bzl" , "rules_android_prereqs" )
64
+ rules_android_prereqs ()
65
+ load ("@rules_android//:defs.bzl" , "rules_android_workspace" )
66
+ rules_android_workspace ()
67
+
68
+ load ("@rules_android//rules:rules.bzl" , "android_sdk_repository" )
69
+ # Requires that the ANDROID_HOME environment variable is set to the Android SDK path.
70
+ android_sdk_repository (
71
+ name = "androidsdk" ,
72
+ )
73
+
74
+ register_toolchains (
75
+ "@rules_android//toolchains/android:android_default_toolchain" ,
76
+ "@rules_android//toolchains/android_sdk:android_sdk_tools" ,
70
77
)
0 commit comments