From 7dfae5023aa13336b90a308a9654b1c7636a6855 Mon Sep 17 00:00:00 2001 From: Jaewoong Jung Date: Mon, 28 Jan 2019 16:19:33 -0800 Subject: [PATCH] Make side change for prod override vars support. For the new override vars, we don't support make-based overrides because their primary purpose is to enable Soong migrations for the ones that use inherit-package. Bug: 122957760 Test: Manual build tests with Browser2, BrowserGoogle, and Chrome Change-Id: Ia685511391f61fe143774e12b3b67b526049962a --- core/product.mk | 2 ++ core/product_config.mk | 23 +++++++++++++---------- core/soong_config.mk | 2 ++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/core/product.mk b/core/product.mk index c3cbb0c78..b934adf49 100644 --- a/core/product.mk +++ b/core/product.mk @@ -216,6 +216,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 \ diff --git a/core/product_config.mk b/core/product_config.mk index 1f44692ec..38e83a402 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -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 :))) - .KATI_READONLY := PRODUCT_DEFAULT_PROPERTY_OVERRIDES # A list of property assignments, like "key = value", with zero or more @@ -567,12 +563,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 : pairs to override the manifest package name -# of a module to . 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 :))) +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 diff --git a/core/soong_config.mk b/core/soong_config.mk index cd8cd7f09..16c6a8688 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -150,6 +150,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))