Fix build reports when no kotlin task is executed

#KT-58313: Fixed
This commit is contained in:
Nataliya.Valtman
2023-05-03 17:22:11 +02:00
committed by Space Team
parent 750ff32241
commit 71e81aa30e
4 changed files with 65 additions and 48 deletions
@@ -78,7 +78,7 @@ class FileReportService(
// a bit unfamiliar.
// TODO: If it is confusing, consider renaming "tasks" to "build operations" in this class.
printBuildInfo(startParameters, failureMessages)
if (printMetrics) {
if (printMetrics && statisticsData.isNotEmpty()) {
printMetrics(
statisticsData.map { it.buildTimesMetrics }.reduce { agg, value ->
(agg.keys + value.keys).associateWith { (agg[it] ?: 0) + (value[it] ?: 0) }