Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update KSP, Kotlin coroutines and Kotlin serialization #76

Merged
merged 4 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 29 additions & 53 deletions buildSrc/src/main/kotlin/JsConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,22 @@
*/

import org.gradle.api.Project
import org.gradle.kotlin.dsl.the
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsTargetDsl
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinWasmJsTargetDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension


inline fun KotlinJsTargetDsl.configJs(
nodeJs: Boolean = true,
browser: Boolean = true,
block: () -> Unit = {}
) {
if (nodeJs) {
nodejs()
// {
//// testTask {
//// useMocha {
//// timeout = "10000"
//// }
//// }
// }
}

if (browser) {
browser()
// {
// testTask{
// useKarma {
// useChromeHeadless()
// // useConfigDirectory(File(project.rootProject.projectDir, "karma"))
// }
// }
// }
nodejs {
testTask {
useMocha {
timeout = "10000"
}
}
}
}

binaries.library()
Expand All @@ -59,30 +42,24 @@ inline fun KotlinJsTargetDsl.configJs(
fun Project.configJsTestTasks() {
// val shouldRunJsBrowserTest = !hasProperty("teamcity") || hasProperty("enable-js-tests")
// if (shouldRunJsBrowserTest) return
tasks.findByName("cleanJsBrowserTest")?.apply {
onlyIf { false }
}
tasks.findByName("jsBrowserTest")?.apply {
onlyIf { false }
}
// tasks.findByName("cleanJsBrowserTest")?.apply {
// onlyIf { false }
// }
// tasks.findByName("jsBrowserTest")?.apply {
// onlyIf { false }
// }
}

inline fun KotlinWasmJsTargetDsl.configWasmJs(
nodeJs: Boolean = true,
browser: Boolean = true,
block: () -> Unit = {}
) {
if (nodeJs && isLinux) {
// win in candy node `21.0.0-v8-canary202309143a48826a08` is not supported
// nodejs()
}

if (browser) {
browser {
testTask{
useKarma {
useChromeHeadless()
// useConfigDirectory(File(project.rootProject.projectDir, "karma"))
nodejs {
testTask {
useMocha {
timeout = "10000"
}
}
}
Expand All @@ -93,18 +70,17 @@ inline fun KotlinWasmJsTargetDsl.configWasmJs(
}

inline fun Project.configWasmJsTest(block: () -> Unit = {}) {
if (false) {
// 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
rootProject.the<NodeJsRootExtension>().apply {
// nodeVersion = "21.0.0-v8-canary202309143a48826a08"
version = "21.0.0-v8-canary202309143a48826a08"
downloadBaseUrl = "https://nodejs.org/download/v8-canary"
}

tasks.withType<org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask>().configureEach {
args.add("--ignore-engines")
}
}

// if (false) {
// // 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
// rootProject.the<NodeJsRootExtension>().apply {
// // nodeVersion = "21.0.0-v8-canary202309143a48826a08"
// version = "21.0.0-v8-canary202309143a48826a08"
// downloadBaseUrl = "https://nodejs.org/download/v8-canary"
// }
//
// tasks.withType<org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask>().configureEach {
// args.add("--ignore-engines")
// }
// }
block()
}
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlin = "2.0.20"
kotlinx-coroutines = "1.8.1"
kotlinx-serialization = "1.7.1"
kotlinx-coroutines = "1.9.0"
kotlinx-serialization = "1.7.3"
kotlinx-datetime = "0.6.1"
dokka = "1.9.20"
ktor = "2.3.12"
Expand All @@ -13,7 +13,7 @@ simbot = "4.6.0"
suspendTransform = "2.0.20-0.9.3"
gradleCommon = "0.6.0"
# ksp
ksp = "2.0.10-1.0.24"
ksp = "2.0.20-1.0.25"
# https://square.github.io/kotlinpoet/
kotlinPoet = "2.0.0"
# https://mockk.io/
Expand Down
Loading
Loading