blob: c5114fe1fdf3d80645ebd2c57e6afdc9ff1ec761 [file] [log] [blame]
Steven Moreland35496592022-04-19 00:57:45 +00001#!/bin/bash
2
Steven Moreland4d4b5802022-06-02 17:21:30 +00003set -ex
Steven Moreland35496592022-04-19 00:57:45 +00004
Steven Moreland4d4b5802022-06-02 17:21:30 +00005function finalize_main() {
6 local top="$(dirname "$0")"/../..
Steven Moreland35496592022-04-19 00:57:45 +00007
Steven Moreland4d4b5802022-06-02 17:21:30 +00008 # default target to modify tree and build SDK
9 local m="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"
Steven Moreland35496592022-04-19 00:57:45 +000010
Steven Moreland4d4b5802022-06-02 17:21:30 +000011 # This script is WIP and only finalizes part of the Android branch for release.
12 # The full process can be found at (INTERNAL) go/android-sdk-finalization.
Steven Moreland35496592022-04-19 00:57:45 +000013
Steven Moreland4d4b5802022-06-02 17:21:30 +000014 # VNDK snapshot (TODO)
15 # SDK snapshots (TODO)
16 # Update references in the codebase to new API version (TODO)
17 # ...
Steven Moreland35496592022-04-19 00:57:45 +000018
Hsin-Yi Chen6c2353d2022-07-08 12:09:10 +080019 AIDL_TRANSITIVE_FREEZE=true $m aidl-freeze-api create_reference_dumps
20
21 # Generate ABI dumps
22 ANDROID_BUILD_TOP="$top" \
23 out/host/linux-x86/bin/create_reference_dumps \
24 -p aosp_arm64 --build-variant user
Steven Moreland35496592022-04-19 00:57:45 +000025
Steven Moreland4d4b5802022-06-02 17:21:30 +000026 # Update new versions of files. See update-vndk-list.sh (which requires envsetup.sh)
27 $m check-vndk-list || \
28 { cp $top/out/soong/vndk/vndk.libraries.txt $top/build/make/target/product/gsi/current.txt; }
Steven Moreland35496592022-04-19 00:57:45 +000029
Alex Buynytskyy0842d212022-09-16 09:33:33 -070030 # Finalize resources
31 "$top/frameworks/base/tools/aapt2/tools/finalize_res.py" \
32 "$top/frameworks/base/core/res/res/values/public-staging.xml" \
33 "$top/frameworks/base/core/res/res/values/public-final.xml"
34
35 # SDK finalization
36 local sdk_codename='public static final int UPSIDE_DOWN_CAKE = CUR_DEVELOPMENT;'
37 local sdk_version='public static final int UPSIDE_DOWN_CAKE = 34;'
38 local sdk_build="$top/frameworks/base/core/java/android/os/Build.java"
39
40 sed -i "s%$sdk_codename%$sdk_version%g" $sdk_build
41
42 # Update the current.txt
43 $m update-api
44
Hsin-Yi Chen6c2353d2022-07-08 12:09:10 +080045 # This command tests:
46 # The release state for AIDL.
47 # ABI difference between user and userdebug builds.
Alex Buynytskyy0842d212022-09-16 09:33:33 -070048 # Resource/SDK finalization.
Hsin-Yi Chen6c2353d2022-07-08 12:09:10 +080049 # In the future, we would want to actually turn the branch into the REL
50 # state and test with that.
51 AIDL_FROZEN_REL=true $m droidcore
Steven Moreland392499b2022-04-22 22:07:27 +000052
Steven Moreland4d4b5802022-06-02 17:21:30 +000053 # Build SDK (TODO)
54 # lunch sdk...
55 # m ...
56}
Steven Moreland35496592022-04-19 00:57:45 +000057
Steven Moreland4d4b5802022-06-02 17:21:30 +000058finalize_main
Alex Buynytskyy0842d212022-09-16 09:33:33 -070059