#!/usr/bin/env bash # Forces a fully fresh native build - works around stageEngine sometimes # wrongly reporting UP-TO-DATE after android/engine-patches/ or # android/gl4es-patches/ changes (see gradle_stage_engine_stale_cache memory # note). Run from anywhere. Needs JAVA_HOME set to a JDK 17+; defaults to # Android Studio's bundled JDK if found. set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$SCRIPT_DIR" if [ -z "${JAVA_HOME:-}" ]; then if [ -d /opt/android-studio/jbr ]; then export JAVA_HOME=/opt/android-studio/jbr else echo "JAVA_HOME not set and no JDK found at /opt/android-studio/jbr - export it yourself" >&2 exit 1 fi fi ./gradlew --stop rm -rf \ ../build/android-engine \ ../build/android-gl4es \ ../build/android-prebuilt \ app/.cxx \ app/build echo "Done - next Gradle build/Run will rebuild from scratch."