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/llndk_library.go b/cc/llndk_library.go
index cde1bc7..66ffc9f 100644
--- a/cc/llndk_library.go
+++ b/cc/llndk_library.go
@@ -18,8 +18,6 @@
"path/filepath"
"strings"
- "github.com/google/blueprint"
-
"android/soong/android"
)
@@ -136,7 +134,7 @@
return stub.libraryDecorator.link(ctx, flags, deps, objs)
}
-func newLLndkStubLibrary() (*Module, []interface{}) {
+func newLLndkStubLibrary() *Module {
module, library := NewLibrary(android.DeviceSupported)
library.BuildOnlyShared()
module.stl = nil
@@ -150,13 +148,18 @@
module.linker = stub
module.installer = nil
- return module, []interface{}{&stub.Properties, &library.MutatedProperties, &library.flagExporter.Properties}
+ module.AddProperties(
+ &stub.Properties,
+ &library.MutatedProperties,
+ &library.flagExporter.Properties)
+
+ return module
}
-func llndkLibraryFactory() (blueprint.Module, []interface{}) {
- module, properties := newLLndkStubLibrary()
- return android.InitAndroidArchModule(module, android.DeviceSupported,
- android.MultilibBoth, properties...)
+func llndkLibraryFactory() android.Module {
+ module := newLLndkStubLibrary()
+ android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibBoth)
+ return module
}
func init() {