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/cc/object.go b/cc/object.go
index d92e110..3a7af97 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -150,13 +150,12 @@
Local_include_dirs: localIncludeDirs,
}
- props := bazel.NewBazelTargetModuleProperties(
- m.Name(),
- "cc_object",
- "//build/bazel/rules:cc_object.bzl",
- )
+ props := bazel.BazelTargetModuleProperties{
+ Rule_class: "cc_object",
+ Bzl_load_location: "//build/bazel/rules:cc_object.bzl",
+ }
- ctx.CreateBazelTargetModule(BazelObjectFactory, props, attrs)
+ ctx.CreateBazelTargetModule(BazelObjectFactory, m.Name(), props, attrs)
}
func (object *objectLinker) appendLdflags(flags []string) {