diff --git a/build.gradle.kts b/build.gradle.kts index 7c63207..598002d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "scientifik" -version = "0.3.0" +version = "0.3.1" repositories { gradlePluginPortal() diff --git a/src/main/kotlin/scientifik/extensions.kt b/src/main/kotlin/scientifik/extensions.kt index 3d56b66..758298d 100644 --- a/src/main/kotlin/scientifik/extensions.kt +++ b/src/main/kotlin/scientifik/extensions.kt @@ -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) { pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") { @@ -24,11 +23,10 @@ internal fun Project.useDependency(vararg pairs: Pair) { } pairs.find { it.first == "jvmMain" }?.let { dep -> pluginManager.withPlugin("org.jetbrains.kotlin.jvm") { - sourceSets.findByName("main")?.apply { - this as KotlinSourceSet - dependencies { - implementation(dep) - } + sourceSets.findByName("main")?.apply { + dependencies.apply{ + add(implementationConfigurationName, dep.second) + } } } } @@ -36,9 +34,10 @@ internal fun Project.useDependency(vararg pairs: Pair) { 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) + } } } }