Refactor factories

Change module factories from returning a blueprint.Module and a list
of property structs to returning an android.Module, which holds the
list of property structs.

Test: build.ninja identical except for Factory: comment lines
Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
This commit is contained in:
Colin Cross
2017-06-23 15:06:31 -07:00
parent 4817389148
commit 36242850fd
29 changed files with 211 additions and 168 deletions

View File

@@ -335,7 +335,7 @@ func (stub *stubDecorator) install(ctx ModuleContext, path android.Path) {
stub.installPath = ctx.InstallFile(installDir, path).String()
}
func newStubLibrary() (*Module, []interface{}) {
func newStubLibrary() *Module {
module, library := NewLibrary(android.DeviceSupported)
library.BuildOnlyShared()
module.stl = nil
@@ -349,11 +349,13 @@ func newStubLibrary() (*Module, []interface{}) {
module.linker = stub
module.installer = stub
return module, []interface{}{&stub.properties, &library.MutatedProperties}
module.AddProperties(&stub.properties, &library.MutatedProperties)
return module
}
func ndkLibraryFactory() (blueprint.Module, []interface{}) {
module, properties := newStubLibrary()
return android.InitAndroidArchModule(module, android.DeviceSupported,
android.MultilibBoth, properties...)
func ndkLibraryFactory() android.Module {
module := newStubLibrary()
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibBoth)
return module
}