Make CreateModule take an android.ModuleFactory
Reduce the boilerplate required to call CreateModule by taking an
android.ModuleFactory instead of a blueprint.ModuleFactory.
Test: m checkbuild
Change-Id: I1259d2dd3f7893b5319c333bc180727ac40f9e91
diff --git a/android/hooks.go b/android/hooks.go
index 5810996..64ffd52 100644
--- a/android/hooks.go
+++ b/android/hooks.go
@@ -30,7 +30,7 @@
BaseModuleContext
AppendProperties(...interface{})
PrependProperties(...interface{})
- CreateModule(blueprint.ModuleFactory, ...interface{})
+ CreateModule(ModuleFactory, ...interface{})
}
// Arch hooks are run after the module has been split into architecture variants, and can be used
diff --git a/android/mutator.go b/android/mutator.go
index e76f847..7b7859c 100644
--- a/android/mutator.go
+++ b/android/mutator.go
@@ -121,7 +121,7 @@
Rename(name string)
- CreateModule(blueprint.ModuleFactory, ...interface{})
+ CreateModule(ModuleFactory, ...interface{})
}
type topDownMutatorContext struct {
@@ -243,9 +243,9 @@
t.Module().base().commonProperties.DebugName = name
}
-func (t *topDownMutatorContext) CreateModule(factory blueprint.ModuleFactory, props ...interface{}) {
+func (t *topDownMutatorContext) CreateModule(factory ModuleFactory, props ...interface{}) {
inherited := []interface{}{&t.Module().base().commonProperties, &t.Module().base().variableProperties}
- t.bp.CreateModule(factory, append(inherited, props...)...)
+ t.bp.CreateModule(ModuleFactoryAdaptor(factory), append(inherited, props...)...)
}
func (b *bottomUpMutatorContext) MutatorName() string {