diff --git a/android/KMAPro/build.sh b/android/KMAPro/build.sh index 14e8b36022..9d2fecb511 100755 --- a/android/KMAPro/build.sh +++ b/android/KMAPro/build.sh @@ -1,5 +1,40 @@ #!/bin/sh # Build KMAPro +display_usage ( ) { + echo "build.sh [-no-daemon]" + echo + echo "Build Keyman for Android" + echo " -no-daemon Don't start the Gradle daemon. Use for CI" + exit 1 +} + echo Build KMAPro -./gradlew clean build + +NO_DAEMON=false + +# Parse args +while [[ $# -gt 0 ]] ; do + key="$1" + case $key in + -no-daemon) + NO_DAEMON=true + ;; + -h|-?) + display_usage + ;; + esac + shift # past argument +done + +echo +echo "NO_DAEMON: $NO_DAEMON" +echo + +if [ "$NO_DAEMON" = true ]; then + DAEMON_FLAG=--no-daemon +else + DAEMON_FLAG= +fi + +./gradlew $DAEMON_FLAG clean build diff --git a/android/KMEA/build.sh b/android/KMEA/build.sh index 011a7e17f8..c55f6fc22d 100755 --- a/android/KMEA/build.sh +++ b/android/KMEA/build.sh @@ -7,11 +7,12 @@ # KMW - Keyman Web display_usage ( ) { - echo "build.sh [-no-kmw-build] | [-no-kmw]" + echo "build.sh [-no-kmw-build] | [-no-kmw] [-no-daemon]" echo echo "Build Keyman Engine Android (KMEA) using Keyman Web (KMW) artifacts" echo " -no-kmw-build Don't build KMW. Just copy existing artifacts" echo " -no-kmw Don't build KMW. Don't copy artifacts" + echo " -no-daemon Don't start the Gradle daemon. Use for CI" exit 1 } @@ -53,6 +54,7 @@ die ( ) { # Default is building KMW and copying artifacts DO_BUILD=true DO_COPY=true +NO_DAEMON=false # Parse args while [[ $# -gt 0 ]] ; do @@ -66,6 +68,9 @@ while [[ $# -gt 0 ]] ; do DO_BUILD=false DO_COPY=false ;; + -no-daemon) + NO_DAEMON=true + ;; -h|-?) display_usage ;; @@ -76,10 +81,16 @@ done echo echo "DO_BUILD: $DO_BUILD" echo "DO_COPY: $DO_COPY" +echo "NO_DAEMON: $NO_DAEMON" echo -# Destinations that will need the keymanweb artifacts +if [ "$NO_DAEMON" = true ]; then + DAEMON_FLAG=--no-daemon +else + DAEMON_FLAG= +fi +# Destinations that will need the keymanweb artifacts PLATFORM=`uname -s` @@ -111,8 +122,8 @@ fi echo "Gradle Build of KMEA" cd $KMA_ROOT/KMEA -./gradlew clean -./gradlew aR +./gradlew $DAEMON_FLAG clean +./gradlew $DAEMON_FLAG aR if [ $? -ne 0 ]; then die "ERROR: Build of KMEA failed" fi diff --git a/android/build.sh b/android/build.sh index aef2378848..45f8e508ff 100755 --- a/android/build.sh +++ b/android/build.sh @@ -17,7 +17,7 @@ if [ $? -ne 0 ]; then fi cd ../KMAPro -./build.sh +./build.sh $@ if [ $? -ne 0 ]; then die "ERROR: KMAPro/build.sh failed"