From 65942c8467c243c6b8f53e680da3126fedbc3e3b Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Thu, 7 Sep 2023 15:59:42 -0400 Subject: Do not convert java libraries with core_platform Test: go bp2build tests Change-Id: I2769c0d589c304caeb24a8ecba38a4a5ee6c63e5 --- java/java.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 521aef301..967f8c297 100644 --- a/java/java.go +++ b/java/java.go @@ -2904,8 +2904,13 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext) var staticDeps bazel.LabelListAttribute if proptools.String(m.deviceProperties.Sdk_version) == "" && m.DeviceSupported() { + // TODO(b/297356704): handle platform apis in bp2build ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "sdk_version unset") return &javaCommonAttributes{}, &bp2BuildJavaInfo{}, false + } else if proptools.String(m.deviceProperties.Sdk_version) == "core_platform" { + // TODO(b/297356582): handle core_platform in bp2build + ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "sdk_version core_platform") + return &javaCommonAttributes{}, &bp2BuildJavaInfo{}, false } archVariantProps := m.GetArchVariantProperties(ctx, &CommonProperties{}) -- cgit v1.2.3 From 33dddf5a7e4437e61ab5aa122a23a7df8cf2e470 Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Thu, 7 Sep 2023 14:54:41 -0400 Subject: Do not convert resource dirs without resources Previously we would convert to java_resources when there were no resources and get an error. Test: b build //external/libphonenumber/... --config=android Change-Id: I86f30b993a3ffdb20000f6a4c5261e2c4c74263c --- java/java.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 967f8c297..99bb1b3ee 100644 --- a/java/java.go +++ b/java/java.go @@ -2826,7 +2826,7 @@ func (m *Library) convertJavaResourcesAttributes(ctx android.TopDownMutatorConte if resourceStripPrefix == nil && i == 0 { resourceStripPrefix = resAttr.Resource_strip_prefix resources = resAttr.Resources.Value - } else { + } else if !resAttr.Resources.IsEmpty() { ctx.CreateBazelTargetModule( bazel.BazelTargetModuleProperties{ Rule_class: "java_resources", -- cgit v1.2.3