From d7d0afcaea24b0fb0cb37dca921a5ff52fd2485b Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Tue, 5 Jun 2012 15:54:09 -0700 Subject: [PATCH] Add the ability in a product spec file to have modules installed for specific variants. Change-Id: Ifa5eb2e15b3d3e5007378ec00efc4aec3e9a3b99 --- core/main.mk | 27 +++++++++++++++++++++++---- core/product.mk | 3 +++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/core/main.mk b/core/main.mk index a9e50e43a0..2af68eabf6 100644 --- a/core/main.mk +++ b/core/main.mk @@ -635,9 +635,18 @@ endif user_MODULES := $(sort $(call get-tagged-modules,user shell_$(TARGET_SHELL))) user_MODULES := $(user_MODULES) $(user_PACKAGES) -eng_MODULES := $(sort $(call get-tagged-modules,eng)) -debug_MODULES := $(sort $(call get-tagged-modules,debug)) -tests_MODULES := $(sort $(call get-tagged-modules,tests)) +eng_MODULES := $(sort \ + $(call get-tagged-modules,eng) \ + $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_ENG)) \ + ) +debug_MODULES := $(sort \ + $(call get-tagged-modules,debug) \ + $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG)) \ + ) +tests_MODULES := $(sort \ + $(call get-tagged-modules,tests) \ + $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS)) \ + ) ifeq ($(strip $(tags_to_install)),) $(error ASSERTION FAILED: tags_to_install should not be empty) @@ -671,10 +680,20 @@ ifdef is_sdk_build modules_to_install := \ $(filter-out $(target_gnu_MODULES),$(modules_to_install)) - # Ensure every module listed in PRODUCT_PACKAGES gets something installed + # Ensure every module listed in PRODUCT_PACKAGES* gets something installed + # TODO: Should we do this for all builds and not just the sdk? $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \ $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ $(error Module '$(m)' in PRODUCT_PACKAGES has nothing to install!))) + $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG), \ + $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ + $(error Module '$(m)' in PRODUCT_PACKAGES_DEBUG has nothing to install!))) + $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_ENG), \ + $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ + $(error Module '$(m)' in PRODUCT_PACKAGES_ENG has nothing to install!))) + $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS), \ + $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ + $(error Module '$(m)' in PRODUCT_PACKAGES_TESTS has nothing to install!))) endif diff --git a/core/product.mk b/core/product.mk index 283b6efe39..5d421de6d9 100644 --- a/core/product.mk +++ b/core/product.mk @@ -66,6 +66,9 @@ _product_var_list := \ PRODUCT_AAPT_CONFIG \ PRODUCT_AAPT_PREF_CONFIG \ PRODUCT_PACKAGES \ + PRODUCT_PACKAGES_DEBUG \ + PRODUCT_PACKAGES_ENG \ + PRODUCT_PACKAGES_TESTS \ PRODUCT_DEVICE \ PRODUCT_MANUFACTURER \ PRODUCT_BRAND \