最近要修改Android平台的一个模块,要求debug、eng版本上编译进去,user版本不编译进去。
网上查的资料大多是使用LOCAL_MODULE_TAGS
来控制。
但很奇怪的是 这个的值貌似只有 user eng test optional 这四种。
在Android 源码钟搜索时也没发现其针对userdebug版本的配置。
最后在 android change 中找到了解决方法:
LOCAL_MODULE_TAGS := eng debug
are obsolete {#LOCAL_MODULE_TAGS}
LOCAL_MODULE_TAGS
valueeng
anddebug
are now obsolete. They allowed modules to specify that they should always be installed on-eng
, or-eng
and-userdebug
builds. This conflicted with the ability for products to specify which modules should be installed, effectively making it impossible to build a stripped down product configuration that did not include those modules.For the equivalent functionality, specify the modules in
PRODUCT_PACKAGES_ENG
orPRODUCT_PACKAGES_DEBUG
in the appropriate product makefiles.Core android packages like
su
got added to the list inbuild/make/target/product/base_system.mk
, but for device-specific modules there are often better base product makefiles to use instead.
大致意思就是说LOCAL_MODULE_TAGS
已经过时了,要用PRODUCT_PACKAGES_ENG
or PRODUCT_PACKAGES_DEBUG替代,然后su 等特殊模块在 build/make/target/product/base_system.mk 中配置。