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
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user