Merge "Remove customizableProperties from android.ModuleBase" am: 9eab2ef9a4 am: 1df75fdde5

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1929304

Change-Id: I2304139fa9d39b12948521f683f8baa2a5412829
This commit is contained in:
Usta Shrestha 2022-01-05 23:14:30 +00:00 committed by Automerger Merge Worker
commit f92eb6e8d2
8 changed files with 6 additions and 14 deletions

View file

@ -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

View file

@ -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.

View file

@ -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())

View file

@ -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)

View file

@ -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)

View file

@ -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.

View file

@ -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

View file

@ -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
}