From b7873edf3083ca471a889a67ffdcf12667d4f980 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Mon, 20 Aug 2018 23:39:46 +0300 Subject: [PATCH] Pill: Fix issue with clashing sdk-common.jar and sdk-common-26.1.2.jar Move sdk-common.jar to the end of the classpath --- buildSrc/src/main/kotlin/pill/plugin.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/pill/plugin.kt b/buildSrc/src/main/kotlin/pill/plugin.kt index b9a9d66d0bf..0293abc9736 100644 --- a/buildSrc/src/main/kotlin/pill/plugin.kt +++ b/buildSrc/src/main/kotlin/pill/plugin.kt @@ -48,7 +48,13 @@ class JpsCompatiblePlugin : Plugin { DependencyMapper("org.jetbrains.kotlin", "kotlin-compiler-embeddable", "runtimeJar") { null }, DependencyMapper("org.jetbrains.kotlin", "kotlin-stdlib-js", "distJar") { null }, DependencyMapper("org.jetbrains.kotlin", "kotlin-compiler", "runtimeJar") { null }, - DependencyMapper("org.jetbrains.kotlin", "compiler", "runtimeElements") { null } + DependencyMapper("org.jetbrains.kotlin", "compiler", "runtimeElements") { null }, + DependencyMapper("kotlin.build.custom.deps", "android", "default") { dep -> + val (sdkCommon, otherJars) = dep.moduleArtifacts.map { it.file }.partition { it.name == "sdk-common.jar" } + val mainLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName, otherJars)) + val deferredLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName + "-deferred", sdkCommon)) + MappedDependency(mainLibrary, listOf(deferredLibrary)) + } ) }