Skip to content

Commit b7b4e32

Browse files
committed
Get rid of deprecated outputFileProperty
1 parent 75dedc0 commit b7b4e32

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

plugin/main/src/kotlinx/benchmark/gradle/JsEngineExecTasks.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ fun Project.createJsEngineBenchmarkExecTask(
4545
}
4646

4747
private fun Project.getExecutableFile(compilation: KotlinJsIrCompilation): Provider<RegularFile> {
48-
val executableFile = when (val kotlinTarget = compilation.target) {
49-
is KotlinJsIrTarget -> {
50-
val binary = kotlinTarget.binaries.executable(compilation)
51-
.first { it.mode == KotlinJsBinaryMode.PRODUCTION } as JsIrBinary
52-
val outputFile = binary.linkTask.flatMap { it.outputFileProperty }
53-
val destinationDir = binary.linkSyncTask.map { it.destinationDir }
54-
destinationDir.zip(outputFile) { dir, file -> dir.resolve(file.name) }
55-
}
56-
else -> compilation.compileKotlinTaskProvider.flatMap { it.outputFileProperty }
48+
val kotlinTarget = compilation.target as KotlinJsIrTarget
49+
val binary = kotlinTarget.binaries.executable(compilation)
50+
.first { it.mode == KotlinJsBinaryMode.PRODUCTION } as JsIrBinary
51+
val outputFileName = binary.linkTask.flatMap { task ->
52+
task.compilerOptions.moduleName.map { "$it.js" }
5753
}
54+
val destinationDir = binary.linkSyncTask.map { it.destinationDir }
55+
val executableFile = destinationDir.zip(outputFileName) { dir, fileName -> dir.resolve(fileName) }
5856
return project.layout.file(executableFile)
5957
}
6058

0 commit comments

Comments
 (0)