diff options
author | Colin Cross <ccross@android.com> | 2017-06-23 15:06:31 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-06-30 21:08:36 +0000 |
commit | 36242850fdad11b4e6fbe061ef30f62e7e8c08d8 (patch) | |
tree | a3ca380533afd39e733c658560f87effb1ee0a46 /android/arch.go | |
parent | 48173891485a22c9cab0e48f90a3a23be212f44a (diff) | |
download | build_soong-36242850fdad11b4e6fbe061ef30f62e7e8c08d8.tar.gz build_soong-36242850fdad11b4e6fbe061ef30f62e7e8c08d8.tar.bz2 build_soong-36242850fdad11b4e6fbe061ef30f62e7e8c08d8.zip |
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
Diffstat (limited to 'android/arch.go')
-rw-r--r-- | android/arch.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/android/arch.go b/android/arch.go index effd5a6b..67ce30eb 100644 --- a/android/arch.go +++ b/android/arch.go @@ -20,7 +20,6 @@ import ( "runtime" "strings" - "github.com/google/blueprint" "github.com/google/blueprint/proptools" ) @@ -491,13 +490,11 @@ func createArchType(props reflect.Type) reflect.Type { 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 @@ func InitArchModule(m Module, } } - 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("-", "_", ".", "_") |