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
diff --git a/cc/ndk_library.go b/cc/ndk_library.go
index d801775..5765aa9 100644
--- a/cc/ndk_library.go
+++ b/cc/ndk_library.go
@@ -335,7 +335,7 @@
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 @@
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
}