Skip to content

Commit

Permalink
Merge "Make side change for prod override vars support."
Browse files Browse the repository at this point in the history
  • Loading branch information
gyias authored and Gerrit Code Review committed Feb 7, 2019
2 parents 689e71c + 7dfae50 commit 664b72a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
2 changes: 2 additions & 0 deletions core/product.mk
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ _product_var_list := \
PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS \
PRODUCT_XOM_EXCLUDE_PATHS \
PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES \
PRODUCT_PACKAGE_NAME_OVERRIDES \
PRODUCT_CERTIFICATE_OVERRIDES \
PRODUCT_BUILD_SYSTEM_IMAGE \
PRODUCT_BUILD_SYSTEM_OTHER_IMAGE \
PRODUCT_BUILD_VENDOR_IMAGE \
Expand Down
23 changes: 13 additions & 10 deletions core/product_config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,6 @@ PRODUCT_SHIPPING_API_LEVEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SHI
PRODUCT_DEFAULT_PROPERTY_OVERRIDES := \
$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_PROPERTY_OVERRIDES))

$(foreach rule,$(PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES),\
$(if $(filter 2,$(words $(subst :,$(space),$(rule)))),,\
$(error Rule "$(rule)" in PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDE is not <module_name>:<manifest_name>)))

.KATI_READONLY := PRODUCT_DEFAULT_PROPERTY_OVERRIDES

# A list of property assignments, like "key = value", with zero or more
Expand Down Expand Up @@ -571,12 +567,19 @@ PRODUCT_FORCE_PRODUCT_MODULES_TO_SYSTEM_PARTITION := \
PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS := \
$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS))

# List of <module_name>:<manifest_name> pairs to override the manifest package name
# of a module <module_name> to <manifest_name>. Patterns can be used as in
# com.android.%:com.acme.android.%.release
PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES := \
$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES))
.KATI_READONLY := PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES
define product-overrides-config
PRODUCT_$(1)_OVERRIDES := $$(strip $$(PRODUCTS.$$(INTERNAL_PRODUCT).PRODUCT_$(1)_OVERRIDES))
.KATI_READONLY := PRODUCT_$(1)_OVERRIDES
$$(foreach rule,$$(PRODUCT_$(1)_OVERRIDES),\
$$(if $$(filter 2,$$(words $$(subst :,$$(space),$$(rule)))),,\
$$(error Rule "$$(rule)" in PRODUCT_$(1)_OVERRIDE is not <module_name>:<new_value>)))
endef

$(foreach var, \
MANIFEST_PACKAGE_NAME \
PACKAGE_NAME \
CERTIFICATE, \
$(eval $(call product-overrides-config,$(var))))

# Macro to use below. $(1) is the name of the partition
define product-build-image-config
Expand Down
2 changes: 2 additions & 0 deletions core/soong_config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ $(call add_json_bool, FlattenApex, $(filter true,$(TARGET_
$(call add_json_str, DexpreoptGlobalConfig, $(DEX_PREOPT_CONFIG))

$(call add_json_list, ManifestPackageNameOverrides, $(PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES))
$(call add_json_list, PackageNameOverrides, $(PRODUCT_PACKAGE_NAME_OVERRIDES))
$(call add_json_list, CertificateOverrides, $(PRODUCT_CERTIFICATE_OVERRIDES))

$(call add_json_bool, EnforceSystemCertificate, $(ENFORCE_SYSTEM_CERTIFICATE))
$(call add_json_list, EnforceSystemCertificateWhitelist, $(ENFORCE_SYSTEM_CERTIFICATE_WHITELIST))
Expand Down

0 comments on commit 664b72a

Please sign in to comment.