Merge "Allow non-updatable modules to contribute to @TestApi" am: 17b0dccd44 am: 25e7ff08f8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2323517 Change-Id: Ic0b1e4280a2f2836b3037507be4055b0ddbf1f18 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -328,10 +328,12 @@ java_library {
|
|||||||
|
|
||||||
java_library {
|
java_library {
|
||||||
name: "android_test_stubs_current",
|
name: "android_test_stubs_current",
|
||||||
// Modules do not have test APIs, but we want to include their SystemApis, like we include
|
|
||||||
// the SystemApi of framework-non-updatable-sources.
|
|
||||||
static_libs: [
|
static_libs: [
|
||||||
"all-modules-system-stubs",
|
// Updatable modules do not have test APIs, but we want to include their SystemApis, like we
|
||||||
|
// include the SystemApi of framework-non-updatable-sources.
|
||||||
|
"all-updatable-modules-system-stubs",
|
||||||
|
// Non-updatable modules on the other hand can have test APIs, so include their test-stubs.
|
||||||
|
"all-non-updatable-modules-test-stubs",
|
||||||
"android-non-updatable.stubs.test",
|
"android-non-updatable.stubs.test",
|
||||||
"private-stub-annotations-jar",
|
"private-stub-annotations-jar",
|
||||||
],
|
],
|
||||||
|
|||||||
31
api/api.go
31
api/api.go
@@ -36,6 +36,8 @@ var core_libraries_modules = []string{art, conscrypt, i18n}
|
|||||||
// built against module_current SDK). Instead they are directly statically
|
// built against module_current SDK). Instead they are directly statically
|
||||||
// linked into the all-framework-module-lib, which is building against hidden
|
// linked into the all-framework-module-lib, which is building against hidden
|
||||||
// APIs.
|
// APIs.
|
||||||
|
// In addition, the modules in this list are allowed to contribute to test APIs
|
||||||
|
// stubs.
|
||||||
var non_updatable_modules = []string{virtualization}
|
var non_updatable_modules = []string{virtualization}
|
||||||
|
|
||||||
// The intention behind this soong plugin is to generate a number of "merged"
|
// The intention behind this soong plugin is to generate a number of "merged"
|
||||||
@@ -246,9 +248,33 @@ func createMergedPublicStubs(ctx android.LoadHookContext, modules []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createMergedSystemStubs(ctx android.LoadHookContext, modules []string) {
|
func createMergedSystemStubs(ctx android.LoadHookContext, modules []string) {
|
||||||
|
// First create the all-updatable-modules-system-stubs
|
||||||
|
{
|
||||||
|
updatable_modules := removeAll(modules, non_updatable_modules)
|
||||||
|
props := libraryProps{}
|
||||||
|
props.Name = proptools.StringPtr("all-updatable-modules-system-stubs")
|
||||||
|
props.Static_libs = transformArray(updatable_modules, "", ".stubs.system")
|
||||||
|
props.Sdk_version = proptools.StringPtr("module_current")
|
||||||
|
props.Visibility = []string{"//frameworks/base"}
|
||||||
|
ctx.CreateModule(java.LibraryFactory, &props)
|
||||||
|
}
|
||||||
|
// Now merge all-updatable-modules-system-stubs and stubs from non-updatable modules
|
||||||
|
// into all-modules-system-stubs.
|
||||||
|
{
|
||||||
|
props := libraryProps{}
|
||||||
|
props.Name = proptools.StringPtr("all-modules-system-stubs")
|
||||||
|
props.Static_libs = transformArray(non_updatable_modules, "", ".stubs.system")
|
||||||
|
props.Static_libs = append(props.Static_libs, "all-updatable-modules-system-stubs")
|
||||||
|
props.Sdk_version = proptools.StringPtr("module_current")
|
||||||
|
props.Visibility = []string{"//frameworks/base"}
|
||||||
|
ctx.CreateModule(java.LibraryFactory, &props)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func createMergedTestStubsForNonUpdatableModules(ctx android.LoadHookContext) {
|
||||||
props := libraryProps{}
|
props := libraryProps{}
|
||||||
props.Name = proptools.StringPtr("all-modules-system-stubs")
|
props.Name = proptools.StringPtr("all-non-updatable-modules-test-stubs")
|
||||||
props.Static_libs = transformArray(modules, "", ".stubs.system")
|
props.Static_libs = transformArray(non_updatable_modules, "", ".stubs.test")
|
||||||
props.Sdk_version = proptools.StringPtr("module_current")
|
props.Sdk_version = proptools.StringPtr("module_current")
|
||||||
props.Visibility = []string{"//frameworks/base"}
|
props.Visibility = []string{"//frameworks/base"}
|
||||||
ctx.CreateModule(java.LibraryFactory, &props)
|
ctx.CreateModule(java.LibraryFactory, &props)
|
||||||
@@ -360,6 +386,7 @@ func (a *CombinedApis) createInternalModules(ctx android.LoadHookContext) {
|
|||||||
|
|
||||||
createMergedPublicStubs(ctx, bootclasspath)
|
createMergedPublicStubs(ctx, bootclasspath)
|
||||||
createMergedSystemStubs(ctx, bootclasspath)
|
createMergedSystemStubs(ctx, bootclasspath)
|
||||||
|
createMergedTestStubsForNonUpdatableModules(ctx)
|
||||||
createMergedFrameworkModuleLibStubs(ctx, bootclasspath)
|
createMergedFrameworkModuleLibStubs(ctx, bootclasspath)
|
||||||
createMergedFrameworkImpl(ctx, bootclasspath)
|
createMergedFrameworkImpl(ctx, bootclasspath)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user