Skip to content

Commit ae0ba16

Browse files
Treehugger RobotGerrit Code Review
authored andcommitted
Merge "Finalization script, step 1."
2 parents 358fe88 + 0842d21 commit ae0ba16

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

OWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include platform/build/soong:/OWNERS
22

3-
per-file finalize_branch_for_release.sh = smoreland@google.com
3+
# Finalization scripts
4+
per-file finalize* = smoreland@google.com, alexbuy@google.com

finalize-step-1.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
# Automation for finalize_branch_for_release.sh.
3+
# Sets up local environment, runs the finalization script and submits the results.
4+
# WIP:
5+
# - does not submit, only sends to gerrit.
6+
7+
# set -ex
8+
9+
function revert_local_changes() {
10+
repo forall -c '\
11+
git checkout . ; git clean -fdx ;\
12+
git checkout @ ; git b fina-step1 -D ; git reset --hard; \
13+
repo start fina-step1 ; git checkout @ ; git b fina-step1 -D ;\
14+
previousHash="$(git log --format=%H --no-merges --max-count=1 --grep ^FINALIZATION_STEP_1_SCRIPT_COMMIT)" ;\
15+
if [[ $previousHash ]]; then git revert --no-commit $previousHash ; fi ;'
16+
}
17+
18+
function finalize_step_1_main() {
19+
local top="$(dirname "$0")"/../..
20+
21+
repo selfupdate
22+
23+
revert_local_changes
24+
25+
# vndk etc finalization
26+
source $top/build/make/finalize_branch_for_release.sh
27+
28+
# move all changes to fina-step1 branch and commit with a robot message
29+
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'
30+
}
31+
32+
finalize_step_1_main

finalize_branch_for_release.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,25 @@ function finalize_main() {
2727
$m check-vndk-list || \
2828
{ cp $top/out/soong/vndk/vndk.libraries.txt $top/build/make/target/product/gsi/current.txt; }
2929

30+
# Finalize resources
31+
"$top/frameworks/base/tools/aapt2/tools/finalize_res.py" \
32+
"$top/frameworks/base/core/res/res/values/public-staging.xml" \
33+
"$top/frameworks/base/core/res/res/values/public-final.xml"
34+
35+
# SDK finalization
36+
local sdk_codename='public static final int UPSIDE_DOWN_CAKE = CUR_DEVELOPMENT;'
37+
local sdk_version='public static final int UPSIDE_DOWN_CAKE = 34;'
38+
local sdk_build="$top/frameworks/base/core/java/android/os/Build.java"
39+
40+
sed -i "s%$sdk_codename%$sdk_version%g" $sdk_build
41+
42+
# Update the current.txt
43+
$m update-api
44+
3045
# This command tests:
3146
# The release state for AIDL.
3247
# ABI difference between user and userdebug builds.
48+
# Resource/SDK finalization.
3349
# In the future, we would want to actually turn the branch into the REL
3450
# state and test with that.
3551
AIDL_FROZEN_REL=true $m droidcore
@@ -40,3 +56,4 @@ function finalize_main() {
4056
}
4157

4258
finalize_main
59+

0 commit comments

Comments
 (0)