From 0b03d9701b532836fb72392cba46f676796f4c07 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 13 May 2019 11:06:25 -0700 Subject: [PATCH] Add kotlin-stdlib-jdk8 when using Kotlin kotlin-stdlib-jdk8 contains extensions to the Kotlin standard library for use when targeting Java language level 8. Test: m checkbuild Change-Id: Iac5f977f9080d8e0e2402b08a992a93c909744e9 --- java/java.go | 5 +++-- java/testing.go | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/java/java.go b/java/java.go index 866b33c03..3fa850067 100644 --- a/java/java.go +++ b/java/java.go @@ -517,7 +517,8 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { if j.hasSrcExt(".kt") { // TODO(ccross): move this to a mutator pass that can tell if generated sources contain // Kotlin files - ctx.AddVariationDependencies(nil, kotlinStdlibTag, "kotlin-stdlib") + ctx.AddVariationDependencies(nil, kotlinStdlibTag, + "kotlin-stdlib", "kotlin-stdlib-jdk7", "kotlin-stdlib-jdk8") if len(j.properties.Plugins) > 0 { ctx.AddVariationDependencies(nil, kotlinAnnotationsTag, "kotlin-annotations") } @@ -793,7 +794,7 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { deps.staticResourceJars = append(deps.staticResourceJars, dep.(*AndroidApp).exportPackage) } case kotlinStdlibTag: - deps.kotlinStdlib = dep.HeaderJars() + deps.kotlinStdlib = append(deps.kotlinStdlib, dep.HeaderJars()...) case kotlinAnnotationsTag: deps.kotlinAnnotations = dep.HeaderJars() } diff --git a/java/testing.go b/java/testing.go index 1be3768b5..22831c922 100644 --- a/java/testing.go +++ b/java/testing.go @@ -44,6 +44,8 @@ func GatherRequiredDepsForTest() string { "core.current.stubs", "core.platform.api.stubs", "kotlin-stdlib", + "kotlin-stdlib-jdk7", + "kotlin-stdlib-jdk8", "kotlin-annotations", }