【问题标题】:Building a particular module in the android source code在 android 源代码中构建特定模块
【发布时间】:2012-10-30 12:52:27
【问题描述】:

我正在研究从 source.android.com 下载的 android 源代码。

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

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

构建它时

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

当我在框架中进行更改并将命令作为 make -j4 framework 它没有编译相应的文件。 谁能帮帮我!

【问题讨论】:

    标签: android android-source


    【解决方案1】:

    文件夹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.javammm frameworks/basemake framework 非常适合我。

    如果它不适合您,您能否更新您的问题,提供有关您正在构建的 android 版本、您正在准确输入的命令以及您看到的输出的更多信息?

    【讨论】:

    • 我想构建 frameworks/base/core/java/android/webkit/WebView.java 并且我只看到了 3 个我认为与指定类 1) frameworks/base/core/ 相关的 .mk 文件java/res/Android.mk 2) frameworks/base/core/java/jni/Android.mk 3) frameworks/base/Android.mk 在 3) 文件中我看到了 LOCAL_MODEULE := framework 我应该使用命令 make - j4 框架
    • @BjarkeFreund-Hansen TARGET_DEVICE foo 没有私有恢复资源
    【解决方案2】:

    以下是对mmmmm 和其他通过获取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 文件的 cmets 以查看完整的函数列表。

    【讨论】:

      猜你喜欢
      • 2023-03-04
      • 1970-01-01
      • 1970-01-01
      • 2016-01-09
      • 1970-01-01
      • 1970-01-01
      • 2015-12-23
      • 1970-01-01
      • 2012-05-14
      相关资源
      最近更新 更多