Files
sanderling/examples/sample-app/justfile
T
pj 5b5594ee05 Port sample-app to KMP with Android, iOS, Web, and SQLite (#16)
* chore(sample-app): hoist gradle wrapper to sample-app root

* chore(sample-app): add KMP root gradle config

* chore(sample-app): add composeApp KMP module build config

* chore(sample-app): add Android manifest for composeApp

* feat(sample-app): add shared domain models and auth constants

* feat(sample-app): add shared number and date formatting

* feat(sample-app): add cross-platform storage, clock, and id

* feat(sample-app): add shared repository with file-backed state

* feat(sample-app): add shared in-memory navigator

* feat(sample-app): add Compose theme and design tokens

* feat(sample-app): add shared UI components (icons, screen, widgets)

* feat(sample-app): add Login and Home pages

* feat(sample-app): add AddAccount, Ledger, AddTransaction pages

* feat(sample-app): add App root composable with routing

* feat(sample-app): add Android Application and Activity hosting Compose UI

* chore(sample-app): remove legacy android module (replaced by composeApp)

* chore(sample-app): bump to latest stable Kotlin/AGP/Compose deps

* fix(sample-app): make iOS compile (drop @Volatile, set bundleId)

* feat(sample-app): add xcodegen spec, SwiftUI host, and iOS Info.plist

* chore(sample-app): ignore build artifacts and generated xcodeproj

* chore(sample-app): update justfile for composeApp layout, add ios target

* docs(sample-app): rewrite README for KMP + iOS flow

* refactor(sample-app): drop in-app status bar and formatClock

* feat(sample-app): add SQLDelight schema and per-platform drivers

* refactor(sample-app): back Repository with SQLite, drop file serializer

* feat(sample-app): wire native back on Android and iOS edge swipe

* feat(sample-app): semantic roles, labels, and a11y descriptions

* fix(sample-app): link libsqlite3 for iOS target

SQLDelight's native driver needs libsqlite3.tbd on iOS; without it the
linker fails with undefined _sqlite3_bind_blob and friends.

* refactor(sample-app): abstract storage behind LedgerStore interface

Platform-specific createLedgerStore() returns a SqlLedgerStore backed
by SQLDelight on Android + iOS. Opens the door for a pure in-memory
web implementation that does not require a SQLite driver.

* feat(sample-app): add wasmJs target with in-memory LedgerStore

Wires a Compose Multiplatform browser canvas entry point. The web
implementation of LedgerStore is an in-memory model with localStorage
persistence, so it does not need a SQLite driver. Back navigation maps
the browser back button to the same BackHandler contract Android and
iOS use.

* chore(sample-app): settings + gitignore for wasmJs dev run

Registers the Node.js distributions repository and switches
repositoriesMode to PREFER_PROJECT so the Kotlin wasmJs plugin can
download its toolchain. Adds kotlin-js-store (lockfile) and ignores
runs/, web screenshots, playwright-mcp scratch output.

* fix(sample-app): singularize transaction count on Home

Shows "1 transaction" not "1 transactions" for accounts with a single
transaction; falls back to "$count transactions" otherwise.
2026-04-19 15:56:33 +07:00

100 lines
3.0 KiB
Makefile

set shell := ["bash", "-cu"]
set dotenv-load := true
uatu := env_var_or_default("UATU", "uatu")
avd := env_var_or_default("AVD", "")
duration := env_var_or_default("DURATION", "1m")
seed := env_var_or_default("SEED", "0")
output := env_var_or_default("OUTPUT", justfile_directory() / "runs")
ios_device := env_var_or_default("IOS_DEVICE", "iPhone 17 Pro")
default:
@just --list
# Resolve ANDROID_HOME from the env or a short list of canonical install
# locations, so Gradle can find the Android SDK without the user having to
# export anything.
_android-home:
#!/usr/bin/env bash
set -euo pipefail
if [[ -n "${ANDROID_HOME:-}" && -d "$ANDROID_HOME" ]]; then
echo "$ANDROID_HOME"; exit 0
fi
if [[ -n "${ANDROID_SDK_ROOT:-}" && -d "$ANDROID_SDK_ROOT" ]]; then
echo "$ANDROID_SDK_ROOT"; exit 0
fi
for candidate in \
"$HOME/Library/Android/sdk" \
"$HOME/Android/Sdk" \
"/opt/homebrew/share/android-commandlinetools" \
"/usr/local/share/android-commandlinetools"; do
if [[ -d "$candidate" ]]; then
echo "$candidate"; exit 0
fi
done
echo "could not locate Android SDK (set ANDROID_HOME)" >&2
exit 1
# Build and install the sample APK on a running emulator/device.
install:
#!/usr/bin/env bash
set -euo pipefail
export ANDROID_HOME="$(just _android-home)"
./gradlew :composeApp:installDebug
# Remove the sample APK from the connected device.
uninstall:
#!/usr/bin/env bash
set -euo pipefail
export ANDROID_HOME="$(just _android-home)"
./gradlew :composeApp:uninstallDebug
# Remove gradle + iOS build directories.
clean:
#!/usr/bin/env bash
set -euo pipefail
export ANDROID_HOME="$(just _android-home)"
./gradlew clean
rm -rf iosApp/build
# Regenerate iosApp.xcodeproj from project.yml.
ios-gen:
#!/usr/bin/env bash
set -euo pipefail
cd iosApp && xcodegen generate
# Build + install + launch on a booted iOS simulator (boots IOS_DEVICE if none).
ios:
#!/usr/bin/env bash
set -euo pipefail
export ANDROID_HOME="$(just _android-home)"
if ! xcrun simctl list devices booted | grep -q Booted; then
xcrun simctl boot "{{ios_device}}"
open -a Simulator
sleep 3
fi
just ios-gen
xcodebuild -project iosApp/iosApp.xcodeproj -scheme iosApp \
-destination 'platform=iOS Simulator,name={{ios_device}}' \
-derivedDataPath iosApp/build \
build | tail -5
xcrun simctl install booted iosApp/build/Build/Products/Debug-iphonesimulator/iosApp.app
xcrun simctl launch booted dev.uatu.sample
# Run 'uatu test' against the sample app. Uses a connected device if one is
# online, otherwise boots AVD=<name> if provided.
test:
#!/usr/bin/env bash
set -euo pipefail
avd_flag=()
if [[ -n "{{avd}}" ]]; then
avd_flag=(--avd "{{avd}}")
fi
"{{uatu}}" test \
--spec "{{justfile_directory()}}/spec.ts" \
--bundle-id dev.uatu.sample \
"${avd_flag[@]}" \
--duration "{{duration}}" \
--seed "{{seed}}" \
--output "{{output}}"