Bp2Build common properties auto-handling
Introduce `commonAttributes` & `fillCommonBp2BuildModuleAttrs used in
CreateBazelTargetModule
Adapt `bp2BuildInfo` to use `commonAttrs` instead of `Name`.
And thus also all downstream users of `CreateBazelTargetModule`.
As initial user, the Soong `required` property will be
translated to Bazel's `data`.
Bug: 198146582, 196091467
Test: build_converstion_test.go:TestCommonBp2BuildModuleAttrs
Test: go test
Test: mixed_{libc,droid}.sh
Change-Id: Ib500e40f7e2cb48c459f1ebe3188962fc41ec124
diff --git a/python/library.go b/python/library.go
index 19fa59a..d136a4e 100644
--- a/python/library.go
+++ b/python/library.go
@@ -45,7 +45,6 @@
type bazelPythonLibraryAttributes struct {
Srcs bazel.LabelListAttribute
- Data bazel.LabelListAttribute
Deps bazel.LabelListAttribute
Srcs_version string
}
@@ -91,7 +90,6 @@
baseAttrs := m.makeArchVariantBaseAttributes(ctx)
attrs := &bazelPythonLibraryAttributes{
Srcs: baseAttrs.Srcs,
- Data: baseAttrs.Data,
Deps: baseAttrs.Deps,
Srcs_version: python_version,
}
@@ -101,7 +99,10 @@
Rule_class: "py_library",
}
- ctx.CreateBazelTargetModule(m.Name(), props, attrs)
+ ctx.CreateBazelTargetModule(props, android.CommonAttributes{
+ Name: m.Name(),
+ Data: baseAttrs.Data,
+ }, attrs)
}
func PythonLibraryFactory() android.Module {