Fix JVM/JS library dependency extensions

This commit is contained in:
Alexander Nozik 2019-12-17 20:22:43 +03:00
parent c700515d3f
commit 99fdcfe60d
2 changed files with 9 additions and 10 deletions

View File

@ -7,7 +7,7 @@ plugins {
}
group = "scientifik"
version = "0.3.0"
version = "0.3.1"
repositories {
gradlePluginPortal()

View File

@ -6,7 +6,6 @@ import org.gradle.api.Project
import org.gradle.kotlin.dsl.findByType
import org.gradle.kotlin.dsl.invoke
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
internal fun Project.useDependency(vararg pairs: Pair<String, String>) {
pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") {
@ -25,9 +24,8 @@ internal fun Project.useDependency(vararg pairs: Pair<String, String>) {
pairs.find { it.first == "jvmMain" }?.let { dep ->
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
sourceSets.findByName("main")?.apply {
this as KotlinSourceSet
dependencies {
implementation(dep)
dependencies.apply{
add(implementationConfigurationName, dep.second)
}
}
}
@ -36,9 +34,10 @@ internal fun Project.useDependency(vararg pairs: Pair<String, String>) {
pairs.find { it.first == "jsMain" }?.let { dep ->
pluginManager.withPlugin("org.jetbrains.kotlin.js") {
sourceSets.findByName("main")?.apply {
this as KotlinSourceSet
dependencies {
implementation(dep)
sourceSets.findByName("main")?.apply {
dependencies.apply{
add(implementationConfigurationName, dep.second)
}
}
}
}