From 97616c3ace41ae6d542faa24464004c153e3db0d Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 20 Feb 2025 15:03:06 +0100 Subject: [PATCH] Check for ANDROID_NDK definition in android-aar.sh Otherwise, the script can report success even though nothing compiles. --- dist-build/android-aar.sh | 7 +++++++ dist-build/android-build.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dist-build/android-aar.sh b/dist-build/android-aar.sh index 14cbe18e..a51602f5 100755 --- a/dist-build/android-aar.sh +++ b/dist-build/android-aar.sh @@ -5,6 +5,13 @@ # To simplify linking, library variants have distinct names: sodium, sodium-static, sodium-minimal and sodium-minimal-static. SODIUM_VERSION="1.0.21.0" + +if [ -z "$ANDROID_NDK_HOME" ]; then + echo "You should probably set ANDROID_NDK_HOME to the directory containing" + echo "the Android NDK." + exit 1 +fi + NDK_VERSION=$(grep "Pkg.Revision = " <"${ANDROID_NDK_HOME}/source.properties" | cut -f 2 -d '=' | cut -f 2 -d' ' | cut -f 1 -d'.') DEST_PATH=$(mktemp -d) diff --git a/dist-build/android-build.sh b/dist-build/android-build.sh index 53935210..04b1f210 100755 --- a/dist-build/android-build.sh +++ b/dist-build/android-build.sh @@ -11,7 +11,7 @@ export NDK_API_VERSION_COMPAT="$(echo "$NDK_PLATFORM_COMPAT" | sed 's/^android-/ if [ -z "$ANDROID_NDK_HOME" ]; then echo "You should probably set ANDROID_NDK_HOME to the directory containing" - echo "the Android NDK" + echo "the Android NDK." exit 1 fi