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/android/arch.go b/android/arch.go
index effd5a6..67ce30e 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -20,7 +20,6 @@
"runtime"
"strings"
- "github.com/google/blueprint"
"github.com/google/blueprint/proptools"
)
@@ -491,13 +490,11 @@
var archPropTypeMap OncePer
-func InitArchModule(m Module,
- propertyStructs ...interface{}) (blueprint.Module, []interface{}) {
+func InitArchModule(m Module) {
base := m.base()
- base.generalProperties = append(base.generalProperties,
- propertyStructs...)
+ base.generalProperties = m.GetProperties()
for _, properties := range base.generalProperties {
propertiesValue := reflect.ValueOf(properties)
@@ -524,17 +521,13 @@
}
}
- var allProperties []interface{}
- allProperties = append(allProperties, base.generalProperties...)
for _, asp := range base.archProperties {
if asp != nil {
- allProperties = append(allProperties, asp)
+ m.AddProperties(asp)
}
}
- base.customizableProperties = allProperties
-
- return m, allProperties
+ base.customizableProperties = m.GetProperties()
}
var variantReplacer = strings.NewReplacer("-", "_", ".", "_")