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
This commit is contained in:
Sam Delmerico
2022-11-29 11:19:37 -05:00
parent 57b1e4064b
commit 9f9c0a22fa
7 changed files with 283 additions and 5 deletions

View File

@@ -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())