# Sourced by the scripts beside it: the pinned versions, and the JDK and Android SDK they use. # # The versions this package is built and tested with (README, *Build and test*): WAI_SINK_GRADLE_VERSION=8.13 WAI_SINK_GRADLE_SHA256=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78 WAI_SINK_NDK_VERSION=${WAI_SINK_NDK_VERSION:-29.0.14206865} WAI_SINK_MIN_API=${WAI_SINK_MIN_API:-24} WAI_SINK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" WAI_RS_DIR="$WAI_SINK_DIR/../wai-rs" die() { echo "wai-sink-android: $*" >&2; exit 1; } sha256_of() { if command -v sha256sum >/dev/null 2>&1; then sha256sum "$1" | cut -d' ' -f1; else shasum -a 256 "$1" | cut -d' ' -f1; fi } # A JDK 17: JAVA_HOME if set, else the host's packaged one. if [ -z "${JAVA_HOME:-}" ]; then for j in /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home /usr/lib/jvm/java-17-openjdk-* /usr/lib/jvm/temurin-17-*; do if [ -x "$j/bin/javac" ]; then JAVA_HOME="$j"; break; fi done fi if [ -z "${JAVA_HOME:-}" ] && command -v javac >/dev/null 2>&1; then JAVA_HOME="$(cd "$(dirname "$(readlink -f "$(command -v javac)")")/.." && pwd)" fi export JAVA_HOME # The Android SDK, where one is installed (the AAR and the emulator tests need it; the JVM tests # do not). if [ -z "${ANDROID_HOME:-}" ]; then for s in "${ANDROID_SDK_ROOT:-}" "$HOME/Library/Android/sdk" "$HOME/Android/Sdk"; do if [ -n "$s" ] && [ -d "$s/platforms" ]; then ANDROID_HOME="$s"; break; fi done fi if [ -n "${ANDROID_HOME:-}" ]; then export ANDROID_HOME; fi