在 android 源代码中构建特定模块 [英] Building a particular module in the android source code
问题描述
我正在编写从 source.android.com 下载的 android 源代码.
I am working on an android source code which I have downloaded from source.android.com.
完整构建后,我浏览了这个网站 http://elinux.org/Android_Build_System,它解释了 android构建系统.
After a full build I went through this site http://elinux.org/Android_Build_System which explains the android build system.
当我更改外部/webkit 代码并使用
When I make changes in external/webkit code and build it with
make -j4 libwebcore
它编译相应的文件并更新libwebcore.so,它为我节省了很多时间.同样的事情适用于应用程序,也适用于构建 apk.
make -j4 libwebcore
it compiles the corresponding file and updates the libwebcore.so, and it save me a lot of time.
The same thing is applied to applications and also for building apks.
当我在框架中进行更改并给出命令时出现问题make -j4 framework
没有编译相应的文件.谁能帮帮我!
The problem arises when I make changes in the framework and give the command as
make -j4 framework
its not compiling the corresponding files.
Can any one help me!
推荐答案
文件夹frameworks
包含很多东西,你必须更具体地告诉make要构建什么.
The folder frameworks
contains many things, you have to be more specific about telling make what to build.
例如我在以下方面进行了更改:frameworks/base/cmds/input/src/com/android/commands/input/Input.java
.现在对应的 Android.mk
文件位于:frameworks/base/cmds/input/Android.mk
,其中包含一行内容:LOCAL_MODULE := input
.
For example I made a change in:
frameworks/base/cmds/input/src/com/android/commands/input/Input.java
.
Now the corresponding Android.mk
file is located in:
frameworks/base/cmds/input/Android.mk
, which contains a line saying: LOCAL_MODULE := input
.
因此从源代码构建的模块称为input
,所以我调用:
Thus the module being build from the source is called input
, so I call:
$ make input
重建该特定模块.
作为奖励信息,您可以使用 mmm
帮助程序,您可以指定要构建的模块的路径,如下所示:
As a bonus info, you can use the mmm
helper and you can specify the path of the module to build like this:
$ mmm frameworks/base/cmds/input
或使用 mm
只是在您当前的工作目录中构建模块:
or using mm
which just builds the module in you current working directory:
$ cd frameworks/base/cmds/input
$ mm
我通常使用 mmm
作为我的首选工具.
I normally use mmm
as my preferred tool.
更新
哦,我看到您可能在专门讨论名为 framework
Oh, I see you might be talking specifically about the module called framework
我只是尝试修改:frameworks/base/core/java/android/app/Dialog.java
,然后做一个:make framework
.
I just tried to modify: frameworks/base/core/java/android/app/Dialog.java
, and do a: make framework
.
这似乎重新编译框架就好了.在运行 make framework
之前,您究竟是在哪个文件中进行更改?
This seems to recompile the framework just fine. Which file exactly are you making changes in before running make framework
?
回应您的评论
我只是试图修改frameworks/base/core/java/android/webkit/WebView.java
.mmm frameworks/base
以及 make framework
非常适合我.
I just tried to modify frameworks/base/core/java/android/webkit/WebView.java
. mmm frameworks/base
as well as make framework
works perfectly fine for me.
如果它对您不起作用,您能否使用有关您正在构建的 Android 版本、您正在准确输入哪些命令以及您看到的输出的附加信息更新您的问题?
If it does not work for you, can you update your question with additional information about which android version you are building, which commands you are typing exactly, and the output your are seeing?
这篇关于在 android 源代码中构建特定模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!