[gradle-plugin] Pass only klib dependencies to the compiler

Fix for KT-28205.
This commit is contained in:
Ilya Matveev
2018-11-15 15:02:44 +07:00
committed by Ilya Matveev
parent 1ec506d0b1
commit e5ab2c71fb
3 changed files with 13 additions and 2 deletions
@@ -108,7 +108,9 @@ open class CInteropTask @Inject constructor(val settings: CInteropSettingsImpl):
addArgs("-copt", allHeadersDirs.map { "-I${it.absolutePath}" })
addArgs("-headerFilterAdditionalSearchPrefix", headerFilterDirs.map { it.absolutePath })
libraries.files.forEach {
libraries.files.filter {
it.extension == "klib"
}.forEach {
addArg("-l", it.absolutePath)
}
@@ -158,7 +158,9 @@ open class KotlinNativeCompile @Inject constructor(internal val binary: Abstract
addAll(additionalCompilerOptions)
libraries.files.forEach {
libraries.files.filter {
it.extension == "klib"
}.forEach {
addArg("-l", it.absolutePath)
}
@@ -932,6 +932,11 @@ class ExperimentalPluginTests {
kotlin {
sourceSets {
commonMain {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-common'
}
}
wasmMain {
dependencies {
implementation 'test:native-producer:1.0'
@@ -973,6 +978,8 @@ class ExperimentalPluginTests {
repositories {
maven { url '$repoPath' }
maven { url "${MultiplatformSpecification.KOTLIN_REPO}" }
jcenter()
}
sourceSets.main.component {