Skip to content

Commit 288d094

Browse files
authored
Merge pull request #76 from simple-robot/dev/upgrade
Update KSP, Kotlin coroutines and Kotlin serialization
2 parents 53a3ad9 + 00cc98d commit 288d094

File tree

4 files changed

+47
-1522
lines changed

4 files changed

+47
-1522
lines changed

buildSrc/src/main/kotlin/JsConfig.kt

Lines changed: 29 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,22 @@
1616
*/
1717

1818
import org.gradle.api.Project
19-
import org.gradle.kotlin.dsl.the
20-
import org.gradle.kotlin.dsl.withType
2119
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsTargetDsl
2220
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinWasmJsTargetDsl
23-
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
2421

2522

2623
inline fun KotlinJsTargetDsl.configJs(
2724
nodeJs: Boolean = true,
28-
browser: Boolean = true,
2925
block: () -> Unit = {}
3026
) {
3127
if (nodeJs) {
32-
nodejs()
33-
// {
34-
//// testTask {
35-
//// useMocha {
36-
//// timeout = "10000"
37-
//// }
38-
//// }
39-
// }
40-
}
41-
42-
if (browser) {
43-
browser()
44-
// {
45-
// testTask{
46-
// useKarma {
47-
// useChromeHeadless()
48-
// // useConfigDirectory(File(project.rootProject.projectDir, "karma"))
49-
// }
50-
// }
51-
// }
28+
nodejs {
29+
testTask {
30+
useMocha {
31+
timeout = "10000"
32+
}
33+
}
34+
}
5235
}
5336

5437
binaries.library()
@@ -59,30 +42,24 @@ inline fun KotlinJsTargetDsl.configJs(
5942
fun Project.configJsTestTasks() {
6043
// val shouldRunJsBrowserTest = !hasProperty("teamcity") || hasProperty("enable-js-tests")
6144
// if (shouldRunJsBrowserTest) return
62-
tasks.findByName("cleanJsBrowserTest")?.apply {
63-
onlyIf { false }
64-
}
65-
tasks.findByName("jsBrowserTest")?.apply {
66-
onlyIf { false }
67-
}
45+
// tasks.findByName("cleanJsBrowserTest")?.apply {
46+
// onlyIf { false }
47+
// }
48+
// tasks.findByName("jsBrowserTest")?.apply {
49+
// onlyIf { false }
50+
// }
6851
}
6952

7053
inline fun KotlinWasmJsTargetDsl.configWasmJs(
7154
nodeJs: Boolean = true,
72-
browser: Boolean = true,
7355
block: () -> Unit = {}
7456
) {
7557
if (nodeJs && isLinux) {
7658
// win in candy node `21.0.0-v8-canary202309143a48826a08` is not supported
77-
// nodejs()
78-
}
79-
80-
if (browser) {
81-
browser {
82-
testTask{
83-
useKarma {
84-
useChromeHeadless()
85-
// useConfigDirectory(File(project.rootProject.projectDir, "karma"))
59+
nodejs {
60+
testTask {
61+
useMocha {
62+
timeout = "10000"
8663
}
8764
}
8865
}
@@ -93,18 +70,17 @@ inline fun KotlinWasmJsTargetDsl.configWasmJs(
9370
}
9471

9572
inline fun Project.configWasmJsTest(block: () -> Unit = {}) {
96-
if (false) {
97-
// see https://youtrack.jetbrains.com/issue/KT-63014/Running-tests-with-wasmJs-in-1.9.20-requires-Chrome-Canary#focus=Comments-27-8321383.0-0
98-
rootProject.the<NodeJsRootExtension>().apply {
99-
// nodeVersion = "21.0.0-v8-canary202309143a48826a08"
100-
version = "21.0.0-v8-canary202309143a48826a08"
101-
downloadBaseUrl = "https://nodejs.org/download/v8-canary"
102-
}
103-
104-
tasks.withType<org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask>().configureEach {
105-
args.add("--ignore-engines")
106-
}
107-
}
108-
73+
// if (false) {
74+
// // see https://youtrack.jetbrains.com/issue/KT-63014/Running-tests-with-wasmJs-in-1.9.20-requires-Chrome-Canary#focus=Comments-27-8321383.0-0
75+
// rootProject.the<NodeJsRootExtension>().apply {
76+
// // nodeVersion = "21.0.0-v8-canary202309143a48826a08"
77+
// version = "21.0.0-v8-canary202309143a48826a08"
78+
// downloadBaseUrl = "https://nodejs.org/download/v8-canary"
79+
// }
80+
//
81+
// tasks.withType<org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask>().configureEach {
82+
// args.add("--ignore-engines")
83+
// }
84+
// }
10985
block()
11086
}

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[versions]
22
kotlin = "2.0.20"
3-
kotlinx-coroutines = "1.8.1"
4-
kotlinx-serialization = "1.7.1"
3+
kotlinx-coroutines = "1.9.0"
4+
kotlinx-serialization = "1.7.3"
55
kotlinx-datetime = "0.6.1"
66
dokka = "1.9.20"
77
ktor = "2.3.12"
@@ -13,7 +13,7 @@ simbot = "4.6.0"
1313
suspendTransform = "2.0.20-0.9.3"
1414
gradleCommon = "0.6.0"
1515
# ksp
16-
ksp = "2.0.10-1.0.24"
16+
ksp = "2.0.20-1.0.25"
1717
# https://square.github.io/kotlinpoet/
1818
kotlinPoet = "2.0.0"
1919
# https://mockk.io/

0 commit comments

Comments
 (0)