first commit

This commit is contained in:
Elijah Kuntz 2026-10-17 22:38:45 -07:00
commit f5f1c0928f
39 changed files with 4478 additions and 0 deletions

30
scripts/bootstrap.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")/.."
if [ "$(uname -s)" != Darwin ]; then
echo 'This bootstrap script targets macOS. On other platforms install JDK 17 and Android SDK 34, then set JAVA_HOME and ANDROID_HOME.' >&2
exit 1
fi
mkdir -p .tools/sdk/cmdline-tools .tools/jdk
if [ ! -x .tools/jdk/Contents/Home/bin/java ]; then
ARCH=aarch64
if [ "$(uname -m)" = x86_64 ]; then ARCH=x64; fi
curl -L --fail "https://api.adoptium.net/v3/binary/latest/17/ga/mac/$ARCH/jdk/hotspot/normal/eclipse" -o .tools/jdk.tar.gz
tar -xzf .tools/jdk.tar.gz -C .tools/jdk --strip-components=1
rm .tools/jdk.tar.gz
fi
if [ ! -x .tools/platform-tools/adb ]; then
curl -L --fail https://dl.google.com/android/repository/platform-tools-latest-darwin.zip -o .tools/platform-tools.zip
unzip -q .tools/platform-tools.zip -d .tools
rm .tools/platform-tools.zip
fi
if [ ! -x .tools/sdk/cmdline-tools/latest/bin/sdkmanager ]; then
curl -L --fail https://dl.google.com/android/repository/commandlinetools-mac-11076708_latest.zip -o .tools/cmdline-tools.zip
unzip -q .tools/cmdline-tools.zip -d .tools/sdk/cmdline-tools
mv .tools/sdk/cmdline-tools/cmdline-tools .tools/sdk/cmdline-tools/latest
rm .tools/cmdline-tools.zip
fi
export JAVA_HOME="$PWD/.tools/jdk/Contents/Home"
.tools/sdk/cmdline-tools/latest/bin/sdkmanager --sdk_root="$PWD/.tools/sdk" --licenses
.tools/sdk/cmdline-tools/latest/bin/sdkmanager --sdk_root="$PWD/.tools/sdk" 'platforms;android-34' 'build-tools;34.0.0'
echo 'Toolchain ready. Run scripts/build.sh.'