Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65942c84 authored by Liz Kammer's avatar Liz Kammer
Browse files

Do not convert java libraries with core_platform

Test: go bp2build tests
Change-Id: I2769c0d589c304caeb24a8ecba38a4a5ee6c63e5
parent 7d885d53
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1046,3 +1046,14 @@ filegroup {
		ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
	})
}

func TestJavaSdkVersionCorePlatformDoesNotConvert(t *testing.T) {
	runJavaLibraryTestCase(t, Bp2buildTestCase{
		Blueprint: `java_library {
    name: "java-lib-1",
    sdk_version: "core_platform",
    bazel_module: { bp2build_available: true },
}`,
		ExpectedBazelTargets: []string{},
	})
}
+5 −0
Original line number Diff line number Diff line
@@ -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{})