aboutsummaryrefslogtreecommitdiff
path: root/genrule
diff options
context:
space:
mode:
authorJingwen Chen <jingwen@google.com>2021-01-26 21:57:27 -0500
committerJingwen Chen <jingwen@google.com>2021-01-26 21:57:27 -0500
commita42d6417b3cdef35b6c2f9e1aa9f6e8ab51c1499 (patch)
tree5125dbaf7f9f265bb83e82bebab972ae0b72235c /genrule
parent801a6695664a0ff167cc306ac612f79d893f04e5 (diff)
downloadsoong-a42d6417b3cdef35b6c2f9e1aa9f6e8ab51c1499.tar.gz
Make bp2buildMutators registration local to TestContext.
The previous implementation relied on the implicit registration of Bp2Build mutators, resulting in test non-hermeticity. Refactor bp2build tests to explicitly specify the bp2build mutators under test. Test: Soong tests Test: TH Change-Id: I9b9674bad1ea533b3bd31b07077a9e02c99b4c1d
Diffstat (limited to 'genrule')
-rw-r--r--genrule/genrule.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/genrule/genrule.go b/genrule/genrule.go
index 66e5652f7..ddfb4596b 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -47,7 +47,7 @@ func RegisterGenruleBuildComponents(ctx android.RegistrationContext) {
ctx.BottomUp("genrule_tool_deps", toolDepsMutator).Parallel()
})
- android.RegisterBp2BuildMutator("genrule", bp2buildMutator)
+ android.RegisterBp2BuildMutator("genrule", GenruleBp2Build)
}
var (
@@ -794,7 +794,7 @@ func BazelGenruleFactory() android.Module {
return module
}
-func bp2buildMutator(ctx android.TopDownMutatorContext) {
+func GenruleBp2Build(ctx android.TopDownMutatorContext) {
if m, ok := ctx.Module().(*Module); ok {
name := "__bp2build__" + m.Name()
// Bazel only has the "tools" attribute.