platform_build/tools/finalization/step-1.sh
Mårten Kongstad 6c6a1b5b8e finalization: use same repo branch during dry-run
Teach step-*.sh to re-use the same branch name if running in dry-run
mode. This is useful for running the steps sequentially: if using
different branch names, each 'repo start' will undo the changes created
during the previous step-*.sh.

Bug: 323940469
Test: croot && build/tools/finalization/step-1.sh --dry-run && build/tools/finalization/step-2.sh --dry-run
Ignore-AOSP-first: VIC finalization happens outside AOSP
Change-Id: I720f294f6abf5a8b276bb30f8c531fcbea749b76
2024-04-08 17:15:22 +02:00

39 lines
1.5 KiB
Bash
Executable file

#!/bin/bash
# Script to perform a 1st step of Android Finalization: API/SDK finalization, create CLs and upload to Gerrit.
set -ex
function commit_step_1_changes() {
set +e
repo forall -c '\
if [[ $(git status --short) ]]; then
repo start "'$repo_branch'" ;
git add -A . ;
git commit -m "$FINAL_PLATFORM_CODENAME is now $FINAL_PLATFORM_SDK_VERSION and extension version $FINAL_MAINLINE_EXTENSION" \
-m "Ignore-AOSP-First: $FINAL_PLATFORM_CODENAME Finalization
Bug: $FINAL_BUG_ID
Test: build";
repo upload '"$repo_upload_dry_run_arg"' --cbr --no-verify -o nokeycheck -t -y . ;
fi'
}
function finalize_step_1_main() {
local top="$(dirname "$0")"/../../../..
source $top/build/make/tools/finalization/environment.sh
local repo_branch="$FINAL_PLATFORM_CODENAME-SDK-Finalization"
source $top/build/make/tools/finalization/command-line-options.sh
source $top/build/make/tools/finalization/finalize-sdk-resources.sh
# move all changes to finalization branch/topic and upload to gerrit
commit_step_1_changes
# build to confirm everything is OK
local m_next="$top/build/soong/soong_ui.bash --make-mode TARGET_RELEASE=next TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"
$m_next
local m_fina="$top/build/soong/soong_ui.bash --make-mode TARGET_RELEASE=fina_1 TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"
$m_fina
}
finalize_step_1_main $@