Convert merged module lib stub to api.go
Bug: 169103987
Test: m framework-updatable-stubs-module_libs_api and diff intermediates
folder before and after.
Merged-In: I6018791ae136bc764a6e846078c6bce59bcc123b
Change-Id: I6018791ae136bc764a6e846078c6bce59bcc123b
This commit is contained in:
21
Android.bp
21
Android.bp
@@ -140,27 +140,6 @@ filegroup {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
java_library {
|
|
||||||
name: "framework-updatable-stubs-module_libs_api",
|
|
||||||
static_libs: [
|
|
||||||
"android.net.ipsec.ike.stubs.module_lib",
|
|
||||||
"framework-appsearch.stubs.module_lib",
|
|
||||||
"framework-connectivity.stubs.module_lib",
|
|
||||||
"framework-graphics.stubs.module_lib",
|
|
||||||
"framework-media.stubs.module_lib",
|
|
||||||
"framework-mediaprovider.stubs.module_lib",
|
|
||||||
"framework-permission.stubs.module_lib",
|
|
||||||
"framework-permission-s.stubs.module_lib",
|
|
||||||
"framework-scheduling.stubs.module_lib",
|
|
||||||
"framework-sdkextensions.stubs.module_lib",
|
|
||||||
"framework-statsd.stubs.module_lib",
|
|
||||||
"framework-tethering.stubs.module_lib",
|
|
||||||
"framework-wifi.stubs.module_lib",
|
|
||||||
],
|
|
||||||
sdk_version: "module_current",
|
|
||||||
visibility: ["//visibility:private"],
|
|
||||||
}
|
|
||||||
|
|
||||||
java_library {
|
java_library {
|
||||||
name: "framework-all",
|
name: "framework-all",
|
||||||
installable: false,
|
installable: false,
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ bootstrap_go_package {
|
|||||||
"soong",
|
"soong",
|
||||||
"soong-android",
|
"soong-android",
|
||||||
"soong-genrule",
|
"soong-genrule",
|
||||||
|
"soong-java",
|
||||||
],
|
],
|
||||||
srcs: ["api.go"],
|
srcs: ["api.go"],
|
||||||
pluginFor: ["soong_build"],
|
pluginFor: ["soong_build"],
|
||||||
|
|||||||
29
api/api.go
29
api/api.go
@@ -21,6 +21,7 @@ import (
|
|||||||
|
|
||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
"android/soong/genrule"
|
"android/soong/genrule"
|
||||||
|
"android/soong/java"
|
||||||
)
|
)
|
||||||
|
|
||||||
const art = "art.module.public.api"
|
const art = "art.module.public.api"
|
||||||
@@ -73,6 +74,13 @@ type genruleProps struct {
|
|||||||
Visibility []string
|
Visibility []string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type libraryProps struct {
|
||||||
|
Name *string
|
||||||
|
Sdk_version *string
|
||||||
|
Static_libs []string
|
||||||
|
Visibility []string
|
||||||
|
}
|
||||||
|
|
||||||
// Struct to pass parameters for the various merged [current|removed].txt file modules we create.
|
// Struct to pass parameters for the various merged [current|removed].txt file modules we create.
|
||||||
type MergedTxtDefinition struct {
|
type MergedTxtDefinition struct {
|
||||||
// "current.txt" or "removed.txt"
|
// "current.txt" or "removed.txt"
|
||||||
@@ -169,6 +177,25 @@ func createFilteredApiVersions(ctx android.LoadHookContext, modules []string) {
|
|||||||
ctx.CreateModule(genrule.GenRuleFactory, &props)
|
ctx.CreateModule(genrule.GenRuleFactory, &props)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func createMergedModuleLibStubs(ctx android.LoadHookContext, modules []string) {
|
||||||
|
// The user of this module compiles against the "core" SDK, so remove core libraries to avoid dupes.
|
||||||
|
modules = removeAll(modules, []string{art, conscrypt, i18n})
|
||||||
|
props := libraryProps{}
|
||||||
|
props.Name = proptools.StringPtr("framework-updatable-stubs-module_libs_api")
|
||||||
|
props.Static_libs = appendStr(modules, ".stubs.module_lib")
|
||||||
|
props.Sdk_version = proptools.StringPtr("module_current")
|
||||||
|
props.Visibility = []string{"//frameworks/base"}
|
||||||
|
ctx.CreateModule(java.LibraryFactory, &props)
|
||||||
|
}
|
||||||
|
|
||||||
|
func appendStr(modules []string, s string) []string {
|
||||||
|
a := make([]string, 0, len(modules))
|
||||||
|
for _, module := range modules {
|
||||||
|
a = append(a, module+s)
|
||||||
|
}
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
|
||||||
func createSrcs(base string, modules []string, tag string) []string {
|
func createSrcs(base string, modules []string, tag string) []string {
|
||||||
a := make([]string, 0, len(modules)+1)
|
a := make([]string, 0, len(modules)+1)
|
||||||
a = append(a, base)
|
a = append(a, base)
|
||||||
@@ -246,6 +273,8 @@ func (a *CombinedApis) createInternalModules(ctx android.LoadHookContext) {
|
|||||||
|
|
||||||
createMergedStubsSrcjar(ctx, bootclasspath)
|
createMergedStubsSrcjar(ctx, bootclasspath)
|
||||||
|
|
||||||
|
createMergedModuleLibStubs(ctx, bootclasspath)
|
||||||
|
|
||||||
createMergedAnnotations(ctx, bootclasspath)
|
createMergedAnnotations(ctx, bootclasspath)
|
||||||
|
|
||||||
createFilteredApiVersions(ctx, bootclasspath)
|
createFilteredApiVersions(ctx, bootclasspath)
|
||||||
|
|||||||
Reference in New Issue
Block a user