LOCAL_MODULE_TAGS 的作用是什么?

28

我想更新一个包中的Android.mk文件以构建新包,但我不理解LOCAL_MODULE_TAGS的目的是什么。

LOCAL_MODULE_TAGS有什么作用?


将其设置为samples而不是optional,对我来说导致它包括了so库。 - zeitgeist
1个回答

34




更正:
不再建议使用用户标签。
相反,

Add "LOCAL_MODULE_TAGS := optional"
Then add "LOCAL_MODULE" value to PRODUCT_PACKAGES section of product makefile.

原始帖子:

LOCAL_MODULE_TAGS定义了此模块应安装在哪个构建类型中。
如果您要将模块安装在所有(user、userdebug、eng)构建中,只需提供"user"标记。

您可以在此处找到完整的文档。

eng     This is the default flavor. A plain make is the same as make eng.

* Installs modules tagged with: eng, debug, user, and/or development.
* Installs non-APK modules that have no tags specified.
* Installs APKs according to the product definition files, in addition to tagged APKs.
* ro.secure=0
* ro.debuggable=1
* ro.kernel.android.checkjni=1
* adb is enabled by default. 

user    make user

This is the flavor intended to be the final release bits.

* Installs modules tagged with user.
* Installs non-APK modules that have no tags specified.
* Installs APKs according to the product definition files; tags are ignored for APK modules.
* ro.secure=1
* ro.debuggable=0
* adb is disabled by default.

userdebug   make userdebug

The same as user, except:

* Also installs modules tagged with debug.
* ro.debuggable=1
* adb is enabled by default. 

1
如果用户标签不再推荐使用,我们如何标记一个模块仅在英文版本中出现。 - Fakebear
1
我的理解是,“eng”标签将导致模块出现在eng构建中。“userdebug”标签将导致它出现在用户调试构建中,“optional”标签将导致它出现在用户构建中,但前提是该模块在vendor/<company>/proprietary/common/<product>/device-vendor.mk中定义的PRODUCT_PACKAGES列表中。 - Edward Falk
2
如果您完全不想构建该模块,请将LOCAL_MODULE_TAGS完全删除。 - Edward Falk
如果您不使用 LOCAL_MODULE_TAGS,它默认设置为 optional,并且只有在 PRODUCT_PACKAGES 中声明了模块才会安装该模块。 - Fredrick Gauss

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接