diff options
author | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-11-22 20:06:38 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-11-22 20:06:38 +0000 |
commit | 7a830b98265ba50fd87740efdca0838210e45c9f (patch) | |
tree | bbb7287926c3362bdaa11d5e50a95437f2fa4d82 | |
parent | 889ef74ed25aa510792abe11025ade89bf82238f (diff) | |
parent | 19000936ad83e7b59134f26b9215521b0d46c836 (diff) | |
download | build-7a830b98265ba50fd87740efdca0838210e45c9f.tar.gz |
Merge "Merge "Script for CI build target on *-finalization-1 branches." am: 7e34ad149f" into main-16k
-rwxr-xr-x | finalize-step-1-for-build-target.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/finalize-step-1-for-build-target.sh b/finalize-step-1-for-build-target.sh new file mode 100755 index 0000000000..843c14282e --- /dev/null +++ b/finalize-step-1-for-build-target.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Continuous Integration script for *-finalization-1 branches. +# Reverts previous finalization script commits and runs local build. + +function revert_to_unfinalized_state() { + repo forall -c '\ + git checkout . ; git revert --abort ; git clean -fdx ;\ + git checkout @ ; git branch fina-step1 -D ; git reset --hard; \ + repo start fina-step1 ; git checkout @ ; git b fina-step1 -D ;\ + baselineHash="$(git log --format=%H --no-merges --max-count=1 --grep ^FINALIZATION_STEP_1_BASELINE_COMMIT)" ;\ + if [[ $baselineHash ]]; then + previousHash="$(git log --format=%H --no-merges --max-count=100 --grep ^FINALIZATION_STEP_1_SCRIPT_COMMIT $baselineHash..HEAD | tr \n \040)" ;\ + else + previousHash="$(git log --format=%H --no-merges --max-count=100 --grep ^FINALIZATION_STEP_1_SCRIPT_COMMIT | tr \n \040)" ;\ + fi ; \ + if [[ $previousHash ]]; then git revert --no-commit --strategy=ort --strategy-option=ours $previousHash ; fi ;' +} + +function finalize_step_1_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 + + set -ex + + # vndk etc finalization + source $top/build/make/finalize-aidl-vndk-sdk-resources.sh + + # build to confirm everything is OK + AIDL_FROZEN_REL=true $m +} + +finalize_step_1_main |