Skip to content

Commit

Permalink
Fix Gradle tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
TadeasKriz committed Jul 29, 2024
1 parent e52e0fd commit 8b6671c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
14 changes: 14 additions & 0 deletions SKIE/common/configuration/annotations/impl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,20 @@ kotlin {

@targets@

sourceSets.commonMain {
dependencies {
compileOnly(kotlin("stdlib-common"))
}
}

sourceSets["jvmMain"].dependencies {
compileOnly(kotlin("stdlib"))
}

sourceSets["jsMain"].dependencies {
compileOnly(kotlin("stdlib-js"))
}

// jvm()
// js {
// browser()
Expand Down
1 change: 1 addition & 0 deletions SKIE/runtime/kotlin/impl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ kotlin {

sourceSets.commonMain {
dependencies {
compileOnly(kotlin("stdlib-common"))
@dependencies@
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import co.touchlab.skie.test.runner.BuildConfiguration
import co.touchlab.skie.test.util.KotlinTarget
import co.touchlab.skie.test.util.KotlinVersion
import co.touchlab.skie.test.util.LinkMode
import co.touchlab.skie.test.util.coroutinesVersion
import co.touchlab.skie.test.util.needsOldLinker
import org.intellij.lang.annotations.Language

Expand Down Expand Up @@ -142,7 +143,7 @@ class BuildGradleBuilder(
fun includeCoroutinesDependency() {
"sourceSets.commonMain" {
"dependencies" {
+"""implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")"""
+"""implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${kotlinVersion.coroutinesVersion}")"""
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@ package co.touchlab.skie.test.util

val KotlinVersion.needsOldLinker: Boolean
get() = value.startsWith("1.8.") || value.startsWith("1.9.0")

val KotlinVersion.coroutinesVersion: String
get() = when {
value.startsWith("2.0.") -> "1.9.0-RC"
value.startsWith("1.9.2") -> "1.8.1"
value.startsWith("1.9.") || value.startsWith("1.8.2") -> "1.7.3"
value.startsWith("1.8.") -> "1.6.4"
else -> error("Coroutines version not assigned for Kotlin version $value")
}

0 comments on commit 8b6671c

Please sign in to comment.