blob: 843c14282e6f284e3e4aad5dc12facf5a64db1a6 [file] [log] [blame]
Alex Buynytskyye5aeeb92022-11-22 14:39:41 +00001#!/bin/bash
2# Continuous Integration script for *-finalization-1 branches.
3# Reverts previous finalization script commits and runs local build.
4
5function revert_to_unfinalized_state() {
6 repo forall -c '\
7 git checkout . ; git revert --abort ; git clean -fdx ;\
8 git checkout @ ; git branch fina-step1 -D ; git reset --hard; \
9 repo start fina-step1 ; git checkout @ ; git b fina-step1 -D ;\
10 baselineHash="$(git log --format=%H --no-merges --max-count=1 --grep ^FINALIZATION_STEP_1_BASELINE_COMMIT)" ;\
11 if [[ $baselineHash ]]; then
12 previousHash="$(git log --format=%H --no-merges --max-count=100 --grep ^FINALIZATION_STEP_1_SCRIPT_COMMIT $baselineHash..HEAD | tr \n \040)" ;\
13 else
14 previousHash="$(git log --format=%H --no-merges --max-count=100 --grep ^FINALIZATION_STEP_1_SCRIPT_COMMIT | tr \n \040)" ;\
15 fi ; \
16 if [[ $previousHash ]]; then git revert --no-commit --strategy=ort --strategy-option=ours $previousHash ; fi ;'
17}
18
19function finalize_step_1_main() {
20 local top="$(dirname "$0")"/../..
21 local m="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"
22
23 revert_to_unfinalized_state
24
25 set -ex
26
27 # vndk etc finalization
28 source $top/build/make/finalize-aidl-vndk-sdk-resources.sh
29
30 # build to confirm everything is OK
31 AIDL_FROZEN_REL=true $m
32}
33
34finalize_step_1_main