NuvioTV/scripts/perf_baseline.sh
2026-02-17 22:13:27 +05:30

37 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<USAGE
Usage: $0 <generate-profile|benchmark|release-with-profile>
Commands:
generate-profile Generate app baseline profile on connected device
benchmark Run startup + navigation macrobenchmarks on connected device
release-with-profile Build release APK/AAB with merged baseline profile artifacts
USAGE
}
cmd="${1:-}"
case "$cmd" in
generate-profile)
./gradlew \
:benchmark:connectedNonMinifiedReleaseAndroidTest \
:benchmark:collectNonMinifiedReleaseBaselineProfile \
-Pandroid.testInstrumentationRunnerArguments.class=com.nuvio.tv.benchmark.NuvioBaselineProfile
;;
benchmark)
./gradlew \
:benchmark:connectedBenchmarkReleaseAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class=com.nuvio.tv.benchmark.NuvioStartupNavBenchmark \
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.suppressErrors=EMULATOR
;;
release-with-profile)
./gradlew :app:assembleRelease :app:bundleRelease
;;
*)
usage
exit 1
;;
esac