Do not convert android_library_import with no aars.

Bug: 301007952
Change-Id: Ia32d47eeb1a888ea2555d5ca08f56f191c040bc7
This commit is contained in:
Romain Jobredeaux
2023-09-21 11:07:30 -04:00
parent 68a3d9b33e
commit afc5d27ab0
2 changed files with 30 additions and 11 deletions

View File

@@ -1276,6 +1276,10 @@ func (a *aapt) convertAaptAttrsWithBp2Build(ctx android.Bp2buildMutatorContext)
}
func (a *AARImport) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
if len(a.properties.Aars) == 0 {
ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "aars can't be empty")
return
}
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.