2010-11-07 04:19:07 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-11-07 17:16:36 +01:00
|
|
|
set -e -u
|
|
|
|
|
|
|
|
usage () {
|
|
|
|
echo "usage: $(basename $0) [--tag tagname | --branch branchname]"
|
|
|
|
echo " # (uses current branch as default)"
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
TAG=""
|
|
|
|
BRANCH=""
|
|
|
|
|
|
|
|
while [ 0 -lt $# ] ; do
|
|
|
|
case $1 in
|
|
|
|
--tag)
|
|
|
|
TAG=$2
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--branch)
|
|
|
|
BRANCH=$2
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usage
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -n "$TAG" ]; then
|
|
|
|
if ! git tag | grep -w "$TAG"; then
|
|
|
|
echo "tag $TAG not found"
|
|
|
|
usage
|
|
|
|
fi
|
|
|
|
elif [ -z $BRANCH ]; then
|
|
|
|
BRANCH=$(git branch | grep '^*' | sed 's,^.* ,,')
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "building with ${TAG}${BRANCH}"
|
|
|
|
|
2010-11-07 04:19:07 +01:00
|
|
|
BUILDIR=/tmp/$(basename $0)_build_$$
|
2010-11-07 17:16:36 +01:00
|
|
|
SRCDIR=$(pwd)/$(dirname $0)/../../../
|
2010-11-07 04:19:07 +01:00
|
|
|
|
2010-11-07 17:16:36 +01:00
|
|
|
CURDIR=$(pwd)
|
2010-11-07 04:19:07 +01:00
|
|
|
|
|
|
|
mkdir -p $BUILDIR
|
|
|
|
cd $BUILDIR
|
|
|
|
git clone $SRCDIR BUILD
|
|
|
|
cd BUILD
|
2010-11-07 17:16:36 +01:00
|
|
|
git checkout ${TAG}${BRANCH}
|
|
|
|
./xwords4/android/scripts/arelease.sh
|
2010-11-07 04:19:07 +01:00
|
|
|
cp *.apk /tmp
|
|
|
|
|
|
|
|
cd $CURDIR
|
|
|
|
rm -rf $BUILDIR
|