diff options
| -rwxr-xr-x | build-apk.sh | 8 | ||||
| -rwxr-xr-x | build.sh | 7 |
2 files changed, 9 insertions, 6 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. @@ -62,9 +62,10 @@ else export CSC_IDENTITY_AUTO_DISCOVERY=false fi -if [[ "$BUILD_MODE" == "dev" || $(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 $PRODUCT_VERSION^{commit}) +current_head_commit_hash=$(git rev-parse HEAD^{commit}) +if [[ "$BUILD_MODE" == "dev" || $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" echo "Disabling Apple notarization (macOs only) of installer in this dev build" |
