Merge "bp2build: add allowlist for package-level conversions."

This commit is contained in:
Jingwen Chen
2021-03-24 21:38:07 +00:00
committed by Gerrit Code Review
20 changed files with 409 additions and 57 deletions

View File

@@ -158,12 +158,17 @@ func (ctx *TestContext) FinalDepsMutators(f RegisterMutatorFunc) {
ctx.finalDeps = append(ctx.finalDeps, f)
}
func (ctx *TestContext) RegisterBp2BuildConfig(config Bp2BuildConfig) {
ctx.config.bp2buildPackageConfig = config
}
// RegisterBp2BuildMutator registers a BazelTargetModule mutator for converting a module
// type to the equivalent Bazel target.
func (ctx *TestContext) RegisterBp2BuildMutator(moduleType string, m func(TopDownMutatorContext)) {
f := func(ctx RegisterMutatorsContext) {
ctx.TopDown(moduleType, m)
}
ctx.config.bp2buildModuleTypeConfig[moduleType] = true
ctx.bp2buildMutators = append(ctx.bp2buildMutators, f)
}