From 3f85357598e81bb351163f5937d32928ff347ce8 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 27 Jun 2025 16:16:20 +0100 Subject: [PATCH] Ensure official builds still detect compatible android apks properly --- util/buildscripts/build.sh | 4 +++- util/buildscripts/scripts/compile_win32.sh | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/util/buildscripts/build.sh b/util/buildscripts/build.sh index 698f7feba..9669e48b2 100755 --- a/util/buildscripts/build.sh +++ b/util/buildscripts/build.sh @@ -295,6 +295,8 @@ echo "Platform: $PLATFORM"; echo "Build root: $BUILD_ROOT"; echo "Repository root: $REPO_ROOT"; +export GITHASH=$(cd "${REPO_ROOT}" && git rev-parse HEAD) + if [[ "$TYPE" == "official" ]]; then sed -i.bak "s%RENDERDOC_OFFICIAL_BUILD 0%RENDERDOC_OFFICIAL_BUILD 1%" "${REPO_ROOT}"/renderdoc/api/replay/version.h @@ -304,7 +306,7 @@ if [[ "$TYPE" == "official" ]]; then else # snapshot - export GITTAG=$(cd "${REPO_ROOT}" && git rev-parse HEAD) + export GITTAG=$GITHASH fi; diff --git a/util/buildscripts/scripts/compile_win32.sh b/util/buildscripts/scripts/compile_win32.sh index 5444d3496..75eb6d020 100755 --- a/util/buildscripts/scripts/compile_win32.sh +++ b/util/buildscripts/scripts/compile_win32.sh @@ -116,12 +116,14 @@ AAPT=$(ls $ANDROID_SDK/build-tools/*/aapt{,.exe} 2>/dev/null | tail -n 1) VERSION32=$($AAPT dump badging build-android-arm32/bin/*apk 2>/dev/null | grep -Eo "versionName='[0-9a-f]*'" | grep -Eo "'.*'" | tr -d "'") VERSION64=$($AAPT dump badging build-android-arm64/bin/*apk 2>/dev/null | grep -Eo "versionName='[0-9a-f]*'" | grep -Eo "'.*'" | tr -d "'") -if [ "$VERSION32" == "$GITTAG" ]; then +if [ "$VERSION32" == "$GITHASH" ]; then - echo "Found existing compatible arm32 build at $GITTAG, not rebuilding"; + echo "Found existing compatible arm32 build at $GITHASH, not rebuilding"; else + echo "Rebuilding as existing build is $VERSION32"; + # Build the arm32 variant rm -rf build-android-arm32 mkdir -p build-android-arm32 @@ -143,12 +145,14 @@ else fi -if [ "$VERSION64" == "$GITTAG" ]; then +if [ "$VERSION64" == "$GITHASH" ]; then - echo "Found existing compatible arm64 build at $GITTAG, not rebuilding"; + echo "Found existing compatible arm64 build at $GITHASH, not rebuilding"; else + echo "Rebuilding as existing build is $VERSION64"; + rm -rf build-android-arm64 mkdir -p build-android-arm64 pushd build-android-arm64