platform/frameworks/base是如何构建的? AOSP源码

How is platform/frameworks/base built? AOSP source

我正在查看 platform/frameworks/base。看起来很多东西来自 Android 的核心。主要在Java:https://github.com/GrapheneOS/platform_frameworks_base/blob/11/Android.mk

当我们查看其 Android.mk 文件时,最有趣的部分是:

$(SDK_METADATA): $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/framework-doc-stubs-metadata.zip
    rm -rf $(SDK_METADATA_DIR)
    mkdir -p $(SDK_METADATA_DIR)
    unzip -qo $< -d $(SDK_METADATA_DIR)

我正在尝试了解如何从该存储库构建以及构建了什么。很明显,此 makefile 中没有构建任何内容,主要是因为 java 代码是从 ART 构建的。那么,发生了什么事?

它看起来像是从这个文件中解压缩文件:SDK_METADATA_DIR :=$= $(call intermediates-dir-for,PACKAGING,framework-doc-stubs-metadata,,COMMON),但随后它什么也没做。

这个 repo 最终是如何构建的?

更有趣的目标在 Android.bp 文件中定义。

从该存储库构建了多个目标,因此请查看名称以“framework”开头的 java_library 目标,以及对 framework 目标的评论以查找内容你需要。

// This "framework" module is NOT installed to the device. It's
// "framework-minus-apex" that gets installed to the device. Note that
// the filename is still framework.jar (via the stem property) for
// compatibility reason. The purpose of this module is to provide
// framework APIs (both public and private) for bundled apps.
// "framework-minus-apex" can't be used for the purpose because 1)
// many apps have already hardcoded the name "framework" and
// 2) it lacks API symbols from updatable modules - as it's clear from
// its suffix "-minus-apex".