summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Usta <usta@google.com> 2021-12-20 12:56:46 -0500
committer Usta <usta@google.com> 2022-01-04 13:33:51 -0500
commitdca0219965b63868b3862890d691bde094ee3d7a (patch)
treefdfeaab496400ca71cc1bd594c681f1edc8e67dc
parent69e87311010a410cb8cb676c82d1642784211a0f (diff)
Remove customizableProperties from `android.ModuleBase`
- customizableProperties was being used to access all properties, i.e. basically `GetProperties()` - generalProperties was a subset of properties, i.e. `initArchModule()` would only add new arch-specific properties to `customizableProperties` (and `archProperties`) but not `generalProperties` This PR sets generalProperties to contain all properties, which then makes customizableProperties redundant. And in arch.go, any iteration is done via `archProperties` instead. Bug: 206961391 Test: m nothing and diff the ninja files Change-Id: Ieb72b31c0a447fcbf34c92a04f002d7b9d777a86
-rw-r--r--android/arch.go8
-rw-r--r--android/defaults.go2
-rw-r--r--android/hooks.go2
-rw-r--r--android/license.go1
-rw-r--r--android/license_kind.go1
-rw-r--r--android/licenses_test.go1
-rw-r--r--android/module.go3
-rw-r--r--android/prebuilt.go2
8 files changed, 6 insertions, 14 deletions
diff --git a/android/arch.go b/android/arch.go
index e08fd5c0a..fb33f3030 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -1036,9 +1036,7 @@ func initArchModule(m Module) {
m.AddProperties(archProperties...)
}
- // Update the list of properties that can be set by a defaults module or a call to
- // AppendMatchingProperties or PrependMatchingProperties.
- base.customizableProperties = m.GetProperties()
+ base.generalProperties = m.GetProperties()
}
func maybeBlueprintEmbed(src reflect.Value) reflect.Value {
@@ -1111,7 +1109,7 @@ func getChildPropertyStruct(ctx ArchVariantContext,
func (m *ModuleBase) setOSProperties(ctx BottomUpMutatorContext) {
os := m.commonProperties.CompileOS
- for i := range m.generalProperties {
+ for i := range m.archProperties {
genProps := m.generalProperties[i]
if m.archProperties[i] == nil {
continue
@@ -1439,7 +1437,7 @@ func (m *ModuleBase) setArchProperties(ctx BottomUpMutatorContext) {
arch := m.Arch()
os := m.Os()
- for i := range m.generalProperties {
+ for i := range m.archProperties {
genProps := m.generalProperties[i]
if m.archProperties[i] == nil {
continue
diff --git a/android/defaults.go b/android/defaults.go
index 5677638b7..15fd67595 100644
--- a/android/defaults.go
+++ b/android/defaults.go
@@ -97,7 +97,7 @@ func InitDefaultableModule(module DefaultableModule) {
module.AddProperties(module.defaults())
- module.base().customizableProperties = module.GetProperties()
+ module.base().generalProperties = module.GetProperties()
}
// A restricted subset of context methods, similar to LoadHookContext.
diff --git a/android/hooks.go b/android/hooks.go
index 9eaa1ac85..1b61cd70f 100644
--- a/android/hooks.go
+++ b/android/hooks.go
@@ -68,7 +68,7 @@ func (l *loadHookContext) moduleFactories() map[string]blueprint.ModuleFactory {
func (l *loadHookContext) appendPrependHelper(props []interface{},
extendFn func([]interface{}, interface{}, proptools.ExtendPropertyFilterFunc) error) {
for _, p := range props {
- err := extendFn(l.Module().base().customizableProperties, p, nil)
+ err := extendFn(l.Module().base().generalProperties, p, nil)
if err != nil {
if propertyErr, ok := err.(*proptools.ExtendPropertyError); ok {
l.PropertyErrorf(propertyErr.Property, "%s", propertyErr.Err.Error())
diff --git a/android/license.go b/android/license.go
index 8bfd3baa2..d7e1d8757 100644
--- a/android/license.go
+++ b/android/license.go
@@ -81,7 +81,6 @@ func LicenseFactory() Module {
module.AddProperties(&base.nameProperties, &module.properties)
base.generalProperties = module.GetProperties()
- base.customizableProperties = module.GetProperties()
// The visibility property needs to be checked and parsed by the visibility module.
setPrimaryVisibilityProperty(module, "visibility", &module.properties.Visibility)
diff --git a/android/license_kind.go b/android/license_kind.go
index ddecd775f..f007ef146 100644
--- a/android/license_kind.go
+++ b/android/license_kind.go
@@ -54,7 +54,6 @@ func LicenseKindFactory() Module {
module.AddProperties(&base.nameProperties, &module.properties)
base.generalProperties = module.GetProperties()
- base.customizableProperties = module.GetProperties()
// The visibility property needs to be checked and parsed by the visibility module.
setPrimaryVisibilityProperty(module, "visibility", &module.properties.Visibility)
diff --git a/android/licenses_test.go b/android/licenses_test.go
index d05b0a35f..6ddbd3e58 100644
--- a/android/licenses_test.go
+++ b/android/licenses_test.go
@@ -780,7 +780,6 @@ func newMockLicensesBadModule() Module {
m.AddProperties(&base.nameProperties, &m.properties)
base.generalProperties = m.GetProperties()
- base.customizableProperties = m.GetProperties()
// The default_visibility property needs to be checked and parsed by the visibility module during
// its checking and parsing phases so make it the primary visibility property.
diff --git a/android/module.go b/android/module.go
index 2750131d8..d2c4d402a 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1033,7 +1033,6 @@ func InitAndroidModule(m Module) {
initProductVariableModule(m)
base.generalProperties = m.GetProperties()
- base.customizableProperties = m.GetProperties()
// The default_visibility property needs to be checked and parsed by the visibility module during
// its checking and parsing phases so make it the primary visibility property.
@@ -1217,8 +1216,6 @@ type ModuleBase struct {
// filled with arch specific values by the arch mutator.
archProperties [][]interface{}
- customizableProperties []interface{}
-
// Properties specific to the Blueprint to BUILD migration.
bazelTargetModuleProperties bazel.BazelTargetModuleProperties
diff --git a/android/prebuilt.go b/android/prebuilt.go
index b0a4f434f..22aa94665 100644
--- a/android/prebuilt.go
+++ b/android/prebuilt.go
@@ -183,7 +183,7 @@ type PrebuiltSrcsSupplier func(ctx BaseModuleContext, prebuilt Module) []string
func initPrebuiltModuleCommon(module PrebuiltInterface) *Prebuilt {
p := module.Prebuilt()
module.AddProperties(&p.properties)
- module.base().customizableProperties = module.GetProperties()
+ module.base().generalProperties = module.GetProperties()
return p
}