OSDN Git Service

Add the ability in a product spec file to have modules installed for specific variants.
authorJoe Onorato <joeo@google.com>
Tue, 5 Jun 2012 22:54:09 +0000 (15:54 -0700)
committerJoe Onorato <joeo@google.com>
Tue, 5 Jun 2012 22:57:07 +0000 (15:57 -0700)
Change-Id: Ifa5eb2e15b3d3e5007378ec00efc4aec3e9a3b99

core/main.mk
core/product.mk

index a9e50e4..2af68ea 100644 (file)
@@ -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
 
 
index 283b6ef..5d421de 100644 (file)
@@ -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 \