blob: 8403ae6b0fe06c44ce5e0c057c1c6f1bdff6d425 [file] [log] [blame]
Alex Buynytskyy3bd1b912022-09-22 11:30:53 -07001#!/bin/bash
2
3set -ex
4
5function finalize_aidl_vndk_sdk_resources() {
Alex Buynytskyy13c82672022-12-07 18:54:51 +00006 local PLATFORM_CODENAME_JAVA='UPSIDE_DOWN_CAKE'
7 local PLATFORM_SDK_VERSION='34'
8
Alex Buynytskyy3bd1b912022-09-22 11:30:53 -07009 local top="$(dirname "$0")"/../..
10
11 # default target to modify tree and build SDK
12 local m="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"
13
14 # This script is WIP and only finalizes part of the Android branch for release.
15 # The full process can be found at (INTERNAL) go/android-sdk-finalization.
16
Alex Buynytskyy3bd1b912022-09-22 11:30:53 -070017 # Update references in the codebase to new API version (TODO)
18 # ...
19
Alex Buynytskyy13c82672022-12-07 18:54:51 +000020 # VNDK definitions for new SDK version
21 cp "$top/development/vndk/tools/definition-tool/datasets/vndk-lib-extra-list-current.txt" \
22 "$top/development/vndk/tools/definition-tool/datasets/vndk-lib-extra-list-$PLATFORM_SDK_VERSION.txt"
23
Alex Buynytskyy3bd1b912022-09-22 11:30:53 -070024 AIDL_TRANSITIVE_FREEZE=true $m aidl-freeze-api create_reference_dumps
25
26 # Generate ABI dumps
27 ANDROID_BUILD_TOP="$top" \
28 out/host/linux-x86/bin/create_reference_dumps \
29 -p aosp_arm64 --build-variant user
30
Steven Morelandbd2d7512022-10-24 22:47:01 +000031 echo "NOTE: THIS INTENTIONALLY MAY FAIL AND REPAIR ITSELF (until 'DONE')"
Alex Buynytskyy3bd1b912022-09-22 11:30:53 -070032 # Update new versions of files. See update-vndk-list.sh (which requires envsetup.sh)
33 $m check-vndk-list || \
34 { cp $top/out/soong/vndk/vndk.libraries.txt $top/build/make/target/product/gsi/current.txt; }
Steven Morelandbd2d7512022-10-24 22:47:01 +000035 echo "DONE: THIS INTENTIONALLY MAY FAIL AND REPAIR ITSELF"
Alex Buynytskyy3bd1b912022-09-22 11:30:53 -070036
37 # Finalize resources
38 "$top/frameworks/base/tools/aapt2/tools/finalize_res.py" \
39 "$top/frameworks/base/core/res/res/values/public-staging.xml" \
40 "$top/frameworks/base/core/res/res/values/public-final.xml"
41
42 # SDK finalization
Alex Buynytskyy13c82672022-12-07 18:54:51 +000043 local sdk_codename="public static final int $PLATFORM_CODENAME_JAVA = CUR_DEVELOPMENT;"
44 local sdk_version="public static final int $PLATFORM_CODENAME_JAVA = $PLATFORM_SDK_VERSION;"
Alex Buynytskyy3bd1b912022-09-22 11:30:53 -070045 local sdk_build="$top/frameworks/base/core/java/android/os/Build.java"
46
47 sed -i "s%$sdk_codename%$sdk_version%g" $sdk_build
48
Alex Buynytskyy2dcc7862022-10-05 18:01:47 +000049 # Force update current.txt
50 $m clobber
Alex Buynytskyy3bd1b912022-09-22 11:30:53 -070051 $m update-api
52}
53
54finalize_aidl_vndk_sdk_resources
55