mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
build(examples): add justfile for sample-app
Targets: install/uninstall the APK, build the uatu CLI, run 'uatu test' against a named AVD, run the Go verify tests, and clean. Keeps the example self-contained so users can 'just test AVD=pixel_7' after cloning.
This commit is contained in:
1 parent
ec3764ad85
commit
a74d9fbeae
1 file changed
+48
@@ -0,0 +1,48 @@
|
||||
set shell := ["bash", "-cu"]
|
||||
|
||||
repo_root := absolute_path(justfile_directory() / ".." / "..")
|
||||
uatu := env_var_or_default("UATU", repo_root / "bin/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", repo_root / "runs")
|
||||
|
||||
default:
|
||||
@just --list
|
||||
|
||||
# Build and install the sample APK on a running emulator/device.
|
||||
install:
|
||||
cd {{repo_root}} && ./gradlew :sample-app:installDebug
|
||||
|
||||
# Remove the sample APK from the connected device.
|
||||
uninstall:
|
||||
cd {{repo_root}} && ./gradlew :sample-app:uninstallDebug
|
||||
|
||||
# Build the uatu CLI (writes to repo's bin/uatu).
|
||||
uatu:
|
||||
make -C {{repo_root}} uatu
|
||||
|
||||
# Run the Go tests that bundle and exercise spec.ts (no device required).
|
||||
verify:
|
||||
cd {{repo_root}} && go test ./internal/verifier/ -run TestSampleAppSpec
|
||||
|
||||
# Run 'uatu test' against the sample app. AVD=<name> is required.
|
||||
test:
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
if [[ -z "{{avd}}" ]]; then
|
||||
echo "AVD is required (usage: just AVD=<name> test)" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -x "{{uatu}}" ]]; then just uatu; fi
|
||||
"{{uatu}}" test \
|
||||
--spec "{{justfile_directory()}}/spec.ts" \
|
||||
--bundle-id dev.uatu.sample \
|
||||
--avd "{{avd}}" \
|
||||
--duration "{{duration}}" \
|
||||
--seed "{{seed}}" \
|
||||
--output "{{output}}"
|
||||
|
||||
# Remove the gradle build directory for the sample app.
|
||||
clean:
|
||||
cd {{repo_root}} && ./gradlew :sample-app:clean
|
||||
Reference in new issue
Block a user