Skip to content

Commit 166916d

Browse files
Abduqodiri Qurbonzodaqurbonzoda
authored andcommitted
fixup! Fix compiler warning: Accessing task instance directly is deprecated
1 parent f3c7b71 commit 166916d

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,20 @@ private fun Project.createJsBenchmarkCompileTask(target: JsBenchmarkTarget): Kot
4646
)
4747
}
4848

49-
compileTaskProvider.get().apply {
50-
group = BenchmarksPlugin.BENCHMARKS_TASK_GROUP
51-
description = "Compile JS benchmark source files for '${target.name}'"
49+
compileTaskProvider.configure {
50+
it.apply {
51+
group = BenchmarksPlugin.BENCHMARKS_TASK_GROUP
52+
description = "Compile JS benchmark source files for '${target.name}'"
5253

53-
//TODO: fix destination dir after KT-29711 is fixed
54-
//println("JS: ${kotlinOptions.outputFile}")
55-
//destinationDir = file("$benchmarkBuildDir/classes")
56-
dependsOn("${target.name}${BenchmarksPlugin.BENCHMARK_GENERATE_SUFFIX}")
54+
//TODO: fix destination dir after KT-29711 is fixed
55+
//println("JS: ${kotlinOptions.outputFile}")
56+
//destinationDir = file("$benchmarkBuildDir/classes")
57+
dependsOn("${target.name}${BenchmarksPlugin.BENCHMARK_GENERATE_SUFFIX}")
5758

58-
kotlinOptions.apply {
59-
sourceMap = true
60-
moduleKind = "umd"
59+
kotlinOptions.apply {
60+
sourceMap = true
61+
moduleKind = "umd"
62+
}
6163
}
6264
}
6365
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private fun Project.createNativeBenchmarkCompileTask(target: NativeBenchmarkTarg
6262
// a link task. So we disable execution the klib compiling task to save time.
6363
// benchmarkCompilation.compileKotlinTask.enabled = false
6464

65-
benchmarkCompilation.compileTaskProvider.get().dependsOn(generateSourceTaskName(target))
65+
benchmarkCompilation.compileTaskProvider.configure { it.dependsOn(generateSourceTaskName(target)) }
6666

6767
benchmarkCompilation.apply {
6868
val sourceSet = kotlinSourceSets.single()

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ private fun Project.createWasmBenchmarkCompileTask(target: WasmBenchmarkTarget):
4242
)
4343
}
4444
}
45-
compileTaskProvider.get().apply {
46-
group = BenchmarksPlugin.BENCHMARKS_TASK_GROUP
47-
description = "Compile Wasm benchmark source files for '${target.name}'"
48-
dependsOn("${target.name}${BenchmarksPlugin.BENCHMARK_GENERATE_SUFFIX}")
45+
compileTaskProvider.configure {
46+
it.apply {
47+
group = BenchmarksPlugin.BENCHMARKS_TASK_GROUP
48+
description = "Compile Wasm benchmark source files for '${target.name}'"
49+
dependsOn("${target.name}${BenchmarksPlugin.BENCHMARK_GENERATE_SUFFIX}")
50+
}
4951
}
5052
}
5153
return benchmarkCompilation

0 commit comments

Comments
 (0)