From 6d7afa00e3dcbab2a60e0c6e88d3c7c2ad78e82e Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Mon, 5 Jun 2023 16:43:55 -0700 Subject: [PATCH] Make RELEASE_PLATFORM_VERSION a release config flag to set platform version. Bug: 282838389 Test: Treehugger Merged-In: Ic6dacbdee7d2408aa8b25b4df59bf9bbc566d747 Change-Id: Ie61a7d986c2b8fe2c16117f6678b9e5a71711647 --- core/envsetup.mk | 4 ++-- core/version_defaults.mk | 3 +-- core/version_util.mk | 10 +++++----- tests/lunch_tests.sh | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/core/envsetup.mk b/core/envsetup.mk index 3e19198557..f5a2022cda 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -66,7 +66,7 @@ $(strip \ $(if $(filter $(ALL_VERSIONS),$(2)),, $(error Invalid MAX_PLATFORM_VERSION '$(2)')) $(if $(filter $(ALL_VERSIONS),$(3)),, - $(error Invalid DEFAULT_PLATFORM_VERSION '$(3)')) + $(error Invalid RELEASE_PLATFORM_VERSION '$(3)')) $(eval allowed_versions_ := $(call find_and_earlier,$(ALL_VERSIONS),$(2))) @@ -77,7 +77,7 @@ $(strip \ $(filter-out $(call find_and_earlier,$(allowed_versions_),$(1)),$(allowed_versions_))) $(if $(filter $(allowed_versions_),$(3)),, - $(error DEFAULT_PLATFORM_VERSION '$(3)' must be between MIN_PLATFORM_VERSION '$(1)' and MAX_PLATFORM_VERSION '$(2)')) + $(error RELEASE_PLATFORM_VERSION '$(3)' must be between MIN_PLATFORM_VERSION '$(1)' and MAX_PLATFORM_VERSION '$(2)')) $(allowed_versions_)) endef diff --git a/core/version_defaults.mk b/core/version_defaults.mk index f9175e45ec..4a42783f06 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -40,8 +40,7 @@ ifdef INTERNAL_BUILD_ID_MAKEFILE include $(INTERNAL_BUILD_ID_MAKEFILE) endif -DEFAULT_PLATFORM_VERSION := VP1A -.KATI_READONLY := DEFAULT_PLATFORM_VERSION +# Set release configuration. The default resides in build/release/build_flags.mk. MIN_PLATFORM_VERSION := UP1A MAX_PLATFORM_VERSION := VP1A diff --git a/core/version_util.mk b/core/version_util.mk index d4ce113ec5..d3fcdc25ce 100644 --- a/core/version_util.mk +++ b/core/version_util.mk @@ -14,17 +14,17 @@ # limitations under the License. # -# - ALLOWED_VERSIONS := $(call allowed-platform-versions,\ $(MIN_PLATFORM_VERSION),\ $(MAX_PLATFORM_VERSION),\ - $(DEFAULT_PLATFORM_VERSION)) + $(RELEASE_PLATFORM_VERSION)) -ifndef TARGET_PLATFORM_VERSION - TARGET_PLATFORM_VERSION := $(DEFAULT_PLATFORM_VERSION) +ifdef TARGET_PLATFORM_VERSION + $(error Do not set TARGET_PLATFORM_VERSION directly. Use RELEASE_PLATFORM_VERSION. value: $(TARGET_PLATFORM_VERSION)) endif +TARGET_PLATFORM_VERSION := $(RELEASE_PLATFORM_VERSION) + ifeq (,$(filter $(ALLOWED_VERSIONS), $(TARGET_PLATFORM_VERSION))) $(warning Invalid TARGET_PLATFORM_VERSION '$(TARGET_PLATFORM_VERSION)', must be one of) $(error $(ALLOWED_VERSIONS)) diff --git a/tests/lunch_tests.sh b/tests/lunch_tests.sh index 4285d13cc4..9b142ee6ab 100755 --- a/tests/lunch_tests.sh +++ b/tests/lunch_tests.sh @@ -28,7 +28,7 @@ function check_lunch [ "$TARGET_PLATFORM_VERSION" = "$4" ] || ( echo "lunch $1: expected TARGET_PLATFORM_VERSION='$4', got '$TARGET_PLATFORM_VERSION'" && exit 1 ) ) -default_version=$(get_build_var DEFAULT_PLATFORM_VERSION) +default_version=$(get_build_var RELEASE_PLATFORM_VERSION) # lunch tests check_lunch "aosp_arm64" "aosp_arm64" "eng" ""