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
This commit is contained in:
Liz Kammer
2021-02-17 10:17:28 -05:00
parent ece454400d
commit ea6666fba9
9 changed files with 76 additions and 23 deletions

View File

@@ -49,7 +49,7 @@ func (bfg *bazelFilegroup) GenerateAndroidBuildActions(ctx ModuleContext) {}
func FilegroupBp2Build(ctx TopDownMutatorContext) {
fg, ok := ctx.Module().(*fileGroup)
if !ok || !fg.properties.Bazel_module.Bp2build_available {
if !ok || !fg.ConvertWithBp2build() {
return
}
@@ -77,13 +77,11 @@ type fileGroupProperties struct {
// Create a make variable with the specified name that contains the list of files in the
// filegroup, relative to the root of the source tree.
Export_to_make_var *string
// Properties for Bazel migration purposes.
bazel.Properties
}
type fileGroup struct {
ModuleBase
BazelModuleBase
properties fileGroupProperties
srcs Paths
}
@@ -97,6 +95,7 @@ func FileGroupFactory() Module {
module := &fileGroup{}
module.AddProperties(&module.properties)
InitAndroidModule(module)
InitBazelModule(module)
return module
}