繁体   English   中英

在 android 源代码中构建特定模块

[英]Building a particular module in the android source code

我正在处理从 source.android.com 下载的 android 源代码。

完整构建后,我浏览了这个网站http://elinux.org/Android_Build_System ,它解释了 android 构建系统。

当我更改外部/webkit 代码并使用

make -j4 libwebcore它编译相应的文件并更新libwebcore.so,它为我节省了很多时间。 同样的事情适用于应用程序,也适用于构建 apk。

当我在框架中进行更改并将命令作为make -j4 framework它不编译相应的文件时,就会出现问题。 谁能帮我!

文件夹frameworks包含很多东西,你必须更具体地告诉 make 要构建什么。

例如,我在: frameworks/base/cmds/input/src/com/android/commands/input/Input.java 现在对应的Android.mk文件位于: frameworks/base/cmds/input/Android.mk ,其中包含一行说: LOCAL_MODULE := input

因此,从源代码构建的模块称为input ,所以我调用:

$ make input

哪个重建该特定模块。

作为奖励信息,您可以使用mmm帮助程序,您可以指定要构建的模块的路径,如下所示:

$ mmm frameworks/base/cmds/input

或者使用mm只是在您当前的工作目录中构建模块:

$ cd frameworks/base/cmds/input
$ mm

我通常使用mmm作为我的首选工具。


更新

哦,我看到您可能专门讨论称为framework的模块

我只是试图修改: frameworks/base/core/java/android/app/Dialog.java ,并做一个: make framework

这似乎重新编译框架就好了。 在运行make framework之前,您究竟在哪个文件中进行更改?


回应你的评论

我只是试图修改frameworks/base/core/java/android/webkit/WebView.java mmm frameworks/base以及make framework对我来说非常好。

如果它对您不起作用,您能否使用有关您正在构建的 android 版本、您正在输入的命令以及您看到的输出的附加信息来更新您的问题?

以下是对mmmmm和其他由build/envsetup.sh文件提供的便捷功能的更完整描述:

调用. build/envsetup.sh 从 shell . build/envsetup.sh将以下函数添加到您的环境中:

   lunch:   lunch <product_name>-<build_variant>
   tapas:   tapas [<App1> <App2> ...] [arm|x86|mips|armv5] [eng|userdebug|user]
   croot:   Changes directory to the top of the tree.
   m:       Makes from the top of the tree.
   mm:      Builds all of the modules in the current directory, but not their dependencies.
   mmm:     Builds all of the modules in the supplied directories, but not their dependencies.
            To limit the modules being built use the syntax: mmm dir/:target1,target2.
   mma:     Builds all of the modules in the current directory, and their dependencies.
   mmma:    Builds all of the modules in the supplied directories, and their dependencies.
   cgrep:   Greps on all local C/C++ files.
   jgrep:   Greps on all local Java files.
   resgrep: Greps on all local res/*.xml files.
   godir:   Go to the directory containing a file.

请检查build/envsetup.sh文件的注释以查看完整的函数列表。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM