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.
Change-Id: I6018791ae136bc764a6e846078c6bce59bcc123b
This commit is contained in:
32
Android.bp
32
Android.bp
@@ -154,38 +154,6 @@ filegroup {
|
||||
],
|
||||
}
|
||||
|
||||
java_library_with_nonpublic_deps {
|
||||
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-connectivity-tiramisu.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-supplementalprocess.stubs.module_lib",
|
||||
"framework-tethering.stubs.module_lib",
|
||||
"framework-uwb.stubs.module_lib",
|
||||
"framework-nearby.stubs.module_lib",
|
||||
"framework-wifi.stubs.module_lib",
|
||||
],
|
||||
soong_config_variables: {
|
||||
include_nonpublic_framework_api: {
|
||||
static_libs: [
|
||||
"framework-supplementalapi.stubs.module_lib",
|
||||
],
|
||||
},
|
||||
},
|
||||
sdk_version: "module_current",
|
||||
visibility: ["//visibility:private"],
|
||||
}
|
||||
|
||||
java_library_with_nonpublic_deps {
|
||||
name: "framework-all",
|
||||
installable: false,
|
||||
|
||||
@@ -32,6 +32,7 @@ bootstrap_go_package {
|
||||
"soong",
|
||||
"soong-android",
|
||||
"soong-genrule",
|
||||
"soong-java",
|
||||
],
|
||||
srcs: ["api.go"],
|
||||
pluginFor: ["soong_build"],
|
||||
|
||||
29
api/api.go
29
api/api.go
@@ -21,6 +21,7 @@ import (
|
||||
|
||||
"android/soong/android"
|
||||
"android/soong/genrule"
|
||||
"android/soong/java"
|
||||
)
|
||||
|
||||
const art = "art.module.public.api"
|
||||
@@ -73,6 +74,13 @@ type genruleProps struct {
|
||||
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.
|
||||
type MergedTxtDefinition struct {
|
||||
// "current.txt" or "removed.txt"
|
||||
@@ -169,6 +177,25 @@ func createFilteredApiVersions(ctx android.LoadHookContext, modules []string) {
|
||||
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 {
|
||||
a := make([]string, 0, len(modules)+1)
|
||||
a = append(a, base)
|
||||
@@ -246,6 +273,8 @@ func (a *CombinedApis) createInternalModules(ctx android.LoadHookContext) {
|
||||
|
||||
createMergedStubsSrcjar(ctx, bootclasspath)
|
||||
|
||||
createMergedModuleLibStubs(ctx, bootclasspath)
|
||||
|
||||
createMergedAnnotations(ctx, bootclasspath)
|
||||
|
||||
createFilteredApiVersions(ctx, bootclasspath)
|
||||
|
||||
Reference in New Issue
Block a user