# Tether API build tasks # Docker image for Android builds android_image := "cimg/android:2025.12" gradle_cache := env_var_or_default("GRADLE_CACHE", justfile_directory() + "/.gradle-cache") # Default task default: @just --list # Build debug APK build: docker run --rm \ -v {{justfile_directory()}}:/project \ -v {{gradle_cache}}:/gradle-cache \ -e GRADLE_USER_HOME=/gradle-cache \ -w /project \ {{android_image}} \ sh -c './gradlew assembleDebug --no-daemon && chown -R $(stat -c %u:%g /project) /project/.gradle /project/.kotlin /project/app/build 2>/dev/null || true' @echo "APK: app/build/outputs/apk/debug/app-debug.apk" # Build release APK (requires keystore and env vars) release: docker run --rm \ -v {{justfile_directory()}}:/project \ -v {{gradle_cache}}:/gradle-cache \ -e GRADLE_USER_HOME=/gradle-cache \ -e KEYSTORE_PASSWORD \ -e KEY_ALIAS \ -e KEY_PASSWORD \ -w /project \ {{android_image}} \ sh -c './gradlew assembleRelease --no-daemon && chown -R $(stat -c %u:%g /project) /project/.gradle /project/.kotlin /project/app/build 2>/dev/null || true' @echo "APK: app/build/outputs/apk/release/app-release.apk" # Clean build artifacts clean: rm -rf app/build build .gradle .kotlin @echo "Cleaned" # Run gradle tasks gradle *ARGS: docker run --rm \ -v {{justfile_directory()}}:/project \ -v {{gradle_cache}}:/gradle-cache \ -e GRADLE_USER_HOME=/gradle-cache \ -w /project \ {{android_image}} \ sh -c './gradlew {{ARGS}} --no-daemon && chown -R $(stat -c %u:%g /project) /project/.gradle /project/.kotlin /project/app/build 2>/dev/null || true' # Generate icons from SVG icons: inkscape assets/icon.svg -w 512 -h 512 -o assets/icon-512.png inkscape assets/icon.svg -w 192 -h 192 -o app/src/main/res/mipmap-xxxhdpi/ic_launcher.png inkscape assets/icon.svg -w 144 -h 144 -o app/src/main/res/mipmap-xxhdpi/ic_launcher.png inkscape assets/icon.svg -w 96 -h 96 -o app/src/main/res/mipmap-xhdpi/ic_launcher.png inkscape assets/icon.svg -w 72 -h 72 -o app/src/main/res/mipmap-hdpi/ic_launcher.png inkscape assets/icon.svg -w 48 -h 48 -o app/src/main/res/mipmap-mdpi/ic_launcher.png cp app/src/main/res/mipmap-xxxhdpi/ic_launcher.png app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png cp app/src/main/res/mipmap-xxhdpi/ic_launcher.png app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png cp app/src/main/res/mipmap-xhdpi/ic_launcher.png app/src/main/res/mipmap-xhdpi/ic_launcher_round.png cp app/src/main/res/mipmap-hdpi/ic_launcher.png app/src/main/res/mipmap-hdpi/ic_launcher_round.png cp app/src/main/res/mipmap-mdpi/ic_launcher.png app/src/main/res/mipmap-mdpi/ic_launcher_round.png inkscape assets/feature-graphic.svg -w 1024 -h 500 -o assets/feature-graphic.png @echo "Generated all icons" # Install APK on connected device install: build adb install -r app/build/outputs/apk/debug/app-debug.apk # Generate keystore for release signing keystore: keytool -genkey -v -keystore keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias release @echo "Created keystore.jks - keep this safe!"