1
1
import io.gitlab.arturbosch.detekt.Detekt
2
2
import kotlinx.kover.gradle.plugin.dsl.KoverReportExtension
3
+ import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
4
+ import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
5
+ import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin.Companion.kotlinNodeJsExtension
3
6
import org.jetbrains.kotlin.gradle.targets.js.yarn.yarn
4
7
import java.util.*
5
- import javax.xml.catalog.CatalogFeatures.defaults
6
8
7
9
plugins {
8
- val kotlinVersion = " 1.9 .20-Beta "
10
+ val kotlinVersion = " 2.0 .20-Beta1 "
9
11
kotlin(" multiplatform" ) version kotlinVersion
10
12
// id("dev.petuska.npm.publish") version "2.1.1"
11
13
id(" io.gitlab.arturbosch.detekt" ).version(" 1.23.0-RC2" )
@@ -186,9 +188,9 @@ kotlin {
186
188
187
189
188
190
189
- plugins.withType< org.jetbrains.kotlin.gradle.targets.js.nodejs. NodeJsRootPlugin > {
190
- configure< org.jetbrains.kotlin.gradle.targets.js.nodejs. NodeJsRootExtension > {
191
- nodeVersion = " 18.14.2"
191
+ plugins.withType<NodeJsRootPlugin > {
192
+ configure<NodeJsRootExtension > {
193
+ version = " 18.14.2"
192
194
}
193
195
}
194
196
@@ -209,12 +211,21 @@ kotlin {
209
211
210
212
// workaround for missing sqlite3 bindings
211
213
val bindingsInstall = tasks.register(" sqlite3BindingsInstall" ) {
214
+ doFirst {
215
+
216
+ }
212
217
doLast {
213
218
val sqlite3moduleDir = buildDir.resolve(" js/node_modules/sqlite3" )
214
219
if (! sqlite3moduleDir.resolve(" lib/binding" ).exists()) {
215
220
exec {
216
221
workingDir = sqlite3moduleDir
217
- val commandLine = yarn.yarnSetupTaskProvider.get().destination.absolutePath + " /bin/yarn"
222
+ val yarnPath= " ${yarn.yarnSetupTaskProvider.get().destination.absolutePath} /bin"
223
+ val nodePath= " ${kotlinNodeJsExtension.nodeJsSetupTaskProvider.get().destination.absolutePath} /bin"
224
+ environment(
225
+ " PATH" ,
226
+ System .getenv(" PATH" ) + " :$yarnPath :$nodePath "
227
+ )
228
+ var commandLine = " $yarnPath /yarn"
218
229
commandLine(commandLine)
219
230
}
220
231
}
0 commit comments