mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-23 07:27:22 +01:00
f5ebee89da
Merging of AndroidManifest.xml files meant the dbg flavor was getting its C2D_MESSAGE permission and the main flavor's, which on recent OS versions meant it couldn't be installed. Use substitution from gradle to fix.
74 lines
1.4 KiB
Bash
Executable file
74 lines
1.4 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e -u
|
|
|
|
usage () {
|
|
echo "usage: $(basename $0) [--tag tagname | --branch branchname] "
|
|
echo " # (uses current branch as default)"
|
|
exit 1
|
|
}
|
|
|
|
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}"
|
|
|
|
BUILDIR=/tmp/$(basename $0)_build_$$
|
|
OUT_FILE=$BUILDIR/apks.txt
|
|
SRCDIR=$(pwd)/$(dirname $0)/../../../
|
|
|
|
CURDIR=$(pwd)
|
|
|
|
mkdir -p $BUILDIR
|
|
cd $BUILDIR
|
|
git clone $SRCDIR BUILD
|
|
cd BUILD
|
|
git checkout ${TAG}${BRANCH}
|
|
cd ./xwords4/android/
|
|
./scripts/arelease.sh --apk-list $OUT_FILE
|
|
mkdir -p /tmp/releases_${VARIANT}
|
|
cp *.apk /tmp/releases_${VARIANT}
|
|
|
|
if [ -n "$XW_RELEASE_SCP_DEST" ]; then
|
|
cat $OUT_FILE | while read APK; do
|
|
echo "running: scp /tmp/releases_${VARIANT}/$APK $XW_RELEASE_SCP_DEST ..."
|
|
scp /tmp/releases_${VARIANT}/$APK $XW_RELEASE_SCP_DEST
|
|
done
|
|
fi
|
|
|
|
cd $CURDIR
|
|
echo "remove build dir $BUILDIR? (y or n):"
|
|
echo -n "(y or n) ==> "
|
|
read ANSWER
|
|
if [ "$ANSWER" = 'y' ]; then
|
|
rm -rf $BUILDIR
|
|
echo "removed $BUILDIR"
|
|
else
|
|
echo "$BUILDIR not removed"
|
|
fi
|