forked from bazelbuild/rules_android_ndk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sha256sums.bzl
34 lines (30 loc) · 1.68 KB
/
sha256sums.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
SHA256 checksums for downloaded NDK archives
"""
_NDK_PACKAGE_SHA256SUMS = {
# r26b
"android-ndk-r26b-windows.zip": "a478d43d4a45d0d345cda6be50d79642b92fb175868d9dc0dfc86181d80f691e",
"android-ndk-r26b-darwin.zip": "4b0ea6148a9a2337e62a0c0c7ac59ff1edc38d69b81d9c58251897d23f7fa321",
"android-ndk-r26b-linux.zip": "ad73c0370f0b0a87d1671ed2fd5a9ac9acfd1eb5c43a7fbfbd330f85d19dd632",
# r26
"android-ndk-r26-windows.zip": "a748c6634b96991e15cb8902ffa4a498bba2ec6aa8028526de3c4c9dfcf00663",
"android-ndk-r26-darwin.zip": "b2ab2fd17f71e2d2994c8c0ba2e48e99377806e05bf7477093344c26ab71dec0",
"android-ndk-r26-linux.zip": "1505c2297a5b7a04ed20b5d44da5665e91bac2b7c0fbcd3ae99b6ccc3a61289a",
# r25c
"android-ndk-r25c-windows.zip": "f70093964f6cbbe19268f9876a20f92d3a593db3ad2037baadd25fd8d71e84e2",
"android-ndk-r25c-darwin.zip": "b01bae969a5d0bfa0da18469f650a1628dc388672f30e0ba231da5c74245bc92",
"android-ndk-r25c-linux.zip": "769ee342ea75f80619d985c2da990c48b3d8eaf45f48783a2d48870d04b46108",
}
def ndk_sha256(filename, repository_ctx):
"""Get the sha256 for a specific NDK release
Args:
filename: the name of the NDK release file (as seen on https://developer.android.com/ndk/downloads)
repository_ctx: the repository_rule ctx
Returns:
a sha256sum string to use with ctx.download_and_extract
"""
internal_sha256 = _NDK_PACKAGE_SHA256SUMS.get(filename)
external_sha256 = repository_ctx.attr.sha256s.get(filename)
if internal_sha256 == None and external_sha256 == None:
fail("This NDK version is unsupported, and you haven't supplied a custom sha256sum for", filename)
return _NDK_PACKAGE_SHA256SUMS.get(filename)