diff --git a/tools/finalization/README.md b/tools/finalization/README.md index d0aed69ae2..5e2aecd525 100644 --- a/tools/finalization/README.md +++ b/tools/finalization/README.md @@ -19,3 +19,8 @@ Performed in build targets in Finalization branches. ## Utility: [Full cleanup](./cleanup.sh). Remove all local changes and switch each project into head-less state. This is the best state to sync/rebase/finalize the branch. + +## Dry run: +[Full cleanup](./dryrun-cleanup.sh). Remove all local changes and switch each project into head-less state. Also removes "DryRun" branches. +[SDK](./dryrun-step-1.sh). Perform SDK finalization and upload the CLs to Gerrit. +[SDK and REL](./dryrun-step-1-and-2.sh). Perform SDK finalization, plus all necessary changes to switch configuration to REL, and upload the CLs to Gerrit. \ No newline at end of file diff --git a/tools/finalization/dryrun-cleanup.sh b/tools/finalization/dryrun-cleanup.sh new file mode 100755 index 0000000000..ddaffae44c --- /dev/null +++ b/tools/finalization/dryrun-cleanup.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Brings local repository to a remote head state. Also removes all dryrun branches. + +# set -ex + +function finalize_revert_local_changes_main() { + local top="$(dirname "$0")"/../../../.. + source $top/build/make/tools/finalization/environment.sh + + local m="$top/build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug" + + # remove the out folder + $m clobber + + repo selfupdate + + repo forall -c '\ + git checkout . ; git revert --abort ; git clean -fdx ;\ + git checkout @ --detach ; git branch fina-step1 -D ; git reset --hard; \ + repo start fina-step1 ; git checkout @ --detach ; git b fina-step1 -D ; \ + git b $FINAL_PLATFORM_CODENAME-SDK-Finalization-DryRun -D; \ + git b $FINAL_PLATFORM_CODENAME-SDK-Finalization-DryRun-Rel -D; ' +} + +finalize_revert_local_changes_main diff --git a/tools/finalization/dryrun-step-1-and-2.sh b/tools/finalization/dryrun-step-1-and-2.sh new file mode 100755 index 0000000000..38fdb0595b --- /dev/null +++ b/tools/finalization/dryrun-step-1-and-2.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Script to perform 1st and 2nd step of Android Finalization, create CLs and upload to Gerrit. + +function commit_step_2_changes() { + repo forall -c '\ + if [[ $(git status --short) ]]; then + repo start "$FINAL_PLATFORM_CODENAME-SDK-Finalization-DryRun-Rel" ; + git add -A . ; + git commit -m "$FINAL_PLATFORM_CODENAME/$FINAL_PLATFORM_SDK_VERSION is now REL" \ + -m "Ignore-AOSP-First: $FINAL_PLATFORM_CODENAME Finalization +Bug: $FINAL_BUG_ID +Test: build"; + + repo upload --cbr --no-verify -o nokeycheck -t -y . ; + fi' +} + +function finalize_step_2_main() { + local top="$(dirname "$0")"/../../../.. + source $top/build/make/tools/finalization/environment.sh + + source $top/build/make/tools/finalization/finalize-sdk-resources.sh + + source $top/build/make/tools/finalization/localonly-steps.sh + + source $top/build/make/tools/finalization/finalize-sdk-rel.sh + + # move all changes to finalization branch/topic and upload to gerrit + commit_step_2_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" + AIDL_FROZEN_REL=true $m_next + + local m_fina="$top/build/soong/soong_ui.bash --make-mode TARGET_RELEASE=fina_2 TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug" + AIDL_FROZEN_REL=true $m_fina +} + +finalize_step_2_main diff --git a/tools/finalization/dryrun-step-1.sh b/tools/finalization/dryrun-step-1.sh new file mode 100755 index 0000000000..d8893953ab --- /dev/null +++ b/tools/finalization/dryrun-step-1.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Script to perform a dry run of step 1 of Android Finalization, create CLs and upload to Gerrit. + +function commit_step_1_changes() { + repo forall -c '\ + if [[ $(git status --short) ]]; then + repo start "$FINAL_PLATFORM_CODENAME-SDK-Finalization-DryRun" ; + git add -A . ; + git commit -m "$FINAL_PLATFORM_CODENAME is now $FINAL_PLATFORM_SDK_VERSION" \ + -m "Ignore-AOSP-First: $FINAL_PLATFORM_CODENAME Finalization +Bug: $FINAL_BUG_ID +Test: build"; + + repo upload --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 + + 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" + AIDL_FROZEN_REL=true $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" + AIDL_FROZEN_REL=true $m_fina +} + +finalize_step_1_main