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
This commit is contained in:
Colin Cross
2019-09-25 11:33:01 -07:00
parent 505bcb88ed
commit 84dfc3d331
5 changed files with 14 additions and 14 deletions

View File

@@ -362,7 +362,7 @@ func syspropLibraryHook(ctx android.LoadHookContext, m *syspropLibrary) {
ccProps.Recovery_available = m.properties.Recovery_available
ccProps.Vendor_available = m.properties.Vendor_available
ctx.CreateModule(android.ModuleFactoryAdaptor(cc.LibraryFactory), &ccProps)
ctx.CreateModule(cc.LibraryFactory, &ccProps)
// internal scope contains all properties
// public scope only contains public properties
@@ -390,7 +390,7 @@ func syspropLibraryHook(ctx android.LoadHookContext, m *syspropLibrary) {
Name: proptools.StringPtr(m.javaGenModuleName()),
}
ctx.CreateModule(android.ModuleFactoryAdaptor(syspropJavaGenFactory), &javaGenProps)
ctx.CreateModule(syspropJavaGenFactory, &javaGenProps)
javaProps := struct {
Name *string
@@ -413,7 +413,7 @@ func syspropLibraryHook(ctx android.LoadHookContext, m *syspropLibrary) {
javaProps.Sdk_version = proptools.StringPtr("core_current")
javaProps.Libs = []string{stub}
ctx.CreateModule(android.ModuleFactoryAdaptor(java.LibraryFactory), &javaProps)
ctx.CreateModule(java.LibraryFactory, &javaProps)
}
func syspropDepsMutator(ctx android.BottomUpMutatorContext) {