Mark android_* modules with java_resources as unconvertible

Change-Id: I9da921feaf9edb5fe7d1b1cb733494f90d8c64b3
BUG: 300470246
This commit is contained in:
Alix
2023-08-29 16:01:46 +00:00
parent 8d3ea47ec1
commit ee51bd6588
2 changed files with 16 additions and 0 deletions

View File

@@ -1635,6 +1635,15 @@ type bazelAndroidAppAttributes struct {
Proguard_specs bazel.LabelListAttribute
}
func (b bazelAapt) ConvertJavaResources(ctx android.Bp2buildMutatorContext, javaAttrs *javaCommonAttributes) bool {
// TODO (b/300470246) bp2build support for java_resources & java_resource_dirs in android rules
hasJavaResources := !javaAttrs.javaResourcesAttributes.Resources.IsEmpty()
if hasJavaResources {
ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_UNSUPPORTED, "(b/300470246) java resources in android_* module")
}
return hasJavaResources
}
func convertWithBp2build(ctx android.Bp2buildMutatorContext, a *AndroidApp) (bool, android.CommonAttributes, *bazelAndroidAppAttributes) {
aapt, supported := a.convertAaptAttrsWithBp2Build(ctx)
if !supported {
@@ -1727,6 +1736,10 @@ func convertWithBp2build(ctx android.Bp2buildMutatorContext, a *AndroidApp) (boo
if !supported {
return false, android.CommonAttributes{}, &bazelAndroidAppAttributes{}
}
if hasJavaResources := aapt.ConvertJavaResources(ctx, commonAttrs); hasJavaResources {
return false, android.CommonAttributes{}, &bazelAndroidAppAttributes{}
}
depLabels := bp2BuildInfo.DepLabels
deps := depLabels.Deps