Merge "Register singletons in api_bp2build"
This commit is contained in:
commit
c74bf95708
1 changed files with 10 additions and 9 deletions
|
@ -165,29 +165,30 @@ func NewContext(config Config) *Context {
|
|||
return ctx
|
||||
}
|
||||
|
||||
// RegisterForBazelConversion registers an alternate shadow pipeline of
|
||||
// singletons, module types and mutators to register for converting Blueprint
|
||||
// files to semantically equivalent BUILD files.
|
||||
func (ctx *Context) RegisterForBazelConversion() {
|
||||
// Helper function to register the module types used in bp2build and
|
||||
// api_bp2build.
|
||||
func registerModuleTypes(ctx *Context) {
|
||||
for _, t := range moduleTypes {
|
||||
t.register(ctx)
|
||||
}
|
||||
|
||||
// Required for SingletonModule types, even though we are not using them.
|
||||
for _, t := range singletons {
|
||||
t.register(ctx)
|
||||
}
|
||||
}
|
||||
|
||||
// RegisterForBazelConversion registers an alternate shadow pipeline of
|
||||
// singletons, module types and mutators to register for converting Blueprint
|
||||
// files to semantically equivalent BUILD files.
|
||||
func (ctx *Context) RegisterForBazelConversion() {
|
||||
registerModuleTypes(ctx)
|
||||
RegisterMutatorsForBazelConversion(ctx, bp2buildPreArchMutators)
|
||||
}
|
||||
|
||||
// RegisterForApiBazelConversion is similar to RegisterForBazelConversion except that
|
||||
// it only generates API targets in the generated workspace
|
||||
func (ctx *Context) RegisterForApiBazelConversion() {
|
||||
for _, t := range moduleTypes {
|
||||
t.register(ctx)
|
||||
}
|
||||
|
||||
registerModuleTypes(ctx)
|
||||
RegisterMutatorsForApiBazelConversion(ctx, bp2buildPreArchMutators)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue