Loading android/register.go +10 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,7 @@ func ModuleTypeFactoriesForDocs() map[string]reflect.Value { type RegistrationContext interface { RegisterModuleType(name string, factory ModuleFactory) RegisterSingletonModuleType(name string, factory SingletonModuleFactory) RegisterPreSingletonType(name string, factory SingletonFactory) RegisterSingletonType(name string, factory SingletonFactory) PreArchMutators(f RegisterMutatorFunc) Loading Loading @@ -208,6 +209,7 @@ var _ RegistrationContext = (*TestContext)(nil) type initRegistrationContext struct { moduleTypes map[string]ModuleFactory singletonTypes map[string]SingletonFactory preSingletonTypes map[string]SingletonFactory moduleTypesForDocs map[string]reflect.Value } Loading Loading @@ -238,6 +240,14 @@ func (ctx *initRegistrationContext) RegisterSingletonType(name string, factory S RegisterSingletonType(name, factory) } func (ctx *initRegistrationContext) RegisterPreSingletonType(name string, factory SingletonFactory) { if _, present := ctx.preSingletonTypes[name]; present { panic(fmt.Sprintf("pre singleton type %q is already registered", name)) } ctx.preSingletonTypes[name] = factory RegisterPreSingletonType(name, factory) } func (ctx *initRegistrationContext) PreArchMutators(f RegisterMutatorFunc) { PreArchMutators(f) } Loading android/testing.go +4 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,10 @@ func (ctx *TestContext) RegisterSingletonType(name string, factory SingletonFact ctx.Context.RegisterSingletonType(name, SingletonFactoryAdaptor(ctx.Context, factory)) } func (ctx *TestContext) RegisterPreSingletonType(name string, factory SingletonFactory) { ctx.Context.RegisterPreSingletonType(name, SingletonFactoryAdaptor(ctx.Context, factory)) } func (ctx *TestContext) ModuleForTests(name, variant string) TestingModule { var module Module ctx.VisitAllModules(func(m blueprint.Module) { Loading java/java_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -74,8 +74,8 @@ func testContext(config android.Config) *android.TestContext { ctx.PreDepsMutators(python.RegisterPythonPreDepsMutators) ctx.PostDepsMutators(android.RegisterOverridePostDepsMutators) ctx.RegisterPreSingletonType("overlay", android.SingletonFactoryAdaptor(ctx.Context, OverlaySingletonFactory)) ctx.RegisterPreSingletonType("sdk_versions", android.SingletonFactoryAdaptor(ctx.Context, sdkPreSingletonFactory)) ctx.RegisterPreSingletonType("overlay", OverlaySingletonFactory) ctx.RegisterPreSingletonType("sdk_versions", sdkPreSingletonFactory) android.RegisterPrebuiltMutators(ctx) Loading Loading
android/register.go +10 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,7 @@ func ModuleTypeFactoriesForDocs() map[string]reflect.Value { type RegistrationContext interface { RegisterModuleType(name string, factory ModuleFactory) RegisterSingletonModuleType(name string, factory SingletonModuleFactory) RegisterPreSingletonType(name string, factory SingletonFactory) RegisterSingletonType(name string, factory SingletonFactory) PreArchMutators(f RegisterMutatorFunc) Loading Loading @@ -208,6 +209,7 @@ var _ RegistrationContext = (*TestContext)(nil) type initRegistrationContext struct { moduleTypes map[string]ModuleFactory singletonTypes map[string]SingletonFactory preSingletonTypes map[string]SingletonFactory moduleTypesForDocs map[string]reflect.Value } Loading Loading @@ -238,6 +240,14 @@ func (ctx *initRegistrationContext) RegisterSingletonType(name string, factory S RegisterSingletonType(name, factory) } func (ctx *initRegistrationContext) RegisterPreSingletonType(name string, factory SingletonFactory) { if _, present := ctx.preSingletonTypes[name]; present { panic(fmt.Sprintf("pre singleton type %q is already registered", name)) } ctx.preSingletonTypes[name] = factory RegisterPreSingletonType(name, factory) } func (ctx *initRegistrationContext) PreArchMutators(f RegisterMutatorFunc) { PreArchMutators(f) } Loading
android/testing.go +4 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,10 @@ func (ctx *TestContext) RegisterSingletonType(name string, factory SingletonFact ctx.Context.RegisterSingletonType(name, SingletonFactoryAdaptor(ctx.Context, factory)) } func (ctx *TestContext) RegisterPreSingletonType(name string, factory SingletonFactory) { ctx.Context.RegisterPreSingletonType(name, SingletonFactoryAdaptor(ctx.Context, factory)) } func (ctx *TestContext) ModuleForTests(name, variant string) TestingModule { var module Module ctx.VisitAllModules(func(m blueprint.Module) { Loading
java/java_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -74,8 +74,8 @@ func testContext(config android.Config) *android.TestContext { ctx.PreDepsMutators(python.RegisterPythonPreDepsMutators) ctx.PostDepsMutators(android.RegisterOverridePostDepsMutators) ctx.RegisterPreSingletonType("overlay", android.SingletonFactoryAdaptor(ctx.Context, OverlaySingletonFactory)) ctx.RegisterPreSingletonType("sdk_versions", android.SingletonFactoryAdaptor(ctx.Context, sdkPreSingletonFactory)) ctx.RegisterPreSingletonType("overlay", OverlaySingletonFactory) ctx.RegisterPreSingletonType("sdk_versions", sdkPreSingletonFactory) android.RegisterPrebuiltMutators(ctx) Loading