Simplify vendor conditionals
Support vendor conditionals with no Go code. Test: TestSoongConfigModule Change-Id: I42546e7f17324921ada80f4d8e1cd399830f8dfc
This commit is contained in:
@@ -34,6 +34,9 @@ type LoadHookContext interface {
|
||||
AppendProperties(...interface{})
|
||||
PrependProperties(...interface{})
|
||||
CreateModule(ModuleFactory, ...interface{}) Module
|
||||
|
||||
registerScopedModuleType(name string, factory blueprint.ModuleFactory)
|
||||
moduleFactories() map[string]blueprint.ModuleFactory
|
||||
}
|
||||
|
||||
func AddLoadHook(m blueprint.Module, hook func(LoadHookContext)) {
|
||||
@@ -52,6 +55,10 @@ type loadHookContext struct {
|
||||
module Module
|
||||
}
|
||||
|
||||
func (l *loadHookContext) moduleFactories() map[string]blueprint.ModuleFactory {
|
||||
return l.bp.ModuleFactories()
|
||||
}
|
||||
|
||||
func (l *loadHookContext) AppendProperties(props ...interface{}) {
|
||||
for _, p := range props {
|
||||
err := proptools.AppendMatchingProperties(l.Module().base().customizableProperties,
|
||||
@@ -101,6 +108,10 @@ func (l *loadHookContext) CreateModule(factory ModuleFactory, props ...interface
|
||||
return module
|
||||
}
|
||||
|
||||
func (l *loadHookContext) registerScopedModuleType(name string, factory blueprint.ModuleFactory) {
|
||||
l.bp.RegisterScopedModuleType(name, factory)
|
||||
}
|
||||
|
||||
type InstallHookContext interface {
|
||||
ModuleContext
|
||||
Path() InstallPath
|
||||
|
Reference in New Issue
Block a user