Skip to content

Commit 3be08f3

Browse files
Abduqodiri Qurbonzodaqurbonzoda
authored andcommitted
Replace usages of deprecated linkTask in plugin when configuring Native benchmark compilation
1 parent 3572c2c commit 3be08f3

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ private fun Project.createNativeBenchmarkCompileTask(target: NativeBenchmarkTarg
8888
this.compilation = benchmarkCompilation
8989
this.outputDirectory = file("$benchmarkBuildDir/classes")
9090
// A link task's name is linkReleaseExecutable<Target>.
91-
linkTask.apply {
92-
group = BenchmarksPlugin.BENCHMARKS_TASK_GROUP
93-
description = "Compile Native benchmark source files for '${compilationTarget.name}'"
94-
dependsOn(generateSourceTaskName(target))
91+
linkTaskProvider.configure {
92+
it.apply {
93+
group = BenchmarksPlugin.BENCHMARKS_TASK_GROUP
94+
description = "Compile Native benchmark source files for '${compilationTarget.name}'"
95+
dependsOn(generateSourceTaskName(target))
96+
}
9597
}
96-
tasks.getByName(BenchmarksPlugin.ASSEMBLE_BENCHMARKS_TASKNAME).dependsOn(linkTask)
98+
tasks.getByName(BenchmarksPlugin.ASSEMBLE_BENCHMARKS_TASKNAME).dependsOn(linkTaskProvider)
9799
entryPoint("kotlinx.benchmark.generated.main")
98100
}
99101
}
@@ -117,11 +119,11 @@ fun Project.createNativeBenchmarkExecTask(
117119

118120
val binary =
119121
benchmarkCompilation.target.binaries.getExecutable(benchmarkCompilation.name, target.buildType)
120-
val linkTask = binary.linkTask
122+
val linkTask = binary.linkTaskProvider
121123

122124
dependsOn(linkTask)
123125

124-
val executableFile = linkTask.outputFile.get()
126+
val executableFile = linkTask.get().outputFile.get()
125127
onlyIf { executableFile.exists() }
126128

127129
this.executable = executableFile

0 commit comments

Comments
 (0)