From 74b1564144429c4cb0303a0974a5f57b8a917ef4 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Thu, 23 Jun 2022 08:27:23 +0000 Subject: Add a system variant of the merged annotations This is going to be disted instead of the monolithic one being used currently. Bug: 235140934 Test: m sdk-annotations{,-system}.zip and diff; manual spot checking Test: m sdk dist && diff out/dist/system-data/annotations.zip with this Change-Id: I9874f88e933a8b804a73638e6bac7a9d312c7c9f --- api/Android.bp | 26 ++++++++++++++++++++------ api/api.go | 8 ++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) (limited to 'api') diff --git a/api/Android.bp b/api/Android.bp index 9a14ee6e47fc..3fc3991a9e9a 100644 --- a/api/Android.bp +++ b/api/Android.bp @@ -190,12 +190,8 @@ genrule { // This produces the same annotations.zip as framework-doc-stubs, but by using // outputs from individual modules instead of all the source code. -genrule { - name: "sdk-annotations.zip", - srcs: [ - ":android-non-updatable-doc-stubs{.annotations.zip}", - ":all-modules-public-annotations", - ], +genrule_defaults { + name: "sdk-annotations-defaults", out: ["annotations.zip"], tools: [ "merge_annotation_zips", @@ -205,6 +201,24 @@ genrule { "$(location soong_zip) -o $(out) -C $(genDir)/out -D $(genDir)/out", } +genrule { + name: "sdk-annotations.zip", + defaults: ["sdk-annotations-defaults"], + srcs: [ + ":android-non-updatable-doc-stubs{.annotations.zip}", + ":all-modules-public-annotations", + ], +} + +genrule { + name: "sdk-annotations-system.zip", + defaults: ["sdk-annotations-defaults"], + srcs: [ + ":android-non-updatable-doc-stubs-system{.annotations.zip}", + ":all-modules-system-annotations", + ], +} + genrule { name: "combined-removed-dex", visibility: [ diff --git a/api/api.go b/api/api.go index 22120001af35..bf6b0859ea7f 100644 --- a/api/api.go +++ b/api/api.go @@ -155,6 +155,13 @@ func createMergedPublicAnnotationsFilegroup(ctx android.LoadHookContext, modules ctx.CreateModule(android.FileGroupFactory, &props) } +func createMergedSystemAnnotationsFilegroup(ctx android.LoadHookContext, modules []string) { + props := fgProps{} + props.Name = proptools.StringPtr("all-modules-system-annotations") + props.Srcs = createSrcs(modules, "{.system.annotations.zip}") + ctx.CreateModule(android.FileGroupFactory, &props) +} + func createFilteredApiVersions(ctx android.LoadHookContext, modules []string) { // For the filtered api versions, we prune all APIs except art module's APIs. because // 1) ART apis are available by default to all modules, while other module-to-module deps are @@ -294,6 +301,7 @@ func (a *CombinedApis) createInternalModules(ctx android.LoadHookContext) { createMergedFrameworkImpl(ctx, bootclasspath) createMergedPublicAnnotationsFilegroup(ctx, bootclasspath) + createMergedSystemAnnotationsFilegroup(ctx, bootclasspath) createFilteredApiVersions(ctx, bootclasspath) -- cgit v1.2.3-59-g8ed1b