summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2020-09-08 11:10:47 +0200
committerLinus Färnstrand <linus@mullvad.net>2020-09-08 11:10:47 +0200
commit099f3fc29779d8ad1cfba8433d5336ae6261b457 (patch)
tree770032a3a8ec65b9a6d63f27beda5d4511068bc3
parentd014340bd959a8659bd8f4143d722f9e696edc55 (diff)
downloadmullvadvpn-099f3fc29779d8ad1cfba8433d5336ae6261b457.tar.xz
mullvadvpn-099f3fc29779d8ad1cfba8433d5336ae6261b457.zip
Update build-apk.sh to handle release tags better
-rwxr-xr-xbuild-apk.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/build-apk.sh b/build-apk.sh
index 9d0e7b2ccf..5cb63d6c13 100755
--- a/build-apk.sh
+++ b/build-apk.sh
@@ -47,9 +47,10 @@ if [[ "$GRADLE_BUILD_TYPE" == "release" ]]; then
fi
fi
-if [[ "$BUILD_TYPE" == "debug" || "$(git describe)" != "$PRODUCT_VERSION" ]]; then
- GIT_COMMIT="$(git rev-parse HEAD | head -c 6)"
- PRODUCT_VERSION="${PRODUCT_VERSION}-dev-${GIT_COMMIT}"
+product_version_commit_hash=$(git rev-parse android/$PRODUCT_VERSION^{commit})
+current_head_commit_hash=$(git rev-parse HEAD^{commit})
+if [[ "$BUILD_TYPE" == "debug" || $product_version_commit_hash != $current_head_commit_hash ]]; then
+ PRODUCT_VERSION="${PRODUCT_VERSION}-dev-${current_head_commit_hash:0:6}"
echo "Modifying product version to $PRODUCT_VERSION"
else
echo "Removing old Rust build artifacts"
@@ -57,6 +58,7 @@ else
CARGO_ARGS+=" --locked"
fi
+echo "Building Mullvad VPN $PRODUCT_VERSION for Android"
pushd "$SCRIPT_DIR/android"
# Fallback to the system-wide gradle command if the gradlew script is removed.