Add MutatorName to mutator contexts

Follow https://github.com/google/blueprint/pull/255.

Bug: 136473661
Test: m checkbuild
Change-Id: Ia74d442c925689fa1e06a70c2acfed925063f844
This commit is contained in:
Colin Cross
2019-07-01 15:32:31 -07:00
parent fa07821d88
commit cb55e089f0

View File

@@ -117,6 +117,8 @@ type TopDownMutator func(TopDownMutatorContext)
type TopDownMutatorContext interface { type TopDownMutatorContext interface {
BaseModuleContext BaseModuleContext
MutatorName() string
Rename(name string) Rename(name string)
CreateModule(blueprint.ModuleFactory, ...interface{}) CreateModule(blueprint.ModuleFactory, ...interface{})
@@ -132,6 +134,8 @@ type BottomUpMutator func(BottomUpMutatorContext)
type BottomUpMutatorContext interface { type BottomUpMutatorContext interface {
BaseModuleContext BaseModuleContext
MutatorName() string
Rename(name string) Rename(name string)
AddDependency(module blueprint.Module, tag blueprint.DependencyTag, name ...string) AddDependency(module blueprint.Module, tag blueprint.DependencyTag, name ...string)
@@ -229,6 +233,10 @@ func (t *topDownMutatorContext) PrependProperties(props ...interface{}) {
// non-overridden method has to be forwarded. There are fewer non-overridden methods, so use the latter. The following // non-overridden method has to be forwarded. There are fewer non-overridden methods, so use the latter. The following
// methods forward to the identical blueprint versions for topDownMutatorContext and bottomUpMutatorContext. // methods forward to the identical blueprint versions for topDownMutatorContext and bottomUpMutatorContext.
func (t *topDownMutatorContext) MutatorName() string {
return t.bp.MutatorName()
}
func (t *topDownMutatorContext) Rename(name string) { func (t *topDownMutatorContext) Rename(name string) {
t.bp.Rename(name) t.bp.Rename(name)
} }
@@ -237,6 +245,10 @@ func (t *topDownMutatorContext) CreateModule(factory blueprint.ModuleFactory, pr
t.bp.CreateModule(factory, props...) t.bp.CreateModule(factory, props...)
} }
func (b *bottomUpMutatorContext) MutatorName() string {
return b.bp.MutatorName()
}
func (b *bottomUpMutatorContext) Rename(name string) { func (b *bottomUpMutatorContext) Rename(name string) {
b.bp.Rename(name) b.bp.Rename(name)
} }