Skip to content

Commit

Permalink
Use r25b as default for now
Browse files Browse the repository at this point in the history
  • Loading branch information
gferon committed Sep 19, 2023
1 parent b3a7e47 commit 2729e3c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
9 changes: 3 additions & 6 deletions rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _android_ndk_repository_impl(ctx):

if ndk_platform == "linux":
clang_directory = "toolchains/llvm/prebuilt/linux-x86_64"
elif ndk_platform == "darwin:
elif ndk_platform == "darwin":
# Note: darwin-x86_64 does indeed contain fat binaries with arm64 slices, too.
clang_directory = "toolchains/llvm/prebuilt/darwin-x86_64"
elif ndk_platform == "windows":
Expand All @@ -65,8 +65,6 @@ def _android_ndk_repository_impl(ctx):

sysroot_directory = "%s/sysroot" % clang_directory

api_level = ctx.attr.api_level or 31

result = ctx.execute([clang_directory + "/bin/clang", "--print-resource-dir"])
if result.return_code != 0:
fail("Failed to execute clang: %s" % result.stderr)
Expand Down Expand Up @@ -116,9 +114,8 @@ def _android_ndk_repository_impl(ctx):

_android_ndk_repository = repository_rule(
attrs = {
"path": attr.string(),
"api_level": attr.int(),
"version": attr.string(default = "r25c"),
"api_level": attr.int(default = 31),
"version": attr.string(default = "r25b"),
"base_url": attr.string(default = "https://dl.google.com/android/repository"),
"sha256s": attr.string_dict(),
},
Expand Down
4 changes: 4 additions & 0 deletions sha256sums.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ _NDK_PACKAGE_SHA256SUMS = {
"android-ndk-r25c-windows.zip": "f70093964f6cbbe19268f9876a20f92d3a593db3ad2037baadd25fd8d71e84e2",
"android-ndk-r25c-darwin.zip": "b01bae969a5d0bfa0da18469f650a1628dc388672f30e0ba231da5c74245bc92",
"android-ndk-r25c-linux.zip": "769ee342ea75f80619d985c2da990c48b3d8eaf45f48783a2d48870d04b46108",
# r25b
"android-ndk-r25b-windows.zip": "c9a72beda4663ab714c9fb3dc06bb9b9f124f2b5199957c86cd6f57eb59fd49a",
"android-ndk-r25b-darwin.zip": "7e12f1f809878d4f5d5a901809277aa31546d36c10730fade2036d7d95b3607a",
"android-ndk-r25b-linux.zip": "403ac3e3020dd0db63a848dcaba6ceb2603bf64de90949d5c4361f848e44b005",
}

def ndk_sha256(filename, repository_ctx):
Expand Down
14 changes: 14 additions & 0 deletions utils/checksums.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Download a specific release of the NDK for all three platforms and calculate SHA256 checksums
# to add to the sha256sums.bzl file.
set -eu

ndk_version=$1

cd "$(mktemp -d)"
echo "Working in $PWD"

curl -LO "https://dl.google.com/android/repository/android-ndk-${ndk_version}-windows.zip"
curl -LO "https://dl.google.com/android/repository/android-ndk-${ndk_version}-darwin.zip"
curl -LO "https://dl.google.com/android/repository/android-ndk-${ndk_version}-linux.zip"
sha256sum ./*

0 comments on commit 2729e3c

Please sign in to comment.