如何在不构建所有Android的情况下构建AOSP应用程序?

时间:2017-05-08 16:57:15

标签: android build android-source

我已同步整个Android repo,并根据此处的说明设置构建环境: https://source.android.com/source/building

构建说明似乎假设您要构建整个Android平台。我真的很有兴趣建立一个特定的AOSP应用程序,如联系人,短信,相机等。我在GitHub上看过股票应用程序代码的镜像,但似乎没有任何构建指令,例如:

https://github.com/android/platform_packages_apps_contacts https://github.com/android/platform_packages_apps_calendar

是否有这样做的构建指南?我是不是下载,修改,构建这个巨大的(100 + GB)代码集?

2 个答案:

答案 0 :(得分:3)

就像你有' mm '来构建某个目标一样,你也可以使用' mma '来构建具有依赖关系的目标。例如:

$ mma Settings -j16

这将扫描项目以获取Settings应用程序的依赖项,然后在开始构建Settings应用程序之前首先构建依赖项。

答案 1 :(得分:0)

这里是编译和基于模块的编译命令:

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.

您可以在此处查看其他和更多构建命令:https://source.android.com/setup/build/building 在这里:https://elinux.org/Android_Build_System 并检查“build/envsetup.sh”文件的注释以查看完整列表。