Move bazel.Properties to a BazelModuleBase
This allows more direct access to the bazel label and whether the module
is bp2build available.
Test: go test *
Change-Id: I23375835d20fa53d7d94127b2dc2d5bb20487bfb
diff --git a/cc/cc.go b/cc/cc.go
index 6c1469f..11d8718 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -28,7 +28,6 @@
"github.com/google/blueprint/proptools"
"android/soong/android"
- "android/soong/bazel"
"android/soong/cc/config"
"android/soong/genrule"
)
@@ -365,8 +364,6 @@
// can depend on libraries that are not exported by the APEXes and use private symbols
// from the exported libraries.
Test_for []string
-
- bazel.Properties
}
type VendorProperties struct {
@@ -765,6 +762,7 @@
android.DefaultableModuleBase
android.ApexModuleBase
android.SdkBase
+ android.BazelModuleBase
Properties BaseProperties
VendorProperties VendorProperties
@@ -1054,6 +1052,7 @@
}
android.InitAndroidArchModule(c, c.hod, c.multilib)
+ android.InitBazelModule(c)
android.InitApexModule(c)
android.InitSdkAwareModule(c)
android.InitDefaultableModule(c)
diff --git a/cc/library_headers.go b/cc/library_headers.go
index e5a5557..5b61832 100644
--- a/cc/library_headers.go
+++ b/cc/library_headers.go
@@ -86,7 +86,7 @@
return
}
- if !module.Properties.Bazel_module.Bp2build_available {
+ if !module.ConvertWithBp2build() {
return
}
diff --git a/cc/object.go b/cc/object.go
index d92e110..8f0a310 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -118,7 +118,7 @@
// Bazel equivalent target, plus any necessary include deps for the cc_object.
func ObjectBp2Build(ctx android.TopDownMutatorContext) {
m, ok := ctx.Module().(*Module)
- if !ok || !m.Properties.Bazel_module.Bp2build_available {
+ if !ok || !m.ConvertWithBp2build() {
return
}