summaryrefslogtreecommitdiff
path: root/api/api.go
diff options
context:
space:
mode:
author Anton Hansson <hansson@google.com> 2022-06-23 07:58:51 +0000
committer Anton Hansson <hansson@google.com> 2022-06-23 08:04:55 +0000
commit0c5d9ab5982a06c291be53f100335f479fbc2eb2 (patch)
tree79d64b6ee52a2bfc83686f991252610990c3fe5b /api/api.go
parent85563e7a227c170410f1f00b98372b0789ac8739 (diff)
Refactor merged annotations creation
It's clearer to define the module in Android.bp, and keep our custom Go code to the minimal. The only thing the go code really needs to do is create a "all module annotations" module. This matches the pattern of the other modules here (the pattern was invented after sdk-annotations.zip was first migrated). Bug: 235140934 Test: m sdk-annotations.zip before/after (no diffs) Change-Id: Iae246081bcf4e5177d1da98c2e01c702fb349a22
Diffstat (limited to 'api/api.go')
-rw-r--r--api/api.go18
1 files changed, 6 insertions, 12 deletions
diff --git a/api/api.go b/api/api.go
index 93f1354ce9e4..22120001af35 100644
--- a/api/api.go
+++ b/api/api.go
@@ -148,17 +148,11 @@ func createMergedStubsSrcjar(ctx android.LoadHookContext, modules []string) {
ctx.CreateModule(genrule.GenRuleFactory, &props)
}
-// This produces the same annotations.zip as framework-doc-stubs, but by using
-// outputs from individual modules instead of all the source code.
-func createMergedAnnotations(ctx android.LoadHookContext, modules []string) {
- props := genruleProps{}
- props.Name = proptools.StringPtr("sdk-annotations.zip")
- props.Tools = []string{"merge_annotation_zips", "soong_zip"}
- props.Out = []string{"annotations.zip"}
- props.Cmd = proptools.StringPtr("$(location merge_annotation_zips) $(genDir)/out $(in) && " +
- "$(location soong_zip) -o $(out) -C $(genDir)/out -D $(genDir)/out")
- props.Srcs = append([]string{":android-non-updatable-doc-stubs{.annotations.zip}"}, createSrcs(modules, "{.public.annotations.zip}")...)
- ctx.CreateModule(genrule.GenRuleFactory, &props)
+func createMergedPublicAnnotationsFilegroup(ctx android.LoadHookContext, modules []string) {
+ props := fgProps{}
+ props.Name = proptools.StringPtr("all-modules-public-annotations")
+ props.Srcs = createSrcs(modules, "{.public.annotations.zip}")
+ ctx.CreateModule(android.FileGroupFactory, &props)
}
func createFilteredApiVersions(ctx android.LoadHookContext, modules []string) {
@@ -299,7 +293,7 @@ func (a *CombinedApis) createInternalModules(ctx android.LoadHookContext) {
createMergedFrameworkModuleLibStubs(ctx, bootclasspath)
createMergedFrameworkImpl(ctx, bootclasspath)
- createMergedAnnotations(ctx, bootclasspath)
+ createMergedPublicAnnotationsFilegroup(ctx, bootclasspath)
createFilteredApiVersions(ctx, bootclasspath)