Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a385021 authored by Yuntao Xu's avatar Yuntao Xu Committed by Automerger Merge Worker
Browse files

Merge "Add the cts-platform-version check" into sc-dev-plus-aosp am: 19416d38 am: d4e953c8

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/+/15700884

Change-Id: Ia80e97cac6a463f3867d44e4b779087441bad26a
parents 284c501a d4e953c8
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -25,3 +25,35 @@ $(call dist-for-goals, cts, $(compatibility_zip))

.PHONY: cts_v2
cts_v2: cts

# platform version check (b/32056228)
# ============================================================
ifneq (,$(wildcard cts/))
  cts_platform_version_path := cts/tests/tests/os/assets/platform_versions.txt
  cts_platform_version_string := $(shell cat $(cts_platform_version_path))
  cts_platform_release_path := cts/tests/tests/os/assets/platform_releases.txt
  cts_platform_release_string := $(shell cat $(cts_platform_release_path))

  ifeq (,$(findstring $(PLATFORM_VERSION),$(cts_platform_version_string)))
    define error_msg
      ============================================================
      Could not find version "$(PLATFORM_VERSION)" in CTS platform version file:
      $(cts_platform_version_path)
      Most likely PLATFORM_VERSION in build/core/version_defaults.mk
      has changed and a new version must be added to this CTS file.
      ============================================================
    endef
    $(error $(error_msg))
  endif
  ifeq (,$(findstring $(PLATFORM_VERSION_LAST_STABLE),$(cts_platform_release_string)))
    define error_msg
      ============================================================
      Could not find version "$(PLATFORM_VERSION_LAST_STABLE)" in CTS platform release file:
      $(cts_platform_release_path)
      Most likely PLATFORM_VERSION_LAST_STABLE in build/core/version_defaults.mk
      has changed and a new version must be added to this CTS file.
      ============================================================
    endef
    $(error $(error_msg))
  endif
endif