# The Android toolchain, for the detour scripts (build.sh, dev.sh). Sourced, # never run. A bash session started before the user variables were set does # not see them, so everything is spelled out here. SDK="$(cygpath -u "$LOCALAPPDATA")/Android/Sdk" NDKV=28.2.13676358 BIN="$SDK/ndk/$NDKV/toolchains/llvm/prebuilt/windows-x86_64/bin" export ANDROID_HOME="$(cygpath -w "$SDK")" export ANDROID_SDK_ROOT="$ANDROID_HOME" export NDK_HOME="$(cygpath -w "$SDK/ndk/$NDKV")" export ANDROID_NDK_HOME="$NDK_HOME" export ANDROID_NDK_ROOT="$NDK_HOME" export JAVA_HOME="C:\Program Files\Java\jdk-17" export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="$(cygpath -w "$BIN/aarch64-linux-android26-clang.cmd")" export CC_aarch64_linux_android="$(cygpath -w "$BIN/aarch64-linux-android26-clang.cmd")" export CXX_aarch64_linux_android="$(cygpath -w "$BIN/aarch64-linux-android26-clang++.cmd")" export AR_aarch64_linux_android="$(cygpath -w "$BIN/llvm-ar.exe")" export PATH="$SDK/platform-tools:$PATH" # tauri-build regenerates gen/android/tauri.settings.gradle and # app/tauri.build.gradle.kts — the lines that include every plugin's Android # module — ONLY when the CLI's variable names the project. Without it a new # plugin (the media session) compiled fine and never reached the APK. export TAURI_ANDROID_PROJECT_PATH="$(cygpath -w "$PWD/src-tauri/gen/android")" # Gradle's AF_UNIX pipes die anywhere under the user profile on the work # machine ("Unable to establish loopback connection" → "Invalid argument: # connect"), and every gradlew invocation in build.sh, dev.sh and the prober # went through it. Point its temp directory outside the profile when that # directory exists; a machine without it (home) is untouched. if [ -d /c/gradle-tmp ]; then export TMP='C:\gradle-tmp' export TEMP='C:\gradle-tmp' fi ADB="$SDK/platform-tools/adb.exe"