From 00a88ec3ec659b67c7564c5b27f774a0749684de Mon Sep 17 00:00:00 2001 From: Alex Buynytskyy Date: Fri, 5 May 2023 22:10:53 +0000 Subject: [PATCH] Script fixes and improvements. Fix to mark all versions REL. More robust patch application. Keep getting these build breakages, not sure why. Looks like git is confusing one folder for the other? https://android-build.googleplex.com/builds/submitted/10065142/test_suites_arm64/latest/logs/build_error.log Bug: 275409981 Test: run locally Change-Id: I6173b9ecae5e9ab12d9abf2eee3f2136dc353210 --- tools/finalization/environment.sh | 1 - tools/finalization/finalize-aidl-vndk-sdk-resources.sh | 6 ++++-- tools/finalization/finalize-sdk-rel.sh | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/finalization/environment.sh b/tools/finalization/environment.sh index b0ed645a46..9714ac415b 100755 --- a/tools/finalization/environment.sh +++ b/tools/finalization/environment.sh @@ -7,7 +7,6 @@ export FINAL_BUG_ID='0' # CI only export FINAL_PLATFORM_CODENAME='VanillaIceCream' export CURRENT_PLATFORM_CODENAME='VanillaIceCream' export FINAL_PLATFORM_CODENAME_JAVA='VANILLA_ICE_CREAM' -export FINAL_BUILD_PREFIX='VP1A' export FINAL_PLATFORM_VERSION='15' # Set arbitrary large values for CI. diff --git a/tools/finalization/finalize-aidl-vndk-sdk-resources.sh b/tools/finalization/finalize-aidl-vndk-sdk-resources.sh index d977a6538d..fa33986f2c 100755 --- a/tools/finalization/finalize-aidl-vndk-sdk-resources.sh +++ b/tools/finalization/finalize-aidl-vndk-sdk-resources.sh @@ -4,13 +4,15 @@ set -ex function apply_droidstubs_hack() { if ! grep -q 'STOPSHIP: RESTORE THIS LOGIC WHEN DECLARING "REL" BUILD' "$top/build/soong/java/droidstubs.go" ; then - git -C "$top/build/soong" apply --allow-empty ../../build/make/tools/finalization/build_soong_java_droidstubs.go.apply_hack.diff + local build_soong_git_root="$(readlink -f $top/build/soong)" + git -C "$build_soong_git_root" apply --allow-empty ../../build/make/tools/finalization/build_soong_java_droidstubs.go.apply_hack.diff fi } function apply_resources_sdk_int_fix() { if ! grep -q 'public static final int RESOURCES_SDK_INT = SDK_INT;' "$top/frameworks/base/core/java/android/os/Build.java" ; then - git -C "$top/frameworks/base" apply --allow-empty ../../build/make/tools/finalization/frameworks_base.apply_resource_sdk_int.diff + local base_git_root="$(readlink -f $top/frameworks/base)" + git -C "$base_git_root" apply --allow-empty ../../build/make/tools/finalization/frameworks_base.apply_resource_sdk_int.diff fi } diff --git a/tools/finalization/finalize-sdk-rel.sh b/tools/finalization/finalize-sdk-rel.sh index 84ad2a70da..62e5ee5ccd 100755 --- a/tools/finalization/finalize-sdk-rel.sh +++ b/tools/finalization/finalize-sdk-rel.sh @@ -34,7 +34,8 @@ function finalize_sdk_rel() { revert_resources_sdk_int_fix # build/make/core/version_defaults.mk - sed -i -e "s/PLATFORM_VERSION_CODENAME.${FINAL_BUILD_PREFIX} := .*/PLATFORM_VERSION_CODENAME.${FINAL_BUILD_PREFIX} := REL/g" "$top/build/make/core/version_defaults.mk" + # Mark all versions "released". + sed -i 's/\(PLATFORM_VERSION_CODENAME\.[^[:space:]]*\) := [^[:space:]]*/\1 := REL/g' "$top/build/make/core/version_defaults.mk" # cts echo "$FINAL_PLATFORM_VERSION" > "$top/cts/tests/tests/os/assets/platform_versions.txt"