A kludgy way to get the native to properly compile when in intellij IDE

This commit is contained in:
Ugljesa Jovanovic 2020-01-05 20:41:58 +01:00
parent cb7ca575ab
commit 84799b4ede
No known key found for this signature in database
GPG Key ID: 178E6DFCECCB0E0F
2 changed files with 33 additions and 7 deletions

View File

@ -49,7 +49,12 @@ repositories {
group = "com.ionspin.kotlin" group = "com.ionspin.kotlin"
version = "0.0.3-SNAPSHOT" version = "0.0.3-SNAPSHOT"
val ideaActive = System.getProperty("idea.active") == "true"
kotlin { kotlin {
if (ideaActive) {
linuxX64("native")
}
jvm() jvm()
js { js {
compilations { compilations {
@ -194,15 +199,35 @@ kotlin {
implementation(kotlin("test-js")) implementation(kotlin("test-js"))
} }
} }
val nativeMain = if (ideaActive) {
val nativeMain by getting {
dependsOn(commonMain)
}
nativeMain
} else {
val nativeMain by creating { val nativeMain by creating {
dependsOn(commonMain) dependsOn(commonMain)
} }
nativeMain
}
val nativeTest = if (ideaActive) {
val nativeTest by getting {
dependsOn(commonTest)
dependencies {
implementation(Deps.Native.coroutines)
}
}
nativeTest
} else {
val nativeTest by creating { val nativeTest by creating {
dependsOn(commonTest) dependsOn(commonTest)
dependencies { dependencies {
implementation(Deps.Native.coroutines) implementation(Deps.Native.coroutines)
} }
} }
nativeTest
}
val iosMain by getting { val iosMain by getting {
dependsOn(nativeMain) dependsOn(nativeMain)

View File

@ -24,6 +24,7 @@ import kotlin.test.assertTrue
* ugljesa.jovanovic@ionspin.com * ugljesa.jovanovic@ionspin.com
* on 05-Jan-2020 * on 05-Jan-2020
*/ */
@ExperimentalUnsignedTypes
class SRNGJsTest { class SRNGJsTest {
@Test @Test