How to do an android mm clean?

懵懂的女人 提交于 2019-11-30 11:24:40

问题


I'm building custom module in Android source using the mm command.

When I run mm clean, it seems that the whole project is cleaned.

How can I restrict the clean to just the current module?


回答1:


Use mm -B, it will rebuild all, equivalent to clean and then make.




回答2:


Another way to do without mm is to give make clean-<target name> from root of Android source.

Similarly you can build the required module alone with make <target name>




回答3:


make <lib> 2>&1 | grep -e "install"

This will make the and print all the libs that were re-compiled.




回答4:


On older make-based AOSP build system, use

mm -B

to rebuild the module.

On newer Ninja+Soong based AOSP build systems, it seems that -B no longer works. It gives the error Unknown option: -B.

One possible alternative is to use the NINJA_ARGS environment variable to pass additional Ninja arguments to underlying build engine.

For example, the following command removes all output and intermediate files:

NINJA_ARGS="-t clean" mm

In this case clean is an extra tool to the Ninja build system. See https://ninja-build.org/manual.html#_extra_tools for other tools.

One thing to notice is that the clean tool seems to clear all the dependencies of the module, instead of the module itself. I haven't found a way to assign a rule to limit the clean scope to the module only.

references: https://android.googlesource.com/platform/build/soong/+/HEAD/docs/best_practices.md



来源:https://stackoverflow.com/questions/19074431/how-to-do-an-android-mm-clean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!