Android编译PRODUCT_COPY_FILES如果碰到重复的项目如何取值

在Android编译过程中,面对PRODUCT_COPY_FILES列表中的src:dest重复项,首次出现的定义会被保留。当dest相同而src不同的情况下,如system/etc/apns-conf.xml在两个位置定义,device/lge/mako/apns-full-conf.xml会生效。解决重复的关键在于对列表进行去重操作。
摘要由CSDN通过智能技术生成

Android编译脚本中,PRODUCT_COPY_FILES保存的是一组src:dest的字符串列表,如果碰到里面有重复的dest怎么办?


参见/build/core/Makefile中关于其处理:
# filter out the duplicate <source file>:<dest file> pairs.
unique_product_copy_files_pairs :=
$(foreach cf,$(PRODUCT_COPY_FILES), \
    $(if $(filter $(unique_product_copy_files_pairs),$(cf)),,\
        $(eval unique_product_copy_files_pairs += $(cf))))

unique_product_copy_files_destinations :=
$(foreach cf,$(unique_product_copy_files_pairs), \
    $(eval _src := $(call word-colon,1,$(cf))) \
    $(eval _dest := $(call word-colon,2,$(cf))) \
    $(call check-product-copy-files,$(cf)) \
    $(if $(filter $(unique_product_copy_files_destinations),$(_dest)), \
        $(info PRODUCT_COPY_FILES $(cf) ignored.), \
        $(eval _fulldest := $(call append-path,$(PRODUCT_OUT),$(_dest))) \
        $(if $(fi
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值