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/android/filegroup.go b/android/filegroup.go
index 674a196..c3bf6f8 100644
--- a/android/filegroup.go
+++ b/android/filegroup.go
@@ -57,9 +57,9 @@
Srcs: BazelLabelForModuleSrcExcludes(ctx, fg.properties.Srcs, fg.properties.Exclude_srcs),
}
- props := bazel.NewBazelTargetModuleProperties(fg.Name(), "filegroup", "")
+ props := bazel.BazelTargetModuleProperties{Rule_class: "filegroup"}
- ctx.CreateBazelTargetModule(BazelFileGroupFactory, props, attrs)
+ ctx.CreateBazelTargetModule(BazelFileGroupFactory, fg.Name(), props, attrs)
}
type fileGroupProperties struct {