From 2b653dcf9b8514808d209b1af2e34543cfefaec9 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 2 Feb 2014 11:27:09 -0800 Subject: [PATCH] add build script --- xwords4/android/scripts/find-and-ant.sh | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 xwords4/android/scripts/find-and-ant.sh diff --git a/xwords4/android/scripts/find-and-ant.sh b/xwords4/android/scripts/find-and-ant.sh new file mode 100755 index 000000000..d8a84b44f --- /dev/null +++ b/xwords4/android/scripts/find-and-ant.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +set -e -u + +MANIFEST=AndroidManifest.xml + +usage() { + [ $# -ge 1 ] && echo "ERROR: $1" + echo "usage: $0 " + echo " default commands: $CMDS" + exit 1 +} + +CMDS="clean debug install" +if [ $# -gt 0 ]; then + case $1 in + --help|-h|-help|-?) + usage + ;; + *) + CMDS="$*" + break; + ;; + esac + shift +fi + +while [ ! -e $MANIFEST ]; do + [ '/' = $(pwd) ] && usage "reached root without finding $MANIFEST" + cd .. +done + +ant $CMDS