mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
feat(folio): select Android device via ANDROID_DEVICE in justfile
This commit is contained in:
1 parent
24be870896
commit
831f8bd603
1 file changed
+6
@@ -3,6 +3,7 @@ set dotenv-load := true
|
|||||||
|
|
||||||
sanderling := env_var_or_default("SANDERLING", "sanderling")
|
sanderling := env_var_or_default("SANDERLING", "sanderling")
|
||||||
avd := env_var_or_default("AVD", "")
|
avd := env_var_or_default("AVD", "")
|
||||||
|
android_device := env_var_or_default("ANDROID_DEVICE", "")
|
||||||
duration := env_var_or_default("DURATION", "1m")
|
duration := env_var_or_default("DURATION", "1m")
|
||||||
seed := env_var_or_default("SEED", "0")
|
seed := env_var_or_default("SEED", "0")
|
||||||
output := env_var_or_default("OUTPUT", justfile_directory() / "sanderling" / "runs")
|
output := env_var_or_default("OUTPUT", justfile_directory() / "sanderling" / "runs")
|
||||||
@@ -82,6 +83,8 @@ install: _ensure-device
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
export ANDROID_HOME="$(just _android-home)"
|
export ANDROID_HOME="$(just _android-home)"
|
||||||
|
# ANDROID_SERIAL routes the install to the chosen device when several attach.
|
||||||
|
[[ -n "{{android_device}}" ]] && export ANDROID_SERIAL="{{android_device}}"
|
||||||
./gradlew :app:androidApp:installDebug
|
./gradlew :app:androidApp:installDebug
|
||||||
|
|
||||||
# Remove the folio APK from the connected device.
|
# Remove the folio APK from the connected device.
|
||||||
@@ -153,6 +156,9 @@ test: install
|
|||||||
if [[ -n "{{avd}}" ]]; then
|
if [[ -n "{{avd}}" ]]; then
|
||||||
avd_flag=(--avd "{{avd}}")
|
avd_flag=(--avd "{{avd}}")
|
||||||
fi
|
fi
|
||||||
|
if [[ -n "{{android_device}}" ]]; then
|
||||||
|
avd_flag+=(--device "{{android_device}}")
|
||||||
|
fi
|
||||||
"{{sanderling}}" test \
|
"{{sanderling}}" test \
|
||||||
--spec "{{justfile_directory()}}/sanderling/spec.ts" \
|
--spec "{{justfile_directory()}}/sanderling/spec.ts" \
|
||||||
--bundle-id app.folio \
|
--bundle-id app.folio \
|
||||||
|
|||||||
Reference in new issue
Block a user