自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
构建概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
AOSP 使用 Soong 构建系统来构建 Android。它利用 kati GNU Make 克隆工具和 Ninja 构建系统组件来加速 Android 的构建。
Soong build 文件称为蓝图文件,并以 Android.bp
命名。这些文件在语法和语义上与 Bazel BUILD 文件类似。
如需详细了解 Android.bp
文件格式,请参阅 Android.bp 文件格式。
如需了解如何将 Make 文件转换为 Android.bp
文件,请参阅 Make 与 Soong 比较。
功能发布标志和 build 标志
功能发布标志是二进制标志,用于将未经测试的代码与已测试的代码隔离开来。如果您有自己的 AOSP 外部开发分支镜像,则可以使用这些标志来保持镜像代码的稳定性。此外,如果您打算向公开的外部开发分支贡献代码,更改审核人员可能会要求您为代码实现标志。
build 标志是构建时间常量(字符串),用于修改 build,例如可选择包含代码库。
如需了解不同的代码分支,请参阅版本生命周期。
功能发布标志和 build 标志需要更改 build 文件。如需详细了解这些标志(包括在 build 中使用这些标志),请参阅功能发布标志概览和相邻页面。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-26。"],[],[],null,["# Build overview\n\nAOSP uses the *Soong* build system to build Android. Soong leverages the\n[kati](https://github.com/google/kati/blob/master/README.md) GNU\nMake clone tool and [Ninja](https://ninja-build.org/) build system\ncomponent to speed up builds of Android.\n\nSoong build files are called *blueprint files* and are named `Android.bp`. These\nfiles are similar in syntax and\nsematics to [Bazel BUILD files](https://bazel.build/reference/be/overview).\n\nFor a detailed description of the `Android.bp` file format, see\n[Android.bp file format](/docs/setup/reference/androidbp).\n\nFor information on converting your Make files to `Android.bp` files, see\n[Make and Soong comparison](/docs/setup/build/make-to-soong).\n\nFeature launch flags and build flags\n------------------------------------\n\n*Feature launch flags* are binary flags used to isolate untested code from\ntested code. If you have your own mirror of the AOSP external development\nbranch, you can use these flags to keep your mirrored code stable. Additionally,\nif you intend on contributing code to the public external development branch,\nyou might be asked by your change's reviewer to implement a flag for your code.\n\n*Build flags* are build-time constants (strings) used to modify your build, such\nas optionally including a code library.\n\nFor an explanation of the different code branches, see\n[Release lifecycle](/docs/setup/contribute/release-lifecycle).\n\nFeature launch flags and build flags require changes to build files. For\nadditional information on these flags, including their use in a build, see\nthe [Feature launch flags overview](/docs/setup/build/feature-flagging) and\nadjacent pages."]]