am 3ceecfa3: Check the well-formedness of an xml file before copying.

* commit '3ceecfa3daeb187c0631a84e6ee6b4dd89f111f8':
  Check the well-formedness of an xml file before copying.
This commit is contained in:
Ying Wang
2012-05-14 19:34:26 -07:00
committed by Android Git Automerger
2 changed files with 13 additions and 1 deletions

View File

@@ -31,7 +31,9 @@ $(foreach cf,$(PRODUCT_COPY_FILES), \
$(if $(filter $(unique_product_copy_files_destinations),$(_dest)), \
$(info PRODUCT_COPY_FILES $(cf) ignored.), \
$(eval _fulldest := $(call append-path,$(PRODUCT_OUT),$(_dest))) \
$(eval $(call copy-one-file,$(_src),$(_fulldest))) \
$(if $(filter %.xml,$(_dest)),\
$(eval $(call copy-xml-file-checked,$(_src),$(_fulldest))),\
$(eval $(call copy-one-file,$(_src),$(_fulldest)))) \
$(eval ALL_DEFAULT_INSTALLED_MODULES += $(_fulldest)) \
$(eval unique_product_copy_files_destinations += $(_dest))))
unique_product_copy_files_destinations :=

View File

@@ -1707,6 +1707,16 @@ $(2): $(1) | $(ACP)
$$(copy-file-to-target)
endef
# Copy the file only if it's a well-formed xml file. For use via $(eval).
# $(1): source file
# $(2): destination file, must end with .xml.
define copy-xml-file-checked
$(2): $(1) | $(ACP)
@echo "Copy xml: $$@"
$(hide) xmllint $$< >/dev/null # Don't print the xml file to stdout.
$$(copy-file-to-target)
endef
# The -t option to acp and the -p option to cp is
# required for OSX. OSX has a ridiculous restriction
# where it's an error for a .a file's modification time