diff options
| author | Liz Kammer <eakammer@google.com> | 2021-02-19 11:06:17 -0500 |
|---|---|---|
| committer | Liz Kammer <eakammer@google.com> | 2021-02-23 08:29:40 -0500 |
| commit | fc46bc1ee437f76771fa09af4b2836176b17c3f8 (patch) | |
| tree | 55789d1dbce324a23b928014ae74f8ce17b8524b /sh | |
| parent | ece454400d4f40beb75e8d1773f3d9d684ff6608 (diff) | |
Refactor BazelTargetModule
This eliminates the need to remove quotes, delete attributes, and
re-checking that name has correct prefix. Additionally, this allows
assignment directly to the BazelTargetModuleProperties struct, which
allows defaulting unused fields and clarity of which field is being set.
Test: go test soong tests
Test: ran ./build/bazel/scripts/milestone-2/demo.sh
Change-Id: Ia9bfcce76234c793a4ddd5f29a661150f83341c9
Diffstat (limited to 'sh')
| -rw-r--r-- | sh/sh_binary.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sh/sh_binary.go b/sh/sh_binary.go index 58f8cf69e..3a5c7de99 100644 --- a/sh/sh_binary.go +++ b/sh/sh_binary.go @@ -514,9 +514,11 @@ func ShBinaryBp2Build(ctx android.TopDownMutatorContext) { Srcs: srcs, } - props := bazel.NewBazelTargetModuleProperties(m.Name(), "sh_binary", "") + props := bazel.BazelTargetModuleProperties{ + Rule_class: "sh_binary", + } - ctx.CreateBazelTargetModule(BazelShBinaryFactory, props, attrs) + ctx.CreateBazelTargetModule(BazelShBinaryFactory, m.Name(), props, attrs) } func (m *bazelShBinary) Name() string { |
