@@ -6,7 +6,6 @@ import org.gradle.api.file.RegularFile
6
6
import org.gradle.api.provider.Provider
7
7
import org.gradle.api.tasks.TaskProvider
8
8
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
9
- import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation
10
9
import org.jetbrains.kotlin.gradle.targets.js.d8.D8Exec
11
10
import org.jetbrains.kotlin.gradle.targets.js.dsl.*
12
11
import org.jetbrains.kotlin.gradle.targets.js.ir.*
@@ -15,13 +14,11 @@ import org.jetbrains.kotlin.gradle.targets.js.nodejs.*
15
14
fun Project.createJsEngineBenchmarkExecTask (
16
15
config : BenchmarkConfiguration ,
17
16
target : BenchmarkTarget ,
18
- compilation : KotlinJsCompilation
17
+ compilation : KotlinJsIrCompilation
19
18
) {
20
19
val taskName = " ${target.name}${config.capitalizedName()}${BenchmarksPlugin .BENCHMARK_EXEC_SUFFIX } "
21
20
val compilationTarget = compilation.target
22
21
23
- check(compilation is KotlinJsIrCompilation ) { " Legacy Kotlin/JS backend is not supported. Please migrate to the Kotlin/JS IR compiler backend." }
24
-
25
22
if (compilationTarget is KotlinJsSubTargetContainerDsl ) {
26
23
compilationTarget.whenNodejsConfigured {
27
24
val execTask = createNodeJsExec(config, target, compilation, taskName)
@@ -40,7 +37,7 @@ fun Project.createJsEngineBenchmarkExecTask(
40
37
}
41
38
}
42
39
43
- private fun Project.getExecutableFile (compilation : KotlinJsCompilation ): Provider <RegularFile > {
40
+ private fun Project.getExecutableFile (compilation : KotlinJsIrCompilation ): Provider <RegularFile > {
44
41
val executableFile = when (val kotlinTarget = compilation.target) {
45
42
is KotlinJsIrTarget -> {
46
43
val binary = kotlinTarget.binaries.executable(compilation)
@@ -54,7 +51,7 @@ private fun Project.getExecutableFile(compilation: KotlinJsCompilation): Provide
54
51
return project.layout.file(executableFile)
55
52
}
56
53
57
- private val KotlinJsCompilation .isWasmCompilation: Boolean get() =
54
+ private val KotlinJsIrCompilation .isWasmCompilation: Boolean get() =
58
55
target.platformType == KotlinPlatformType .wasm
59
56
60
57
private fun MutableList<String>.addWasmArguments () {
@@ -70,7 +67,7 @@ private fun MutableList<String>.addJsArguments() {
70
67
private fun Project.createNodeJsExec (
71
68
config : BenchmarkConfiguration ,
72
69
target : BenchmarkTarget ,
73
- compilation : KotlinJsCompilation ,
70
+ compilation : KotlinJsIrCompilation ,
74
71
taskName : String
75
72
): TaskProvider <NodeJsExec > = NodeJsExec .create(compilation, taskName) {
76
73
if (compilation.target.platformType == KotlinPlatformType .wasm) {
0 commit comments