Have ConvertWBp2build use Bp2buildMutatorContext

This no-op refactoring facilitates some upcoming functional changes for
"bp2build allowlist v2". The work requires that the bp2build conversion
mutator be changed from a TopDown mutator to a BottomUp mutator.
Refactoring all bp2build-related methods so that they use Bp2buildMutatorContext
makes it easier to make this functional change without touching tens of
files and multiple projects.

Bug: 285631638
Test: m bp2build
Change-Id: I3d1ef3064146e959c6f0dc315350fc9764bf2bd2
This commit is contained in:
Chris Parsons
2023-09-19 20:09:00 +00:00
parent 9e12c78637
commit 637458d326
49 changed files with 132 additions and 129 deletions

View File

@@ -1239,7 +1239,7 @@ type bazelAndroidLibraryImport struct {
Sdk_version bazel.StringAttribute
}
func (a *aapt) convertAaptAttrsWithBp2Build(ctx android.TopDownMutatorContext) (*bazelAapt, bool) {
func (a *aapt) convertAaptAttrsWithBp2Build(ctx android.Bp2buildMutatorContext) (*bazelAapt, bool) {
manifest := proptools.StringDefault(a.aaptProperties.Manifest, "AndroidManifest.xml")
resourceFiles := bazel.LabelList{
@@ -1275,7 +1275,7 @@ func (a *aapt) convertAaptAttrsWithBp2Build(ctx android.TopDownMutatorContext) (
}, true
}
func (a *AARImport) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
func (a *AARImport) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
aars := android.BazelLabelForModuleSrcExcludes(ctx, a.properties.Aars, []string{})
exportableStaticLibs := []string{}
// TODO(b/240716882): investigate and handle static_libs deps that are not imports. They are not supported for export by Bazel.
@@ -1328,7 +1328,7 @@ func AndroidLibraryBazelTargetModuleProperties() bazel.BazelTargetModuleProperti
}
}
func (a *AndroidLibrary) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
func (a *AndroidLibrary) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
commonAttrs, bp2buildInfo, supported := a.convertLibraryAttrsBp2Build(ctx)
if !supported {
return