Merge "Add preparer for overlay pre-singleton registration" am: e0998ab561
am: f84f035e13
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649792 Change-Id: Ie46a00406a3d88ec5a3a312d93ebe8325fcac744
This commit is contained in:
@@ -263,8 +263,9 @@ type RegistrationContext interface {
|
|||||||
// ctx := android.NewTestContext(config)
|
// ctx := android.NewTestContext(config)
|
||||||
// RegisterBuildComponents(ctx)
|
// RegisterBuildComponents(ctx)
|
||||||
var InitRegistrationContext RegistrationContext = &initRegistrationContext{
|
var InitRegistrationContext RegistrationContext = &initRegistrationContext{
|
||||||
moduleTypes: make(map[string]ModuleFactory),
|
moduleTypes: make(map[string]ModuleFactory),
|
||||||
singletonTypes: make(map[string]SingletonFactory),
|
singletonTypes: make(map[string]SingletonFactory),
|
||||||
|
preSingletonTypes: make(map[string]SingletonFactory),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the TestContext implements RegistrationContext.
|
// Make sure the TestContext implements RegistrationContext.
|
||||||
|
@@ -22,8 +22,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
android.RegisterPreSingletonType("overlay", OverlaySingletonFactory)
|
registerOverlayBuildComponents(android.InitRegistrationContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
func registerOverlayBuildComponents(ctx android.RegistrationContext) {
|
||||||
|
ctx.RegisterPreSingletonType("overlay", OverlaySingletonFactory)
|
||||||
}
|
}
|
||||||
|
|
||||||
var androidResourceIgnoreFilenames = []string{
|
var androidResourceIgnoreFilenames = []string{
|
||||||
|
@@ -71,11 +71,11 @@ var prepareForJavaTest = android.GroupFixturePreparers(
|
|||||||
cc.PrepareForTestWithCcBuildComponents,
|
cc.PrepareForTestWithCcBuildComponents,
|
||||||
// Include all the default java modules.
|
// Include all the default java modules.
|
||||||
PrepareForTestWithJavaDefaultModules,
|
PrepareForTestWithJavaDefaultModules,
|
||||||
|
PrepareForTestWithOverlayBuildComponents,
|
||||||
python.PrepareForTestWithPythonBuildComponents,
|
python.PrepareForTestWithPythonBuildComponents,
|
||||||
android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
|
android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
|
||||||
ctx.RegisterModuleType("java_plugin", PluginFactory)
|
ctx.RegisterModuleType("java_plugin", PluginFactory)
|
||||||
|
|
||||||
ctx.RegisterPreSingletonType("overlay", OverlaySingletonFactory)
|
|
||||||
ctx.RegisterPreSingletonType("sdk_versions", sdkPreSingletonFactory)
|
ctx.RegisterPreSingletonType("sdk_versions", sdkPreSingletonFactory)
|
||||||
}),
|
}),
|
||||||
dexpreopt.PrepareForTestWithDexpreopt,
|
dexpreopt.PrepareForTestWithDexpreopt,
|
||||||
|
@@ -54,6 +54,8 @@ var PrepareForTestWithJavaDefaultModules = android.GroupFixturePreparers(
|
|||||||
android.FixtureAddTextFile(defaultJavaDir+"/Android.bp", GatherRequiredDepsForTest()),
|
android.FixtureAddTextFile(defaultJavaDir+"/Android.bp", GatherRequiredDepsForTest()),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var PrepareForTestWithOverlayBuildComponents = android.FixtureRegisterWithContext(registerOverlayBuildComponents)
|
||||||
|
|
||||||
// Prepare a fixture to use all java module types, mutators and singletons fully.
|
// Prepare a fixture to use all java module types, mutators and singletons fully.
|
||||||
//
|
//
|
||||||
// This should only be used by tests that want to run with as much of the build enabled as possible.
|
// This should only be used by tests that want to run with as much of the build enabled as possible.
|
||||||
|
Reference in New Issue
Block a user