summaryrefslogtreecommitdiff
path: root/sh/sh_binary.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 /sh/sh_binary.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 'sh/sh_binary.go')
-rw-r--r--sh/sh_binary.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/sh/sh_binary.go b/sh/sh_binary.go
index a87b9cf4c..2d98e8be0 100644
--- a/sh/sh_binary.go
+++ b/sh/sh_binary.go
@@ -42,8 +42,6 @@ func init() {
pctx.Import("android/soong/android")
registerShBuildComponents(android.InitRegistrationContext)
-
- android.RegisterBp2BuildMutator("sh_binary", ShBinaryBp2Build)
}
func registerShBuildComponents(ctx android.RegistrationContext) {
@@ -540,12 +538,7 @@ type bazelShBinaryAttributes struct {
// visibility
}
-func ShBinaryBp2Build(ctx android.TopDownMutatorContext) {
- m, ok := ctx.Module().(*ShBinary)
- if !ok || !m.ConvertWithBp2build(ctx) {
- return
- }
-
+func (m *ShBinary) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
srcs := bazel.MakeLabelListAttribute(
android.BazelLabelForModuleSrc(ctx, []string{*m.properties.Src}))