Construct sdk-annotations.zip programmatically am: cc18e03e44
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952378 Change-Id: I5994601a51bd1ec68e0f11cc62fbd2455acd3c22
This commit is contained in:
36
ApiDocs.bp
36
ApiDocs.bp
@@ -182,42 +182,6 @@ droidstubs {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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}",
|
|
||||||
|
|
||||||
// Conscrypt and i18n currently do not enable annotations
|
|
||||||
// ":conscrypt.module.public.api{.public.annotations.zip}",
|
|
||||||
// ":i18n.module.public.api{.public.annotations.zip}",
|
|
||||||
|
|
||||||
// Modules that enable annotations below
|
|
||||||
":android.net.ipsec.ike{.public.annotations.zip}",
|
|
||||||
":art.module.public.api{.public.annotations.zip}",
|
|
||||||
":framework-appsearch{.public.annotations.zip}",
|
|
||||||
":framework-connectivity{.public.annotations.zip}",
|
|
||||||
":framework-graphics{.public.annotations.zip}",
|
|
||||||
":framework-media{.public.annotations.zip}",
|
|
||||||
":framework-mediaprovider{.public.annotations.zip}",
|
|
||||||
":framework-permission{.public.annotations.zip}",
|
|
||||||
":framework-permission-s{.public.annotations.zip}",
|
|
||||||
":framework-scheduling{.public.annotations.zip}",
|
|
||||||
":framework-sdkextensions{.public.annotations.zip}",
|
|
||||||
":framework-statsd{.public.annotations.zip}",
|
|
||||||
":framework-tethering{.public.annotations.zip}",
|
|
||||||
":framework-wifi{.public.annotations.zip}",
|
|
||||||
],
|
|
||||||
out: ["annotations.zip"],
|
|
||||||
tools: [
|
|
||||||
"merge_annotation_zips",
|
|
||||||
"soong_zip",
|
|
||||||
],
|
|
||||||
cmd: "$(location merge_annotation_zips) $(genDir)/out $(in) && " +
|
|
||||||
"$(location soong_zip) -o $(out) -C $(genDir)/out -D $(genDir)/out",
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
// API docs are created from the generated stub source files
|
// API docs are created from the generated stub source files
|
||||||
// using droiddoc
|
// using droiddoc
|
||||||
|
|||||||
19
api/api.go
19
api/api.go
@@ -123,6 +123,19 @@ func createMergedStubsSrcjar(ctx android.LoadHookContext, modules []string) {
|
|||||||
ctx.CreateModule(genrule.GenRuleFactory, &props)
|
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 = createSrcs(":android-non-updatable-doc-stubs{.annotations.zip}", modules, "{.public.annotations.zip}")
|
||||||
|
ctx.CreateModule(genrule.GenRuleFactory, &props)
|
||||||
|
}
|
||||||
|
|
||||||
func createFilteredApiVersions(ctx android.LoadHookContext, modules []string) {
|
func createFilteredApiVersions(ctx android.LoadHookContext, modules []string) {
|
||||||
props := genruleProps{}
|
props := genruleProps{}
|
||||||
props.Name = proptools.StringPtr("api-versions-xml-public-filtered")
|
props.Name = proptools.StringPtr("api-versions-xml-public-filtered")
|
||||||
@@ -204,6 +217,12 @@ func (a *CombinedApis) createInternalModules(ctx android.LoadHookContext) {
|
|||||||
|
|
||||||
createMergedStubsSrcjar(ctx, a.properties.Bootclasspath)
|
createMergedStubsSrcjar(ctx, a.properties.Bootclasspath)
|
||||||
|
|
||||||
|
// Conscrypt and i18n currently do not enable annotations
|
||||||
|
annotationModules := a.properties.Bootclasspath
|
||||||
|
annotationModules = remove(annotationModules, "conscrypt.module.public.api")
|
||||||
|
annotationModules = remove(annotationModules, "i18n.module.public.api")
|
||||||
|
createMergedAnnotations(ctx, annotationModules)
|
||||||
|
|
||||||
// For the filtered api versions, we prune all APIs except art module's APIs. because
|
// 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
|
// 1) ART apis are available by default to all modules, while other module-to-module deps are
|
||||||
// explicit and probably receive more scrutiny anyway
|
// explicit and probably receive more scrutiny anyway
|
||||||
|
|||||||
Reference in New Issue
Block a user