From 9f9c0a22faedef806fd3c35e047e1d5a0e313718 Mon Sep 17 00:00:00 2001 From: Sam Delmerico Date: Tue, 29 Nov 2022 11:19:37 -0500 Subject: transitive Java deps for r8 The -libraryjars argument to r8 was missing transitive dependencies, and so complained when there were classes used in the program JAR which were not provided via libraries. This CL propagates transitive dependencies to the r8 command to reduce the warnings that are generated for missing classes. Bug: 242088131 Change-Id: Ifad7bc7c5d406e3de8d98ea963c97e88c84b45a1 --- java/kotlin_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'java/kotlin_test.go') diff --git a/java/kotlin_test.go b/java/kotlin_test.go index 491ce2939..933fc5187 100644 --- a/java/kotlin_test.go +++ b/java/kotlin_test.go @@ -44,6 +44,10 @@ func TestKotlin(t *testing.T) { kotlinStdlib := ctx.ModuleForTests("kotlin-stdlib", "android_common"). Output("turbine-combined/kotlin-stdlib.jar").Output + kotlinStdlibJdk7 := ctx.ModuleForTests("kotlin-stdlib-jdk7", "android_common"). + Output("turbine-combined/kotlin-stdlib-jdk7.jar").Output + kotlinStdlibJdk8 := ctx.ModuleForTests("kotlin-stdlib-jdk8", "android_common"). + Output("turbine-combined/kotlin-stdlib-jdk8.jar").Output kotlinAnnotations := ctx.ModuleForTests("kotlin-annotations", "android_common"). Output("turbine-combined/kotlin-annotations.jar").Output @@ -79,6 +83,16 @@ func TestKotlin(t *testing.T) { fooJar.Inputs.Strings(), kotlinStdlib.String()) } + if !inList(kotlinStdlibJdk7.String(), fooJar.Inputs.Strings()) { + t.Errorf("foo jar inputs %v does not contain %v", + fooJar.Inputs.Strings(), kotlinStdlibJdk7.String()) + } + + if !inList(kotlinStdlibJdk8.String(), fooJar.Inputs.Strings()) { + t.Errorf("foo jar inputs %v does not contain %v", + fooJar.Inputs.Strings(), kotlinStdlibJdk8.String()) + } + if !inList(kotlinAnnotations.String(), fooJar.Inputs.Strings()) { t.Errorf("foo jar inputs %v does not contain %v", fooJar.Inputs.Strings(), kotlinAnnotations.String()) -- cgit v1.2.3-59-g8ed1b