summaryrefslogtreecommitdiff
path: root/android/testing.go
diff options
context:
space:
mode:
author Liz Kammer <eakammer@google.com> 2021-11-01 15:32:43 -0400
committer Liz Kammer <eakammer@google.com> 2021-12-14 09:37:45 -0500
commitbe46fccc404c18f7b90d370835cfa350db1debd7 (patch)
treeaf83853733f28b4ccc8a40c6afc81bb6f1a3463a /android/testing.go
parentd469eefcc30a879c28c440965bbc06683d3a9be3 (diff)
Use one mutator for all bp2build conversion.
Each conversion required defining a separate mutator, which will each operate on _all_ modules and requires each to repeat checks whether the mutator should operator. Instead, we introduce a single mutator and modules can define a ConvertWithBp2build to implement bp2build conversion for that module. Test: bp2build.sh Bug: 183079158 Change-Id: I99d4b51f441c2903879092c5b56313d606d4338d
Diffstat (limited to 'android/testing.go')
-rw-r--r--android/testing.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/android/testing.go b/android/testing.go
index 6290d4317..8daf6b783 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -208,16 +208,6 @@ 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)
-}
-
// PreArchBp2BuildMutators adds mutators to be register for converting Android Blueprint modules
// into Bazel BUILD targets that should run prior to deps and conversion.
func (ctx *TestContext) PreArchBp2BuildMutators(f RegisterMutatorFunc) {
@@ -459,7 +449,7 @@ func (ctx *TestContext) Register() {
// RegisterForBazelConversion prepares a test context for bp2build conversion.
func (ctx *TestContext) RegisterForBazelConversion() {
ctx.SetRunningAsBp2build()
- RegisterMutatorsForBazelConversion(ctx.Context, ctx.bp2buildPreArch, ctx.bp2buildMutators)
+ RegisterMutatorsForBazelConversion(ctx.Context, ctx.bp2buildPreArch)
}
func (ctx *TestContext) ParseFileList(rootDir string, filePaths []string) (deps []string, errs []error) {