Alex Buynytskyy | afddc07 | 2023-02-09 22:40:53 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -ex |
| 4 | |
Alex Buynytskyy | bdcef7b | 2023-02-19 18:40:44 +0000 | [diff] [blame] | 5 | function revert_droidstubs_hack() { |
Alex Buynytskyy | 775ad5f | 2023-02-21 19:28:48 +0000 | [diff] [blame] | 6 | if grep -q 'STOPSHIP: RESTORE THIS LOGIC WHEN DECLARING "REL" BUILD' "$top/build/soong/java/droidstubs.go" ; then |
Alex Buynytskyy | bce1a51 | 2023-06-16 20:06:38 +0000 | [diff] [blame] | 7 | patch --strip=1 --no-backup-if-mismatch --directory="$top/build/soong" --input=../../build/make/tools/finalization/build_soong_java_droidstubs.go.revert_hack.diff |
Alex Buynytskyy | bdcef7b | 2023-02-19 18:40:44 +0000 | [diff] [blame] | 8 | fi |
| 9 | } |
| 10 | |
| 11 | function apply_prerelease_sdk_hack() { |
Alex Buynytskyy | 775ad5f | 2023-02-21 19:28:48 +0000 | [diff] [blame] | 12 | if ! grep -q 'STOPSHIP: hack for the pre-release SDK' "$top/frameworks/base/core/java/android/content/pm/parsing/FrameworkParsingPackageUtils.java" ; then |
Alex Buynytskyy | bce1a51 | 2023-06-16 20:06:38 +0000 | [diff] [blame] | 13 | patch --strip=1 --no-backup-if-mismatch --directory="$top/frameworks/base" --input=../../build/make/tools/finalization/frameworks_base.apply_hack.diff |
Alex Buynytskyy | bdcef7b | 2023-02-19 18:40:44 +0000 | [diff] [blame] | 14 | fi |
| 15 | } |
| 16 | |
Alex Buynytskyy | afddc07 | 2023-02-09 22:40:53 +0000 | [diff] [blame] | 17 | function finalize_sdk_rel() { |
| 18 | local top="$(dirname "$0")"/../../../.. |
| 19 | source $top/build/make/tools/finalization/environment.sh |
| 20 | |
Alex Buynytskyy | bdcef7b | 2023-02-19 18:40:44 +0000 | [diff] [blame] | 21 | # revert droidstubs hack now we are switching to REL |
| 22 | revert_droidstubs_hack |
| 23 | |
| 24 | # let the apps built with pre-release SDK parse |
| 25 | apply_prerelease_sdk_hack |
| 26 | |
Alex Buynytskyy | afddc07 | 2023-02-09 22:40:53 +0000 | [diff] [blame] | 27 | # cts |
Alex Buynytskyy | 5b34f3f | 2024-03-15 00:29:59 +0000 | [diff] [blame] | 28 | if ! grep -q "${FINAL_PLATFORM_VERSION}" "$top/cts/tests/tests/os/assets/platform_versions.txt" ; then |
| 29 | echo ${FINAL_PLATFORM_VERSION} >> "$top/cts/tests/tests/os/assets/platform_versions.txt" |
| 30 | fi |
Alex Buynytskyy | bdcef7b | 2023-02-19 18:40:44 +0000 | [diff] [blame] | 31 | if [ "$FINAL_PLATFORM_CODENAME" != "$CURRENT_PLATFORM_CODENAME" ]; then |
| 32 | echo "$CURRENT_PLATFORM_CODENAME" >> "./cts/tests/tests/os/assets/platform_versions.txt" |
| 33 | fi |
Alex Buynytskyy | 0fa58fa | 2023-02-13 20:22:10 +0000 | [diff] [blame] | 34 | git -C "$top/cts" mv hostsidetests/theme/assets/${FINAL_PLATFORM_CODENAME} hostsidetests/theme/assets/${FINAL_PLATFORM_SDK_VERSION} |
Alex Buynytskyy | afddc07 | 2023-02-09 22:40:53 +0000 | [diff] [blame] | 35 | |
Hsin-Yi Chen | b18cd88 | 2024-04-16 17:08:45 +0800 | [diff] [blame] | 36 | # prebuilts/abi-dumps/platform |
Hsin-Yi Chen | a2440a3 | 2024-05-15 15:49:34 +0800 | [diff] [blame^] | 37 | "$top/build/soong/soong_ui.bash" --make-mode TARGET_RELEASE=next TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug create_reference_dumps |
| 38 | ANDROID_BUILD_TOP="$top" "$top/out/host/linux-x86/bin/create_reference_dumps" -release next --build-variant userdebug --lib-variant APEX |
Alex Buynytskyy | afddc07 | 2023-02-09 22:40:53 +0000 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | finalize_sdk_rel |
| 42 | |