diff --git a/xwords4/android/scripts/ci-build.sh b/xwords4/android/scripts/ci-build.sh new file mode 100755 index 000000000..2a24eeb93 --- /dev/null +++ b/xwords4/android/scripts/ci-build.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +set -e -u + +TMPDIR=/tmp/ci-build-$$ + +usage() { + [ -n "$1" ] && echo "ERROR: $1" + echo "**************************************" + echo "*** Nobody but me will use this!!! ***" + echo "**************************************" + echo "usage: $0 " + echo "does a clean build of committed HEAD and uploads to eehouse.org" + echo "same as TravisCI does when working" + exit 1 +} + +[ -z "${1+x}" ] || usage "takes no args" +[ -z "${XW4D_UPLOAD+x}" ] && usage "XW4D_UPLOAD not defined" + +REPO='' +while :; do + if [ -f .travis.yml ]; then + REPO=$(pwd) + break + fi + cd ../ +done + +mkdir -p $TMPDIR +cd $TMPDIR +git clone $REPO +for BUILD in $(find . -name build.gradle); do + DIR=$(basename $(dirname $BUILD)) + if [ "$DIR" == "android" ]; then + cd $(dirname $BUILD) + break + fi +done +pwd + +./gradlew asXw4dDeb +scp $(find . -name '*.apk') ${XW4D_UPLOAD}