2022-11-22 15:39:41 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# Continuous Integration script for *-finalization-1 branches.
|
|
|
|
# Reverts previous finalization script commits and runs local build.
|
|
|
|
|
2022-11-30 22:44:29 +01:00
|
|
|
set -ex
|
|
|
|
|
2022-11-22 15:39:41 +01:00
|
|
|
function revert_to_unfinalized_state() {
|
2022-11-30 22:44:29 +01:00
|
|
|
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)" ;
|
2022-11-22 15:39:41 +01:00
|
|
|
if [[ $baselineHash ]]; then
|
2022-11-30 22:44:29 +01:00
|
|
|
previousHash="$(git -C $git_path log --format=%H --no-merges --max-count=100 --grep ^FINALIZATION_STEP_1_SCRIPT_COMMIT $baselineHash..HEAD | tr \n \040)" ;
|
2022-11-22 15:39:41 +01:00
|
|
|
else
|
2022-11-30 22:44:29 +01:00
|
|
|
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
|
2022-11-22 15:39:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
# 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
|