Uniq the system properties.
If multiple items with the same key appear in a config variable, only the first item is taken. Change-Id: Icf57befafb36ec35dd4d48c8c3ec595f353f68e7
This commit is contained in:
@@ -16,17 +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"
|
||||||
unique_product_copy_files_destinations := $(sort \
|
unique_product_copy_files_destinations :=
|
||||||
$(foreach cf,$(PRODUCT_COPY_FILES), $(call word-colon,2,$(cf))))
|
|
||||||
$(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))) \
|
||||||
$(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))) \
|
||||||
$(eval ALL_DEFAULT_INSTALLED_MODULES += $(_fulldest)) \
|
$(eval ALL_DEFAULT_INSTALLED_MODULES += $(_fulldest)) \
|
||||||
$(eval unique_product_copy_files_destinations := $(filter-out $(_dest), \
|
$(eval unique_product_copy_files_destinations += $(_dest))))
|
||||||
$(unique_product_copy_files_destinations)))))
|
unique_product_copy_files_destinations :=
|
||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
# docs/index.html
|
# docs/index.html
|
||||||
@@ -44,6 +43,8 @@ ADDITIONAL_DEFAULT_PROPERTIES := \
|
|||||||
$(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES))
|
$(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES))
|
||||||
ADDITIONAL_DEFAULT_PROPERTIES += \
|
ADDITIONAL_DEFAULT_PROPERTIES += \
|
||||||
$(call collapse-pairs, $(PRODUCT_DEFAULT_PROPERTY_OVERRIDES))
|
$(call collapse-pairs, $(PRODUCT_DEFAULT_PROPERTY_OVERRIDES))
|
||||||
|
ADDITIONAL_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \
|
||||||
|
$(ADDITIONAL_DEFAULT_PROPERTIES),=)
|
||||||
|
|
||||||
$(INSTALLED_DEFAULT_PROP_TARGET):
|
$(INSTALLED_DEFAULT_PROP_TARGET):
|
||||||
@echo Target buildinfo: $@
|
@echo Target buildinfo: $@
|
||||||
@@ -61,6 +62,8 @@ INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
|
|||||||
ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_BUILD_PROP_TARGET)
|
ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_BUILD_PROP_TARGET)
|
||||||
ADDITIONAL_BUILD_PROPERTIES := \
|
ADDITIONAL_BUILD_PROPERTIES := \
|
||||||
$(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))
|
$(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))
|
||||||
|
ADDITIONAL_BUILD_PROPERTIES := $(call uniq-pairs-by-first-component, \
|
||||||
|
$(ADDITIONAL_BUILD_PROPERTIES),=)
|
||||||
|
|
||||||
# A list of arbitrary tags describing the build configuration.
|
# A list of arbitrary tags describing the build configuration.
|
||||||
# Force ":=" so we can use +=
|
# Force ":=" so we can use +=
|
||||||
|
@@ -599,6 +599,21 @@ $(subst $(space)$(_cpSEP)$(space),$(_cpSEP),$(strip \
|
|||||||
$(subst $(_cpSEP), $(_cpSEP) ,$(1))))
|
$(subst $(_cpSEP), $(_cpSEP) ,$(1))))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
## Given a list of pairs, if multiple pairs have the same
|
||||||
|
## first components, keep only the first pair.
|
||||||
|
##
|
||||||
|
## $(1): list of pairs
|
||||||
|
## $(2): the separator word, such as ":", "=", etc.
|
||||||
|
define uniq-pairs-by-first-component
|
||||||
|
$(eval _upbfc_fc_set :=)\
|
||||||
|
$(strip $(foreach w,$(1), $(eval _first := $(word 1,$(subst $(2),$(space),$(w))))\
|
||||||
|
$(if $(filter $(_upbfc_fc_set),$(_first)),,$(w)\
|
||||||
|
$(eval _upbfc_fc_set += $(_first)))))\
|
||||||
|
$(eval _upbfc_fc_set :=)\
|
||||||
|
$(eval _first:=)
|
||||||
|
endef
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
## MODULE_TAG set operations
|
## MODULE_TAG set operations
|
||||||
###########################################################
|
###########################################################
|
||||||
|
Reference in New Issue
Block a user