mattermost-mobile-upstream/detox/scripts/run_android_gradle_build.sh
yasser khan 6672333238
ci(e2e): port E2E CI stack to release-2.42 to unblock merges (#10005)
* ci(e2e): port E2E CI stack to release-2.42 to unblock merges

Combined backport of the main E2E CI surface through #9975 (Maestro,
CMT multi-platform, TSIO reporting, five-server Matterwick inputs, and
E2E/Override waive) so release-2.42 PRs can satisfy required e2e-test/*
checks via E2E/Run or E2E/Override.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci(test): exclude detox/ from root Jest (from #9925)

Root Jest was collecting detox/utils node:test suites brought in by the
E2E CI port, which fail with "must contain at least one test". Match main
by ignoring /detox/ in the app unit-test run.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 16:50:48 +05:30

34 lines
985 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
detox_dir="$(cd "${script_dir}/.." && pwd)"
android_dir="$(cd "${detox_dir}/../android" && pwd)"
build_type="${1:-debug}"
case "$build_type" in
debug)
assemble_task="assembleDebug"
;;
release)
assemble_task="assembleRelease"
;;
*)
echo "Unsupported build type: $build_type" >&2
exit 1
;;
esac
gradle_args=()
if [[ "${CI:-false}" != "true" ]]; then
gradle_args+=("-Dorg.gradle.parallel=false")
gradle_args+=("-Dorg.gradle.workers.max=${MM_GRADLE_WORKERS_MAX:-2}")
gradle_args+=("-Dorg.gradle.jvmargs=-Xmx${MM_GRADLE_XMX_MB:-3072}m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8")
fi
cd "${android_dir}"
# Build app APK and its test APK (but not test APKs for library dependencies like expo-image)
./gradlew "${gradle_args[@]}" "${assemble_task}" "app:assembleAndroidTest" "-DtestBuildType=${build_type}"