Merge "Rename _all_release_configs so it's more accessible for list_releases command" into main

This commit is contained in:
Joe Onorato
2024-05-31 20:22:06 +00:00
committed by Gerrit Code Review

View File

@@ -139,7 +139,7 @@ ifneq (,$(_use_protobuf))
ifneq (,$(_final_product_config_pass)) ifneq (,$(_final_product_config_pass))
# Save the final version of the config. # Save the final version of the config.
$(shell if ! cmp --quiet $(_flags_varmk) $(_flags_file); then cp $(_flags_varmk) $(_flags_file); fi) $(shell if ! cmp --quiet $(_flags_varmk) $(_flags_file); then cp $(_flags_varmk) $(_flags_file); fi)
# This will also set _all_release_configs and _used_files for us. # This will also set ALL_RELEASE_CONFIGS_FOR_PRODUCT and _used_files for us.
$(eval include $(_flags_file)) $(eval include $(_flags_file))
$(KATI_extra_file_deps $(OUT_DIR)/release-config $(protobuf_map_files) $(_flags_file)) $(KATI_extra_file_deps $(OUT_DIR)/release-config $(protobuf_map_files) $(_flags_file))
else else
@@ -217,9 +217,9 @@ define _declare-release-config
$(error declare-release-config: config $(strip $(1)) must have release config files, override another release config, or both) \ $(error declare-release-config: config $(strip $(1)) must have release config files, override another release config, or both) \
) )
$(if $(strip $(4)),$(eval _all_release_configs.$(strip $(1)).ALIAS := true)) $(if $(strip $(4)),$(eval _all_release_configs.$(strip $(1)).ALIAS := true))
$(eval _all_release_configs := $(sort $(_all_release_configs) $(strip $(1)))) $(eval ALL_RELEASE_CONFIGS_FOR_PRODUCT := $(sort $(ALL_RELEASE_CONFIGS_FOR_PRODUCT) $(strip $(1))))
$(if $(strip $(3)), \ $(if $(strip $(3)), \
$(if $(filter $(_all_release_configs), $(strip $(3))), $(if $(filter $(ALL_RELEASE_CONFIGS_FOR_PRODUCT), $(strip $(3))),
$(if $(filter $(_all_release_configs.$(strip $(1)).OVERRIDES),$(strip $(3))),, $(if $(filter $(_all_release_configs.$(strip $(1)).OVERRIDES),$(strip $(3))),,
$(eval _all_release_configs.$(strip $(1)).OVERRIDES := $(_all_release_configs.$(strip $(1)).OVERRIDES) $(strip $(3)))), \ $(eval _all_release_configs.$(strip $(1)).OVERRIDES := $(_all_release_configs.$(strip $(1)).OVERRIDES) $(strip $(3)))), \
$(error No release config $(strip $(3))) \ $(error No release config $(strip $(3))) \
@@ -245,13 +245,13 @@ $(foreach f, $(config_map_files), \
FLAG_DECLARATION_FILES := FLAG_DECLARATION_FILES :=
# Verify that all inherited/overridden release configs are declared. # Verify that all inherited/overridden release configs are declared.
$(foreach config,$(_all_release_configs),\ $(foreach config,$(ALL_RELEASE_CONFIGS_FOR_PRODUCT),\
$(foreach r,$(all_release_configs.$(r).OVERRIDES),\ $(foreach r,$(all_release_configs.$(r).OVERRIDES),\
$(if $(strip $(_all_release_configs.$(r).FILES)$(_all_release_configs.$(r).OVERRIDES)),,\ $(if $(strip $(_all_release_configs.$(r).FILES)$(_all_release_configs.$(r).OVERRIDES)),,\
$(error Release config $(config) [declared in: $(_all_release_configs.$(r).DECLARED_IN)] inherits from non-existent $(r).)\ $(error Release config $(config) [declared in: $(_all_release_configs.$(r).DECLARED_IN)] inherits from non-existent $(r).)\
))) )))
# Verify that alias configs do not have config files. # Verify that alias configs do not have config files.
$(foreach r,$(_all_release_configs),\ $(foreach r,$(ALL_RELEASE_CONFIGS_FOR_PRODUCT),\
$(if $(_all_release_configs.$(r).ALIAS),$(if $(_all_release_configs.$(r).FILES),\ $(if $(_all_release_configs.$(r).ALIAS),$(if $(_all_release_configs.$(r).FILES),\
$(error Alias release config "$(r)" may not specify release config files $(_all_release_configs.$(r).FILES))\ $(error Alias release config "$(r)" may not specify release config files $(_all_release_configs.$(r).FILES))\
))) )))
@@ -266,7 +266,7 @@ ifeq ($(TARGET_RELEASE),)
# if the variable was completely unset. # if the variable was completely unset.
TARGET_RELEASE ?= was_unset TARGET_RELEASE ?= was_unset
ifeq ($(TARGET_RELEASE),was_unset) ifeq ($(TARGET_RELEASE),was_unset)
$(error No release config set for target; please set TARGET_RELEASE, or if building on the command line use 'lunch <target>-<release>-<build_type>', where release is one of: $(_all_release_configs)) $(error No release config set for target; please set TARGET_RELEASE, or if building on the command line use 'lunch <target>-<release>-<build_type>', where release is one of: $(ALL_RELEASE_CONFIGS_FOR_PRODUCT))
endif endif
# Instead of leaving this string empty, we want to default to a valid # Instead of leaving this string empty, we want to default to a valid
# setting. Full builds coming through this path is a bug, but in case # setting. Full builds coming through this path is a bug, but in case
@@ -277,8 +277,8 @@ endif
# During pass 1 of product config, using a non-existent release config is not an error. # During pass 1 of product config, using a non-existent release config is not an error.
# We can safely assume that we are doing pass 1 if DUMP_MANY_VARS=="PRODUCT_RELEASE_CONFIG_MAPS". # We can safely assume that we are doing pass 1 if DUMP_MANY_VARS=="PRODUCT_RELEASE_CONFIG_MAPS".
ifneq (,$(_final_product_config_pass)) ifneq (,$(_final_product_config_pass))
ifeq ($(filter $(_all_release_configs), $(TARGET_RELEASE)),) ifeq ($(filter $(ALL_RELEASE_CONFIGS_FOR_PRODUCT), $(TARGET_RELEASE)),)
$(error No release config found for TARGET_RELEASE: $(TARGET_RELEASE). Available releases are: $(_all_release_configs)) $(error No release config found for TARGET_RELEASE: $(TARGET_RELEASE). Available releases are: $(ALL_RELEASE_CONFIGS_FOR_PRODUCT))
endif endif
endif endif
@@ -327,14 +327,13 @@ endif
.KATI_READONLY := TARGET_RELEASE .KATI_READONLY := TARGET_RELEASE
ifeq (,$(_use_protobuf)) ifeq (,$(_use_protobuf))
$(foreach config, $(_all_release_configs), \ $(foreach config, $(ALL_RELEASE_CONFIGS_FOR_PRODUCT), \
$(eval _all_release_configs.$(config).DECLARED_IN:= ) \ $(eval _all_release_configs.$(config).DECLARED_IN:= ) \
$(eval _all_release_configs.$(config).FILES:= ) \ $(eval _all_release_configs.$(config).FILES:= ) \
) )
applied_releases:= applied_releases:=
# use makefiles # use makefiles
endif endif
_all_release_configs:=
config_map_files:= config_map_files:=
protobuf_map_files:= protobuf_map_files:=
@@ -381,3 +380,4 @@ endif
_can_protobuf := _can_protobuf :=
_must_protobuf := _must_protobuf :=
_use_protobuf := _use_protobuf :=