diff --git a/buildSrc/plugins/src/main/kotlin/org/jetbrains/kotlin/benchmark/BenchmarkingPlugin.kt b/buildSrc/plugins/src/main/kotlin/org/jetbrains/kotlin/benchmark/BenchmarkingPlugin.kt index 86b306f4622..a6b593d9edb 100644 --- a/buildSrc/plugins/src/main/kotlin/org/jetbrains/kotlin/benchmark/BenchmarkingPlugin.kt +++ b/buildSrc/plugins/src/main/kotlin/org/jetbrains/kotlin/benchmark/BenchmarkingPlugin.kt @@ -51,6 +51,9 @@ internal val Project.konanVersion: String internal val Project.nativeJson: String get() = project.property("nativeJson") as String +internal val Project.jvmJson: String + get() = project.property("jvmJson") as String + internal val Project.commonBenchmarkProperties: Map get() = mapOf( "cpu" to System.getProperty("os.arch"), @@ -148,7 +151,10 @@ open class BenchmarkingPlugin: Plugin { // Native run task. val nativeTarget = kotlin.targets.getByName(NATIVE_TARGET_NAME) as KotlinNativeTarget val nativeExecutable = nativeTarget.binaries.getExecutable(NATIVE_EXECUTABLE_NAME, NativeBuildType.RELEASE) - val konanRun = createRunTask(this, "konanRun", nativeExecutable.runTask!!) + val konanRun = createRunTask(this, "konanRun", nativeExecutable.runTask!!).apply { + group = BENCHMARKING_GROUP + description = "Runs the benchmark for Kotlin/Native." + } // JVM run task. val jvmRun = tasks.create("jvmRun", RunJvmTask::class.java) { task -> @@ -158,6 +164,9 @@ open class BenchmarkingPlugin: Plugin { task.classpath(files(mainCompilation.output.allOutputs, runtimeDependencies)) task.main = "MainKt" + task.group = BENCHMARKING_GROUP + task.description = "Runs the benchmark for Kotlin/JVM." + // Specify settings configured by a user in the benchmark extension. afterEvaluate { task.args( @@ -171,6 +180,10 @@ open class BenchmarkingPlugin: Plugin { // Native report task. val konanJsonReport = tasks.create("konanJsonReport") { + + it.group = BENCHMARKING_GROUP + it.description = "Builds the benchmarking report for Kotlin/Native." + it.doLast { val applicationName = benchmark.applicationName val nativeCompileTime = getNativeCompileTime(applicationName) @@ -192,6 +205,10 @@ open class BenchmarkingPlugin: Plugin { // JVM report task. val jvmJsonReport = tasks.create("jvmJsonReport") { + + it.group = BENCHMARKING_GROUP + it.description = "Builds the benchmarking report for Kotlin/JVM." + it.doLast { val applicationName = benchmark.applicationName val jarPath = (tasks.getByName("jvmJar") as Jar).archiveFile.get().asFile @@ -207,7 +224,7 @@ open class BenchmarkingPlugin: Plugin { ) val output = createJsonReport(properties) - buildDir.resolve(project.property("jvmJson") as String).writeText(output) + buildDir.resolve(jvmJson).writeText(output) } jvmRun.finalizedBy(it) @@ -230,5 +247,7 @@ open class BenchmarkingPlugin: Plugin { const val NATIVE_TARGET_NAME = "native" const val NATIVE_EXECUTABLE_NAME = "benchmark" const val BENCHMARK_EXTENSION_NAME = "benchmark" + + const val BENCHMARKING_GROUP = "benchmarking" } } diff --git a/buildSrc/plugins/src/main/kotlin/org/jetbrains/kotlin/benchmark/CompileBenchmarkingPlugin.kt b/buildSrc/plugins/src/main/kotlin/org/jetbrains/kotlin/benchmark/CompileBenchmarkingPlugin.kt index 0a4dacaeebf..492fc3c8ae5 100644 --- a/buildSrc/plugins/src/main/kotlin/org/jetbrains/kotlin/benchmark/CompileBenchmarkingPlugin.kt +++ b/buildSrc/plugins/src/main/kotlin/org/jetbrains/kotlin/benchmark/CompileBenchmarkingPlugin.kt @@ -35,6 +35,9 @@ open class CompileBenchmarkingPlugin : Plugin { // Aggregate task. val konanRun = tasks.create("konanRun") { task -> task.dependsOn("configureBuild") + + task.group = BenchmarkingPlugin.BENCHMARKING_GROUP + task.description = "Runs the compile only benchmark for Kotlin/Native." } // Compile tasks. @@ -55,6 +58,10 @@ open class CompileBenchmarkingPlugin : Plugin { // Report task. tasks.create("konanJsonReport").apply { + + group = BenchmarkingPlugin.BENCHMARKING_GROUP + description = "Builds the benchmarking report for Kotlin/Native." + doLast { val nativeCompileTime = getCompileBenchmarkTime( applicationName, @@ -81,10 +88,14 @@ open class CompileBenchmarkingPlugin : Plugin { benchmarkExtension: CompileBenchmarkExtension ) { val jvmRun = tasks.create("jvmRun") { + it.group = BenchmarkingPlugin.BENCHMARKING_GROUP + it.description = "Runs the compile only benchmark for Kotlin/JVM." it.doLast { println("JVM run isn't supported") } } tasks.create("jvmJsonReport") { + it.group = BenchmarkingPlugin.BENCHMARKING_GROUP + it.description = "Builds the benchmarking report for Kotlin/Native." it.doLast { println("JVM run isn't supported") } jvmRun.finalizedBy(it) }