Merge "Update CreateModule to require a type name" am: 5208ee885c
am: 6d5c00183d
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2075941 Change-Id: If31dc33089fcf58c3a5f59aa3bd8b1658bb54862 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
fdf38ed489
2 changed files with 6 additions and 5 deletions
|
@ -461,17 +461,17 @@ func createTestMutator(ctx TopDownMutatorContext) {
|
|||
Deps []string
|
||||
}
|
||||
|
||||
ctx.CreateModule(newBarModule, &props{
|
||||
ctx.CreateModule(newBarModule, "new_bar", &props{
|
||||
Name: "B",
|
||||
Deps: []string{"D"},
|
||||
})
|
||||
|
||||
ctx.CreateModule(newBarModule, &props{
|
||||
ctx.CreateModule(newBarModule, "new_bar", &props{
|
||||
Name: "C",
|
||||
Deps: []string{"D"},
|
||||
})
|
||||
|
||||
ctx.CreateModule(newFooModule, &props{
|
||||
ctx.CreateModule(newFooModule, "new_foo", &props{
|
||||
Name: "D",
|
||||
})
|
||||
}
|
||||
|
|
|
@ -836,7 +836,7 @@ type TopDownMutatorContext interface {
|
|||
|
||||
// CreateModule creates a new module by calling the factory method for the specified moduleType, and applies
|
||||
// the specified property structs to it as if the properties were set in a blueprint file.
|
||||
CreateModule(ModuleFactory, ...interface{}) Module
|
||||
CreateModule(ModuleFactory, string, ...interface{}) Module
|
||||
}
|
||||
|
||||
type BottomUpMutatorContext interface {
|
||||
|
@ -1201,13 +1201,14 @@ func (mctx *mutatorContext) Rename(name string) {
|
|||
mctx.rename = append(mctx.rename, rename{mctx.module.group, name})
|
||||
}
|
||||
|
||||
func (mctx *mutatorContext) CreateModule(factory ModuleFactory, props ...interface{}) Module {
|
||||
func (mctx *mutatorContext) CreateModule(factory ModuleFactory, typeName string, props ...interface{}) Module {
|
||||
module := newModule(factory)
|
||||
|
||||
module.relBlueprintsFile = mctx.module.relBlueprintsFile
|
||||
module.pos = mctx.module.pos
|
||||
module.propertyPos = mctx.module.propertyPos
|
||||
module.createdBy = mctx.module
|
||||
module.typeName = typeName
|
||||
|
||||
for _, p := range props {
|
||||
err := proptools.AppendMatchingProperties(module.properties, p, nil)
|
||||
|
|
Loading…
Reference in a new issue