Enforce no prebuilt apks in PRODUCT_COPY_FILES.

Bug: 5391935
Change-Id: I106ffc3277914e57cc1a6fb4cd782286d61b8013
This commit is contained in:
Ying Wang 2011-09-29 13:23:25 -07:00
parent d645ddc0ae
commit 6886410210
1 changed files with 6 additions and 0 deletions

View File

@ -16,10 +16,16 @@ endif
# e.g., "system/etc/file.xml". # e.g., "system/etc/file.xml".
# The filter part means "only eval the copy-one-file rule if this # The filter part means "only eval the copy-one-file rule if this
# src:dest pair is the first one to match the same dest" # src:dest pair is the first one to match the same dest"
#$(1): the src:dest pair
define check-product-copy-files
$(if $(filter %.apk, $(1)),$(error \
Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!))
endef
unique_product_copy_files_destinations := unique_product_copy_files_destinations :=
$(foreach cf,$(PRODUCT_COPY_FILES), \ $(foreach cf,$(PRODUCT_COPY_FILES), \
$(eval _src := $(call word-colon,1,$(cf))) \ $(eval _src := $(call word-colon,1,$(cf))) \
$(eval _dest := $(call word-colon,2,$(cf))) \ $(eval _dest := $(call word-colon,2,$(cf))) \
$(call check-product-copy-files,$(cf)) \
$(if $(filter $(unique_product_copy_files_destinations),$(_dest)),, \ $(if $(filter $(unique_product_copy_files_destinations),$(_dest)),, \
$(eval _fulldest := $(call append-path,$(PRODUCT_OUT),$(_dest))) \ $(eval _fulldest := $(call append-path,$(PRODUCT_OUT),$(_dest))) \
$(eval $(call copy-one-file,$(_src),$(_fulldest))) \ $(eval $(call copy-one-file,$(_src),$(_fulldest))) \