[tools] zig = "0.16.0" zls = "0.16.0" "github:j178/prek" = "0.4.1" # Android. Not installed by default on a machine that only builds the CLI and TUI: run # `mise install` in this directory to pull them when working on the app. # # `mise install` is necessary but not sufficient. It provides these four tools; the SDK # packages they need are downloaded by `sdkmanager` into the android-sdk install # directory, where mise does not track them - so they survive nothing and are reproduced # by the tasks below rather than by this table. No NDK: the native library is built by Zig # without one, and the JNI glue is hand-written (design 6.2, 6.4). See android/SETUP.md. java = "temurin-21" gradle = "8.14.5" android-sdk = "23.0" [tools."github:DonIsaac/zlint"] version = "0.9.0" # -- Android SDK packages -- # # The versioned ones are pinned; `platform-tools` and `emulator` have no version in their # package id and always resolve to current, which is the one thing here that is not # reproducible. Both tasks are idempotent: an already-installed package is a no-op. [tasks.android-sdk] description = "Install the SDK packages needed to build the app (~450MB)" run = 'sdkmanager "platform-tools" "platforms;android-35" "build-tools;35.0.0"' [tasks.android-emulator] description = "Install the emulator and a 16KB-page system image (~4.6GB)" run = 'sdkmanager "emulator" "system-images;android-35;google_apis_ps16k;x86_64"' [tasks.android-avd] description = "Create the tally35 AVD in .tmp/avd - recreating it wipes installed apps" run = ''' mkdir -p "$MISE_PROJECT_ROOT/.tmp/avd" ANDROID_AVD_HOME="$MISE_PROJECT_ROOT/.tmp/avd" avdmanager create avd \ --name tally35 --device pixel_6 --force \ --package "system-images;android-35;google_apis_ps16k;x86_64" ''' [tasks.android-install] description = "Build the native libs and APK, install on the attached device, launch it" # Rebuilds the libraries every time on purpose: Gradle never invokes Zig, so skipping # this step packages a stale libtally.so without complaint. run = ''' set -e zig build android (cd "$MISE_PROJECT_ROOT/android" && gradle --no-daemon assembleDebug) adb wait-for-device until [ "$(adb shell getprop sys.boot_completed | tr -d '\r')" = "1" ]; do sleep 2; done adb install -r "$MISE_PROJECT_ROOT/android/app/build/outputs/apk/debug/app-debug.apk" adb shell am start -n dev.lerch.tally/.MainActivity ''' [tasks.android-run] description = "Boot the tally35 AVD - does not install the app (add -- -no-window for headless)" run = 'ANDROID_AVD_HOME="$MISE_PROJECT_ROOT/.tmp/avd" emulator -avd tally35 -no-audio -no-boot-anim -gpu swiftshader_indirect'