From 4a483986f0ae4f1a7b06a0f92c9bb6e93c6a1602 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Thu, 5 Nov 2020 15:46:48 +0100 Subject: [PATCH] increment_version.sh: Add preview mode Change-Id: Icc7169e4abdc289ed60884b3ed6aec74c37d19d1 --- increment_version.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/increment_version.sh b/increment_version.sh index 563fb19886..1acaeae6bb 100755 --- a/increment_version.sh +++ b/increment_version.sh @@ -6,7 +6,14 @@ mydir="$(dirname "$(realpath "$0")")" source "$mydir/merge_helpers.sh" -require_clean_git +if [ "$1" = "preview" ]; then + preview=1 + shift +else + preview=0 + require_clean_git +fi + if [ "$1" = "test" ]; then release_type="test" @@ -70,8 +77,19 @@ else fi version="$versionMajor.$versionMinor.$versionPatch.sc.$scVersion" + +if [ "$release_type" = "test" ]; then + version="$version-test" +fi + new_tag="sc_v$version" +if ((preview)); then + echo "versionCode $versionCode" + echo "versionName $version" + exit 0 +fi + set_prop "ext.scVersion" "$scVersion" set_prop "versionCode" "$versionCode" set_prop "versionName" "\"$version\""