mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-21 17:05:39 +03:00
increment_version.sh: No sc version change required for upstream merges
Change-Id: I55e414902a232426e0af48911183f7f267cc3419
This commit is contained in:
parent
eecbdde2fb
commit
6844c71987
1 changed files with 13 additions and 2 deletions
|
@ -33,6 +33,10 @@ set_prop() {
|
|||
sed -i "$not_equals""s|\($prop $equals\).*|\1$value|g" "$build_gradle"
|
||||
}
|
||||
|
||||
calculate_version_code() {
|
||||
echo "(($versionMajor * 10000 + $versionMinor * 100 + $versionPatch + $scVersion) + 4000000) * 10" | bc
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Increase version
|
||||
|
@ -43,10 +47,17 @@ versionMinor=`get_prop ext.versionMinor`
|
|||
versionPatch=`get_prop ext.versionPatch`
|
||||
scVersion=`get_prop ext.scVersion`
|
||||
|
||||
((scVersion++))
|
||||
previousVersionCode=`grep '^ versionCode ' "$build_gradle" | sed 's|^ versionCode ||'`
|
||||
versionCode=`calculate_version_code`
|
||||
if [ "$versionCode" = "$previousVersionCode" ]; then
|
||||
((scVersion++))
|
||||
echo "Increase downstream version to $scVersion"
|
||||
versionCode=`calculate_version_code`
|
||||
else
|
||||
echo "Upstream version upgrade, no need to change downstream version"
|
||||
fi
|
||||
|
||||
version="$versionMajor.$versionMinor.$versionPatch.sc.$scVersion"
|
||||
versionCode=`echo "(($versionMajor * 10000 + $versionMinor * 100 + $versionPatch + $scVersion) + 4000000) * 10" | bc`
|
||||
new_tag="sc_v$version"
|
||||
|
||||
set_prop "ext.scVersion" "$scVersion"
|
||||
|
|
Loading…
Reference in a new issue