Give an error when trying to build "next" targets
The "next" targets aren't supported yet, so we want to fail
immediately.
If the environment variable TESTING_TARGET_RELEASE_NEXT is
set, then we'll allow a "next" build, so folks can work on
fixing this in the meantime.
Bug: 294161396
Test: "lunch mokey-next-userdebug" with and without TESTING_TARGET_RELEASE_NEXT set
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f40be02ee51dec1bd5cdf88a4419684585ef6ef3)
Change-Id: If478a4efef937a0a986bfefdb61cc25921863b25
diff --git a/core/release_config.mk b/core/release_config.mk
index b72ee89..4f9daaf 100644
--- a/core/release_config.mk
+++ b/core/release_config.mk
@@ -76,6 +76,12 @@
ifeq ($(filter $(_all_release_configs), $(TARGET_RELEASE)),)
$(error No release config found for TARGET_RELEASE: $(TARGET_RELEASE). Available releases are: $(_all_release_configs))
else
+# TODO(b/294161396): Remove this logic
+ifeq ($(TARGET_RELEASE),next)
+ifndef TESTING_TARGET_RELEASE_NEXT
+ $(error "next" releases are not supported yet. b/294161396)
+endif
+endif
# Choose flag files
# Don't sort this, use it in the order they gave us.
flag_value_files := $(_all_release_configs.$(TARGET_RELEASE).FILES)