New product config flag to gate blueprint modules

Example usage:
PRODUCT_INCLUDE_TAGS += use_myspecial_sdk

This also populates the allowlist with go/nogo mainline tags. Usage of
`PRODUCT_INCLUDE_TAGS` outside this allowlist will raise an error
in product config

Test: TH

Change-Id: Ica82a8f65cbfda600d72fc54fb873c1eaa1666a7
This commit is contained in:
Spandan Das 2022-11-10 03:02:13 +00:00
parent 33544af4d1
commit 00114d4418
3 changed files with 13 additions and 0 deletions

View file

@ -263,6 +263,9 @@ _product_list_vars += PRODUCT_FORCE_PRODUCT_MODULES_TO_SYSTEM_PARTITION
# This flag implies PRODUCT_USE_DYNAMIC_PARTITIONS.
_product_single_value_vars += PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
# List of tags that will be used to gate blueprint modules from the build graph
_product_list_vars += PRODUCT_INCLUDE_TAGS
# When this is true, various build time as well as runtime debugfs restrictions are enabled.
_product_single_value_vars += PRODUCT_SET_DEBUGFS_RESTRICTIONS

View file

@ -274,6 +274,14 @@ endif
current_product_makefile :=
#############################################################################
# Check product include tag allowlist
BLUEPRINT_INCLUDE_TAGS_ALLOWLIST := com.android.mainline_go com.android.mainline
.KATI_READONLY := BLUEPRINT_INCLUDE_TAGS_ALLOWLIST
$(foreach include_tag,$(PRODUCT_INCLUDE_TAGS), \
$(if $(filter $(include_tag),$(BLUEPRINT_INCLUDE_TAGS_ALLOWLIST)),,\
$(call pretty-error, $(include_tag) is not in BLUEPRINT_INCLUDE_TAGS_ALLOWLIST: $(BLUEPRINT_INCLUDE_TAGS_ALLOWLIST))))
#############################################################################
# Quick check and assign default values
TARGET_DEVICE := $(PRODUCT_DEVICE)

View file

@ -300,6 +300,8 @@ $(call add_json_bool, GenerateAidlNdkPlatformBackend, $(filter true,$(NEED_AIDL_
$(call add_json_bool, IgnorePrefer32OnDevice, $(filter true,$(IGNORE_PREFER32_ON_DEVICE)))
$(call add_json_list, IncludeTags, $(PRODUCT_INCLUDE_TAGS))
$(call json_end)
$(file >$(SOONG_VARIABLES).tmp,$(json_contents))