Merge "Finalization script, step 1."

This commit is contained in:
Treehugger Robot 2022-09-21 22:10:17 +00:00 committed by Gerrit Code Review
commit ae0ba167d4
3 changed files with 51 additions and 1 deletions

3
OWNERS
View file

@ -1,3 +1,4 @@
include platform/build/soong:/OWNERS include platform/build/soong:/OWNERS
per-file finalize_branch_for_release.sh = smoreland@google.com # Finalization scripts
per-file finalize* = smoreland@google.com, alexbuy@google.com

32
finalize-step-1.sh Executable file
View file

@ -0,0 +1,32 @@
#!/bin/bash
# Automation for finalize_branch_for_release.sh.
# Sets up local environment, runs the finalization script and submits the results.
# WIP:
# - does not submit, only sends to gerrit.
# set -ex
function revert_local_changes() {
repo forall -c '\
git checkout . ; git clean -fdx ;\
git checkout @ ; git b fina-step1 -D ; git reset --hard; \
repo start fina-step1 ; git checkout @ ; git b fina-step1 -D ;\
previousHash="$(git log --format=%H --no-merges --max-count=1 --grep ^FINALIZATION_STEP_1_SCRIPT_COMMIT)" ;\
if [[ $previousHash ]]; then git revert --no-commit $previousHash ; fi ;'
}
function finalize_step_1_main() {
local top="$(dirname "$0")"/../..
repo selfupdate
revert_local_changes
# vndk etc finalization
source $top/build/make/finalize_branch_for_release.sh
# move all changes to fina-step1 branch and commit with a robot message
repo forall -c 'if [[ $(git status --short) ]]; then repo start fina-step1 ; git add -A . ; git commit -m FINALIZATION_STEP_1_SCRIPT_COMMIT -m WILL_BE_AUTOMATICALLY_REVERTED ; repo upload --cbr --no-verify -t -y . ; fi'
}
finalize_step_1_main

View file

@ -27,9 +27,25 @@ function finalize_main() {
$m check-vndk-list || \ $m check-vndk-list || \
{ cp $top/out/soong/vndk/vndk.libraries.txt $top/build/make/target/product/gsi/current.txt; } { cp $top/out/soong/vndk/vndk.libraries.txt $top/build/make/target/product/gsi/current.txt; }
# Finalize resources
"$top/frameworks/base/tools/aapt2/tools/finalize_res.py" \
"$top/frameworks/base/core/res/res/values/public-staging.xml" \
"$top/frameworks/base/core/res/res/values/public-final.xml"
# SDK finalization
local sdk_codename='public static final int UPSIDE_DOWN_CAKE = CUR_DEVELOPMENT;'
local sdk_version='public static final int UPSIDE_DOWN_CAKE = 34;'
local sdk_build="$top/frameworks/base/core/java/android/os/Build.java"
sed -i "s%$sdk_codename%$sdk_version%g" $sdk_build
# Update the current.txt
$m update-api
# This command tests: # This command tests:
# The release state for AIDL. # The release state for AIDL.
# ABI difference between user and userdebug builds. # ABI difference between user and userdebug builds.
# Resource/SDK finalization.
# In the future, we would want to actually turn the branch into the REL # In the future, we would want to actually turn the branch into the REL
# state and test with that. # state and test with that.
AIDL_FROZEN_REL=true $m droidcore AIDL_FROZEN_REL=true $m droidcore
@ -40,3 +56,4 @@ function finalize_main() {
} }
finalize_main finalize_main