summaryrefslogtreecommitdiffstats
path: root/core/tasks
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2014-05-19 13:03:36 -0700
committerYing Wang <wangying@google.com>2014-05-19 13:03:36 -0700
commit3380d3a1ae64667f130273a78a42b81c7296b595 (patch)
tree8b03b70f60d51ef08e6787e3d92fc88bebd70153 /core/tasks
parent9b9b98376a60f080f56a72f564dd83a890f2663c (diff)
downloadbuild-3380d3a1ae64667f130273a78a42b81c7296b595.zip
build-3380d3a1ae64667f130273a78a42b81c7296b595.tar.gz
build-3380d3a1ae64667f130273a78a42b81c7296b595.tar.bz2
Explicit record the modules' built-file:installed-file
- This simplifies the logic to get the mapping of built-file to installed-file. Previously we used file suffix matching which is error prone and not scalable. - With this change the .odex files will be included automatically. Bug: 13585955 Change-Id: I4599abf93b9d501bac7aca7758d7f3aee21b3e36
Diffstat (limited to 'core/tasks')
-rw-r--r--core/tasks/tools/package-modules.mk26
1 files changed, 11 insertions, 15 deletions
diff --git a/core/tasks/tools/package-modules.mk b/core/tasks/tools/package-modules.mk
index 890d26a..83d5984 100644
--- a/core/tasks/tools/package-modules.mk
+++ b/core/tasks/tools/package-modules.mk
@@ -14,27 +14,23 @@ my_built_modules :=
my_copy_pairs :=
my_pickup_files :=
-# Search for modules' built files and installed files;
+# Iterate over modules' built files and installed files;
# Calculate the dest files in the output zip file.
-# If for 1 module name we found multiple installed files,
-# we use suffix matching to find the corresponding built file.
+
$(foreach m,$(my_modules),\
- $(if $(ALL_MODULES.$(m).INSTALLED),,\
+ $(if $(ALL_MODULES.$(m).BUILT_INSTALLED),,\
$(warning Unknown installed file for module '$(m)'))\
$(eval my_pickup_files += $(ALL_MODULES.$(m).PICKUP_FILES))\
- $(foreach i,$(filter $(TARGET_OUT_ROOT)/%,$(ALL_MODULES.$(m).INSTALLED)),\
- $(eval my_suffix := $(suffix $(i))) \
- $(if $(my_suffix),\
- $(eval my_patt := $(TARGET_OUT_ROOT)/%$(my_suffix)),\
- $(eval my_patt := $(TARGET_OUT_ROOT)/%$(notdir $(i))))\
- $(eval b := $(filter $(my_patt),$(ALL_MODULES.$(m).BUILT)))\
- $(if $(filter 1,$(words $(b))),\
- $(eval my_built_modules += $(b))\
+ $(foreach i, $(ALL_MODULES.$(m).BUILT_INSTALLED),\
+ $(eval bui_ins := $(subst :,$(space),$(i)))\
+ $(eval ins := $(word 2,$(bui_ins)))\
+ $(if $(filter $(TARGET_OUT_ROOT)/%,$(ins)),\
+ $(eval bui := $(word 1,$(bui_ins)))\
+ $(eval my_built_modules += $(bui))\
$(eval my_copy_dest := $(patsubst data/%,DATA/%,\
$(patsubst system/%,DATA/%,\
- $(patsubst $(PRODUCT_OUT)/%,%,$(i)))))\
- $(eval my_copy_pairs += $(b):$(my_staging_dir)/$(my_copy_dest)),\
- $(warning Unexpected module built file '$(b)' for module '$(m)'))\
+ $(patsubst $(PRODUCT_OUT)/%,%,$(ins)))))\
+ $(eval my_copy_pairs += $(bui):$(my_staging_dir)/$(my_copy_dest)))\
))
my_package_zip := $(my_staging_dir)/$(my_package_name).zip