Skip to content

Commit

Permalink
Get rid of setupV8 nodejs part
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgonmic authored and qodana-bot committed Nov 19, 2024
1 parent 4f4b460 commit 55ddc9e
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 38 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
plugins {
`kotlin-dsl`
id("org.jetbrains.kotlin.jvm")
}

repositories {
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
mavenCentral()
gradlePluginPortal()

extra["bootstrapKotlinRepo"]?.let {
maven(url = it)
}
}

kotlin {
jvmToolchain(8)

compilerOptions {
allWarningsAsErrors.set(true)
}
}

dependencies {
compileOnly(kotlin("stdlib", embeddedKotlinVersion))
compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import org.jetbrains.kotlin.build.nodejs.NodeJsExtension
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin

val nodeJsRoot = NodeJsRootPlugin.apply(project.rootProject)

extensions.create<NodeJsExtension>(
"nodeJsKotlinBuild",
nodeJsRoot,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/

package org.jetbrains.kotlin.build.nodejs

import org.gradle.api.tasks.testing.Test
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension

abstract class NodeJsExtension(
private val nodeJsRoot: NodeJsRootExtension
) {
@Suppress("DEPRECATION")
fun Test.setupNodeJs() {
dependsOn(nodeJsRoot.nodeJsSetupTaskProvider)
val nodeJsExecutablePath = project.provider {
nodeJsRoot.requireConfigured().nodeExecutable
}
doFirst {
systemProperty("javascript.engine.path.NodeJs", nodeJsExecutablePath.get())
}
}
}
3 changes: 2 additions & 1 deletion repo/gradle-build-conventions/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ include(":binary-compatibility-extended")
include(":gradle-plugins-documentation")
include(":gradle-plugins-common")
include(":d8-configuration")
include(":binaryen-configuration")
include(":binaryen-configuration")
include(":nodejs-configuration")
7 changes: 5 additions & 2 deletions wasm/wasm.tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import java.net.URI
import com.github.gradle.node.npm.task.NpmTask
import org.jetbrains.kotlin.build.binaryen.BinaryenExtension
import org.jetbrains.kotlin.build.d8.D8Extension
import org.jetbrains.kotlin.build.nodejs.NodeJsExtension
import java.nio.file.Files
import java.util.*

Expand All @@ -12,6 +13,7 @@ plugins {
alias(libs.plugins.gradle.node)
id("d8-configuration")
id("binaryen-configuration")
id("nodejs-configuration")
}

node {
Expand Down Expand Up @@ -126,7 +128,6 @@ dependencies {

val generationRoot = projectDir.resolve("tests-gen")

useNodeJsPlugin()
optInToExperimentalCompilerApi()

sourceSets {
Expand Down Expand Up @@ -283,7 +284,9 @@ fun Project.wasmProjectTest(
with(project.the<D8Extension>()) {
setupV8()
}
setupNodeJs()
with(project.the<NodeJsExtension>()) {
setupNodeJs()
}
with(project.the<BinaryenExtension>()) {
setupBinaryen()
}
Expand Down

0 comments on commit 55ddc9e

Please sign in to comment.