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

View File

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