diff --git a/xwords4/android/XWords4/assets/.gitignore b/xwords4/android/XWords4/assets/.gitignore new file mode 100644 index 000000000..122521cd8 --- /dev/null +++ b/xwords4/android/XWords4/assets/.gitignore @@ -0,0 +1 @@ +/gitvers.txt diff --git a/xwords4/android/scripts/common_targets.xml b/xwords4/android/scripts/common_targets.xml index 53a102761..8c1158558 100644 --- a/xwords4/android/scripts/common_targets.xml +++ b/xwords4/android/scripts/common_targets.xml @@ -69,9 +69,14 @@ + + + + + diff --git a/xwords4/android/scripts/genvers.sh b/xwords4/android/scripts/genvers.sh index 6a7ab7cb5..161335ac8 100755 --- a/xwords4/android/scripts/genvers.sh +++ b/xwords4/android/scripts/genvers.sh @@ -3,24 +3,60 @@ set -e -u STRINGS_HASH="" +OUT_PATH="" +VARIANT="" +CLIENT_VERS_RELAY="" +CHAT_SUPPORTED="" +THUMBNAIL_SUPPORTED="" usage() { - echo "usage: $0 " + echo "usage: $0 --variant --client-vers \\" + echo " --chat-enabled --thumbnail-enabled \\" + echo " [--vers-outfile path/to/versout.txt]" exit 1 } -[ $# -eq 4 ] || usage +while [ $# -gt 0 ]; do + echo $1 + case $1 in + --variant) + VARIANT=$2 + shift + ;; + --client-vers) + CLIENT_VERS_RELAY=$2 + shift + ;; + --chat-enabled) + CHAT_SUPPORTED=$2 + shift + ;; + --thumbnail-enabled) + THUMBNAIL_SUPPORTED=$2 + shift + ;; + --vers-outfile) + OUT_PATH=$2 + shift + ;; + *) + usage + ;; + esac + shift +done -VARIANT=$1 -CLIENT_VERS_RELAY=$2 -CHAT_SUPPORTED=$3 -THUMBNAIL_SUPPORTED=$4 +[ -n "$VARIANT" -a -n "$CLIENT_VERS_RELAY" -a -n "$CHAT_SUPPORTED" -a -n "$THUMBNAIL_SUPPORTED" ] || usage BUILD_DIR=$(basename $(pwd)) cd $(dirname $0) cd ../ GITVERSION=$(../scripts/gitversion.sh) +if [ -n "$OUT_PATH" ]; then + echo $GITVERSION > $BUILD_DIR/$OUT_PATH + git describe >> $BUILD_DIR/$OUT_PATH +fi case $VARIANT in xw4)