From 5463c9326b3d4e70c921b1a0a1a228788ad72b61 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 7 Jun 2023 15:14:13 +0300 Subject: [PATCH] Add gc to wasm --- gradle/libs.versions.toml | 2 +- .../space/kscience/gradle/KScienceExtension.kt | 2 +- .../kscience/gradle/KScienceProjectPlugin.kt | 15 ++++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5a49166..257c55c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -tools = "0.14.9-kotlin-1.9.0-Beta" +tools = "0.14.9-kotlin-1.9.0-Beta-dev-3" kotlin = "1.9.0-Beta" atomicfu = "0.20.2" binary-compatibility-validator = "0.13.1" diff --git a/src/main/kotlin/space/kscience/gradle/KScienceExtension.kt b/src/main/kotlin/space/kscience/gradle/KScienceExtension.kt index d3b2bc9..44dde80 100644 --- a/src/main/kotlin/space/kscience/gradle/KScienceExtension.kt +++ b/src/main/kotlin/space/kscience/gradle/KScienceExtension.kt @@ -437,7 +437,7 @@ public open class KScienceMppExtension(project: Project) : KScienceExtension(pro testTask { useKarma { this.webpackConfig.experiments.add("topLevelAwait") - useChromeHeadless() + useChromeHeadlessWasmGc() useConfigDirectory(project.projectDir.resolve("karma.config.d").resolve("wasm")) } } diff --git a/src/main/kotlin/space/kscience/gradle/KScienceProjectPlugin.kt b/src/main/kotlin/space/kscience/gradle/KScienceProjectPlugin.kt index 2b73d9e..4e1dda3 100644 --- a/src/main/kotlin/space/kscience/gradle/KScienceProjectPlugin.kt +++ b/src/main/kotlin/space/kscience/gradle/KScienceProjectPlugin.kt @@ -12,6 +12,9 @@ import org.jetbrains.changelog.ChangelogPlugin import org.jetbrains.changelog.ChangelogPluginExtension import org.jetbrains.dokka.gradle.AbstractDokkaTask import org.jetbrains.dokka.gradle.DokkaPlugin +import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockMismatchReport +import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin +import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension import space.kscience.gradle.internal.* /** @@ -104,8 +107,8 @@ public open class KScienceProjectPlugin : Plugin { apply() apply() - allprojects{ - repositories{ + allprojects { + repositories { mavenCentral() maven("https://repo.kotlin.link") maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev") @@ -250,9 +253,11 @@ public open class KScienceProjectPlugin : Plugin { } } - plugins.withType(org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin::class.java) { - rootProject.the().lockFileDirectory = - rootDir.resolve("gradle") + plugins.withType() { + rootProject.configure { + lockFileDirectory = rootDir.resolve("gradle") + yarnLockMismatchReport = YarnLockMismatchReport.WARNING + } } }