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

How to build AOSP app without building all of Android?

我已经同步了整个 Android 存储库,并按照此处的说明设置构建环境: 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) 代码集?

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

$ mma Settings -j16

这将扫描项目以查找设置应用程序的依赖项,然后在开始构建设置应用程序之前先构建依赖项。

编译和基于模块的编译命令如下:

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”文件的注释以查看完整列表。