Add do not convert for sdk_version unset
When sdk_version is unset, the build with fail with Bazel because
private APIs are do not build with Bazel at this time.
This instead prevents migrating the relevant target to Bazel in bp2build
Test: go tests
Change-Id: I31dabcf143de7933706d1b734ef21467a01b65e9
diff --git a/java/java.go b/java/java.go
index 4b01c31..6c448a2 100644
--- a/java/java.go
+++ b/java/java.go
@@ -2905,6 +2905,11 @@
var deps bazel.LabelListAttribute
var staticDeps bazel.LabelListAttribute
+ if proptools.String(m.deviceProperties.Sdk_version) == "" && m.DeviceSupported() {
+ ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "sdk_version unset")
+ return &javaCommonAttributes{}, &bp2BuildJavaInfo{}, false
+ }
+
archVariantProps := m.GetArchVariantProperties(ctx, &CommonProperties{})
for axis, configToProps := range archVariantProps {
for config, _props := range configToProps {