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
diff --git a/genrule/genrule.go b/genrule/genrule.go
index 9fa6c48..c743fc3 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -853,10 +853,12 @@
Tools: tools,
}
- props := bazel.NewBazelTargetModuleProperties(m.Name(), "genrule", "")
+ props := bazel.BazelTargetModuleProperties{
+ Rule_class: "genrule",
+ }
// Create the BazelTargetModule.
- ctx.CreateBazelTargetModule(BazelGenruleFactory, props, attrs)
+ ctx.CreateBazelTargetModule(BazelGenruleFactory, m.Name(), props, attrs)
}
func (m *bazelGenrule) Name() string {