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

Commit 65a2b40d authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Extract finalization build to a separate script."

parents 80a3e189 3bd1b918
Loading
Loading
Loading
Loading
+47 −0
Original line number Diff line number Diff line
#!/bin/bash

set -ex

function finalize_aidl_vndk_sdk_resources() {
    local top="$(dirname "$0")"/../..

    # default target to modify tree and build SDK
    local m="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"

    # 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)
    # ...

    AIDL_TRANSITIVE_FREEZE=true $m aidl-freeze-api create_reference_dumps

    # Generate ABI dumps
    ANDROID_BUILD_TOP="$top" \
        out/host/linux-x86/bin/create_reference_dumps \
        -p aosp_arm64 --build-variant user

    # Update new versions of files. See update-vndk-list.sh (which requires envsetup.sh)
    $m check-vndk-list || \
        { cp $top/out/soong/vndk/vndk.libraries.txt $top/build/make/target/product/gsi/current.txt; }

    # Finalize resources
    "$top/frameworks/base/tools/aapt2/tools/finalize_res.py" \
           "$top/frameworks/base/core/res/res/values/public-staging.xml" \
           "$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_build="$top/frameworks/base/core/java/android/os/Build.java"

    sed -i "s%$sdk_codename%$sdk_version%g" $sdk_build

    # Update the current.txt
    $m update-api
}

finalize_aidl_vndk_sdk_resources
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ function finalize_step_1_main() {
    revert_local_changes

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

    # move all changes to fina-step1 branch and commit with a robot message
    repo forall -c 'if [[ $(git status --short) ]]; then repo start fina-step1 ; git add -A . ; git commit -m FINALIZATION_STEP_1_SCRIPT_COMMIT -m WILL_BE_AUTOMATICALLY_REVERTED ; repo upload --cbr --no-verify -t -y . ; fi'
+2 −33
Original line number Diff line number Diff line
@@ -8,39 +8,8 @@ function finalize_main() {
    # default target to modify tree and build SDK
    local m="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"

    # 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)
    # ...

    AIDL_TRANSITIVE_FREEZE=true $m aidl-freeze-api create_reference_dumps

    # Generate ABI dumps
    ANDROID_BUILD_TOP="$top" \
        out/host/linux-x86/bin/create_reference_dumps \
        -p aosp_arm64 --build-variant user

    # Update new versions of files. See update-vndk-list.sh (which requires envsetup.sh)
    $m check-vndk-list || \
        { cp $top/out/soong/vndk/vndk.libraries.txt $top/build/make/target/product/gsi/current.txt; }

    # Finalize resources
    "$top/frameworks/base/tools/aapt2/tools/finalize_res.py" \
           "$top/frameworks/base/core/res/res/values/public-staging.xml" \
           "$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_build="$top/frameworks/base/core/java/android/os/Build.java"

    sed -i "s%$sdk_codename%$sdk_version%g" $sdk_build

    # Update the current.txt
    $m update-api
    # Build finalization artifacts.
    source $top/build/make/finalize-aidl-vndk-sdk-resources.sh

    # This command tests:
    #   The release state for AIDL.