blob: 8826b35c0fd853f3a67e06c006611d5a70cefb67 [file] [log] [blame]
Justin Yun7c28c232024-01-31 16:56:10 +09001#!/bin/bash
2# Copyright 2024 Google Inc. All rights reserved.
3
4set -ex
5
6function finalize_main_step0() {
7 local top="$(dirname "$0")"/../../../..
8 source $top/build/make/tools/finalization/environment.sh
9
Justin Yun7fc38022024-07-19 08:43:20 +090010 local need_vintf_finalize=false
Justin Yun7c28c232024-01-31 16:56:10 +090011 if [ "$FINAL_STATE" = "unfinalized" ] ; then
Justin Yun7fc38022024-07-19 08:43:20 +090012 need_vintf_finalize=true
13 else
14 # build-step-0.sh tests the vintf finalization step (step-0) when the
15 # FINAL_BOARD_API_LEVEL is the same as the RELEASE_BOARD_API_LEVEL; and
16 # RELEASE_BOARD_API_LEVEL_FROZEN is not true from the fina_0 configuration.
17 # The FINAL_BOARD_API_LEVEL must be the next vendor API level to be finalized.
18 local board_api_level_vars=$(TARGET_RELEASE=fina_0 $top/build/soong/soong_ui.bash --dumpvars-mode -vars "RELEASE_BOARD_API_LEVEL_FROZEN RELEASE_BOARD_API_LEVEL")
19 local target_board_api_level_vars="RELEASE_BOARD_API_LEVEL_FROZEN=''
20RELEASE_BOARD_API_LEVEL='$FINAL_BOARD_API_LEVEL'"
21 if [ "$board_api_level_vars" = "$target_board_api_level_vars" ] ; then
22 echo The target is a finalization candidate.
23 need_vintf_finalize=true
24 fi;
25 fi;
26
27 if [ "$need_vintf_finalize" = true ] ; then # VINTF finalization
Justin Yun7c28c232024-01-31 16:56:10 +090028 source $top/build/make/tools/finalization/finalize-vintf-resources.sh
29 fi;
30}
31
32finalize_main_step0