Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13c8267a authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Latest finalization scripts.

Bug: 243966946
Bug: 260755259
Test: run locally
Change-Id: I33a841bd83c20b31af604ea014cced38429da0f5
parent 3b12fe1c
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -3,6 +3,9 @@
set -ex

function finalize_aidl_vndk_sdk_resources() {
    local PLATFORM_CODENAME_JAVA='UPSIDE_DOWN_CAKE'
    local PLATFORM_SDK_VERSION='34'

    local top="$(dirname "$0")"/../..

    # default target to modify tree and build SDK
@@ -11,11 +14,13 @@ function finalize_aidl_vndk_sdk_resources() {
    # This script is WIP and only finalizes part of the Android branch for release.
    # The full process can be found at (INTERNAL) go/android-sdk-finalization.

    # VNDK snapshot (TODO)
    # SDK snapshots (TODO)
    # Update references in the codebase to new API version (TODO)
    # ...

    # VNDK definitions for new SDK version
    cp "$top/development/vndk/tools/definition-tool/datasets/vndk-lib-extra-list-current.txt" \
       "$top/development/vndk/tools/definition-tool/datasets/vndk-lib-extra-list-$PLATFORM_SDK_VERSION.txt"

    AIDL_TRANSITIVE_FREEZE=true $m aidl-freeze-api create_reference_dumps

    # Generate ABI dumps
@@ -35,8 +40,8 @@ function finalize_aidl_vndk_sdk_resources() {
           "$top/frameworks/base/core/res/res/values/public-final.xml"

    # SDK finalization
    local sdk_codename='public static final int UPSIDE_DOWN_CAKE = CUR_DEVELOPMENT;'
    local sdk_version='public static final int UPSIDE_DOWN_CAKE = 34;'
    local sdk_codename="public static final int $PLATFORM_CODENAME_JAVA = CUR_DEVELOPMENT;"
    local sdk_version="public static final int $PLATFORM_CODENAME_JAVA = $PLATFORM_SDK_VERSION;"
    local sdk_build="$top/frameworks/base/core/java/android/os/Build.java"

    sed -i "s%$sdk_codename%$sdk_version%g" $sdk_build
+60 −0
Original line number Diff line number Diff line
#!/bin/bash
# Continuous Integration script for *-finalization-2 branches.
# Reverts previous finalization script commits and runs local build.

set -ex

function revert_to_unfinalized_state() {
    declare -a projects=(
        "build/make/"
        "build/soong/"
        "cts/"
        "frameworks/base/"
        "frameworks/hardware/interfaces/"
        "frameworks/libs/modules-utils/"
        "frameworks/libs/net/"
        "hardware/interfaces/"
        "libcore/"
        "packages/services/Car/"
        "platform_testing/"
        "prebuilts/abi-dumps/ndk/"
        "prebuilts/abi-dumps/platform/"
        "prebuilts/abi-dumps/vndk/"
        "system/hardware/interfaces/"
        "system/tools/aidl/"
        "tools/platform-compat"
        "device/generic/car"
        "development"
    )

    for project in "${projects[@]}"
    do
        local git_path="$top/$project"
        echo "Reverting: $git_path"
        baselineHash="$(git -C $git_path log --format=%H --no-merges --max-count=1 --grep ^FINALIZATION_STEP_1_BASELINE_COMMIT)" ;
        if [[ $baselineHash ]]; then
          previousHash="$(git -C $git_path log --format=%H --no-merges --max-count=100 --grep ^FINALIZATION_STEP_1_SCRIPT_COMMIT $baselineHash..HEAD | tr \n \040)" ;
        else
          previousHash="$(git -C $git_path log --format=%H --no-merges --max-count=100 --grep ^FINALIZATION_STEP_1_SCRIPT_COMMIT | tr \n \040)" ;
        fi ;
        if [[ $previousHash ]]; then git -C $git_path revert --no-commit --strategy=ort --strategy-option=ours $previousHash ; fi ;
    done
}

function finalize_step_2_main() {
    local top="$(dirname "$0")"/../..
    local m="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"

    revert_to_unfinalized_state

    # vndk etc finalization
    source $top/build/make/finalize-aidl-vndk-sdk-resources.sh

    # prebuilts etc
    source $top/build/make/finalize-sdk-rel.sh

    # build to confirm everything is OK
    AIDL_FROZEN_REL=true $m
}

finalize_step_2_main