diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2020-09-08 13:56:16 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2020-09-08 13:56:16 +0200 |
| commit | f1a0ac4d6c583e7c8be0780759c96b803ef964cd (patch) | |
| tree | 770032a3a8ec65b9a6d63f27beda5d4511068bc3 | |
| parent | 3cb972f14692491278903785e1988a5695f77ff0 (diff) | |
| parent | 099f3fc29779d8ad1cfba8433d5336ae6261b457 (diff) | |
| download | mullvadvpn-f1a0ac4d6c583e7c8be0780759c96b803ef964cd.tar.xz mullvadvpn-f1a0ac4d6c583e7c8be0780759c96b803ef964cd.zip | |
Merge branch 'fix-build.sh-for-android-tags'
| -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" |
