Merge "Removal of unused methods AppendProperties and PrependProperties from topDownMutatorContext"
This commit is contained in:
@@ -1300,6 +1300,8 @@ func (m *ModuleBase) ComponentDepsMutator(BottomUpMutatorContext) {}
|
|||||||
|
|
||||||
func (m *ModuleBase) DepsMutator(BottomUpMutatorContext) {}
|
func (m *ModuleBase) DepsMutator(BottomUpMutatorContext) {}
|
||||||
|
|
||||||
|
// AddProperties "registers" the provided props
|
||||||
|
// each value in props MUST be a pointer to a struct
|
||||||
func (m *ModuleBase) AddProperties(props ...interface{}) {
|
func (m *ModuleBase) AddProperties(props ...interface{}) {
|
||||||
m.registerProps = append(m.registerProps, props...)
|
m.registerProps = append(m.registerProps, props...)
|
||||||
}
|
}
|
||||||
|
@@ -529,28 +529,6 @@ func (t *topDownMutatorContext) CreateBazelTargetModule(
|
|||||||
mod.base().addBp2buildInfo(info)
|
mod.base().addBp2buildInfo(info)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *topDownMutatorContext) appendPrependHelper(props []interface{},
|
|
||||||
extendFn func([]interface{}, interface{}, proptools.ExtendPropertyFilterFunc) error) {
|
|
||||||
for _, p := range props {
|
|
||||||
err := extendFn(t.Module().base().customizableProperties, p, nil)
|
|
||||||
if err != nil {
|
|
||||||
if propertyErr, ok := err.(*proptools.ExtendPropertyError); ok {
|
|
||||||
t.PropertyErrorf(propertyErr.Property, "%s", propertyErr.Err.Error())
|
|
||||||
} else {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *topDownMutatorContext) AppendProperties(props ...interface{}) {
|
|
||||||
t.appendPrependHelper(props, proptools.AppendMatchingProperties)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *topDownMutatorContext) PrependProperties(props ...interface{}) {
|
|
||||||
t.appendPrependHelper(props, proptools.PrependMatchingProperties)
|
|
||||||
}
|
|
||||||
|
|
||||||
// android.topDownMutatorContext either has to embed blueprint.TopDownMutatorContext, in which case every method that
|
// android.topDownMutatorContext either has to embed blueprint.TopDownMutatorContext, in which case every method that
|
||||||
// has an overridden version in android.BaseModuleContext has to be manually forwarded to BaseModuleContext to avoid
|
// has an overridden version in android.BaseModuleContext has to be manually forwarded to BaseModuleContext to avoid
|
||||||
// ambiguous method errors, or it has to store a blueprint.TopDownMutatorContext non-embedded, in which case every
|
// ambiguous method errors, or it has to store a blueprint.TopDownMutatorContext non-embedded, in which case every
|
||||||
|
Reference in New Issue
Block a user