From 1f3b237c49addfc29c57e260f32d42a87502dac4 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Mon, 22 Jul 2019 18:57:47 +0300 Subject: [PATCH] late dependency inclusion for mpp --- .../kotlin/scientifik/ScientifikMPPlugin.kt | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/kotlin/scientifik/ScientifikMPPlugin.kt b/src/main/kotlin/scientifik/ScientifikMPPlugin.kt index e590843..4abf98d 100644 --- a/src/main/kotlin/scientifik/ScientifikMPPlugin.kt +++ b/src/main/kotlin/scientifik/ScientifikMPPlugin.kt @@ -66,11 +66,13 @@ open class ScientifikMPPlugin : Plugin { val jvmMain by getting { dependencies { api(kotlin("stdlib-jdk8")) - if(extension.atomicfu){ - implementation("org.jetbrains.kotlinx:atomicfu:${Scientifik.atomicfuVersion}") - } - if(extension.io){ - api("org.jetbrains.kotlinx:kotlinx-io-jvm:${Scientifik.ioVersion}") + project.afterEvaluate { + if (extension.atomicfu) { + implementation("org.jetbrains.kotlinx:atomicfu:${Scientifik.atomicfuVersion}") + } + if (extension.io) { + api("org.jetbrains.kotlinx:kotlinx-io-jvm:${Scientifik.ioVersion}") + } } } } @@ -83,11 +85,13 @@ open class ScientifikMPPlugin : Plugin { val jsMain by getting { dependencies { api(kotlin("stdlib-js")) - if(extension.atomicfu){ - implementation("org.jetbrains.kotlinx:atomicfu-common-js:${Scientifik.atomicfuVersion}") - } - if(extension.io){ - api("org.jetbrains.kotlinx:kotlinx-io-js:${Scientifik.ioVersion}") + project.afterEvaluate { + if (extension.atomicfu) { + implementation("org.jetbrains.kotlinx:atomicfu-common-js:${Scientifik.atomicfuVersion}") + } + if (extension.io) { + api("org.jetbrains.kotlinx:kotlinx-io-js:${Scientifik.ioVersion}") + } } } }