Update api_levels.go instead of api_constants.bzl

This is a revert of aosp/2573034, but as a separate cl because the
filename has been changed. We're reverting aosp/2573034 because the
bazel migration has been cancelled and that api_constants.bzl file
was changed to not be used.

Ignore-AOSP-First: Someone else renamed this file in internal-only.

Bug: 315353489
Test: Manually ran this snippet of shell script
Change-Id: I3a51be1119109d2a6cf3959bdc8a48192872580f
This commit is contained in:
Cole Faust
2024-04-09 09:54:23 -07:00
parent 814dd5b388
commit f13fd59f55

View File

@@ -120,10 +120,10 @@ function finalize_sdk_resources() {
local build_tools_source="$top/development/sdk/build_tools_source.prop_template"
sed -i -e 's/Pkg\.Revision.*/Pkg\.Revision=${PLATFORM_SDK_VERSION}.0.0/g' $build_tools_source
# build/bazel
local codename_version="\"${FINAL_PLATFORM_CODENAME}\": ${FINAL_PLATFORM_SDK_VERSION}"
if ! grep -q "$codename_version" "$top/build/bazel/rules/common/api_constants.bzl" ; then
sed -i -e "/:.*$((${FINAL_PLATFORM_SDK_VERSION}-1)),/a \\ $codename_version," "$top/build/bazel/rules/common/api_constants.bzl"
# build/soong
local codename_version="\"${FINAL_PLATFORM_CODENAME}\": ${FINAL_PLATFORM_SDK_VERSION}"
if ! grep -q "$codename_version" "$top/build/soong/android/api_levels.go" ; then
sed -i -e "/:.*$((${FINAL_PLATFORM_SDK_VERSION}-1)),/a \\\t\t$codename_version," "$top/build/soong/android/api_levels.go"
fi
# cts