From 21eb22d1178b55227c6b3ba04873bf38c0331cfb Mon Sep 17 00:00:00 2001 From: Art Shendrik Date: Mon, 4 Mar 2024 21:39:48 +0000 Subject: [PATCH] feat: output relative paths for the merged report files in the log Signed-off-by: Art Shendrik --- CHANGELOG.md | 1 + .../kotlin/fluxo/conf/MergeDetektBaselinesTask.kt | 3 ++- .../main/kotlin/fluxo/test/TestReportsMergeTask.kt | 11 ++++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff3f853e..07cd3b48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Changed - return the plugin artifact shrinking with R8 (saved 32.719%, 265.9 KB). - update compatibility methods `NamedDomainObjectSet.named*` for Gradle 8.6+ and older. +- output relative paths for the merged report files in the log. ### Added - self-apply the plugin to itself immediately with included build. diff --git a/fluxo-kmp-conf/src/main/kotlin/fluxo/conf/MergeDetektBaselinesTask.kt b/fluxo-kmp-conf/src/main/kotlin/fluxo/conf/MergeDetektBaselinesTask.kt index b4a7cb8b..b7af32aa 100644 --- a/fluxo-kmp-conf/src/main/kotlin/fluxo/conf/MergeDetektBaselinesTask.kt +++ b/fluxo-kmp-conf/src/main/kotlin/fluxo/conf/MergeDetektBaselinesTask.kt @@ -93,6 +93,7 @@ internal abstract class MergeDetektBaselinesTask : DefaultTask() { val outputFile = outputFile.ioFile bp.write(targetPath = outputFile.toPath(), baseline = sorted) - logger.l("Merged Detekt baseline files to ${outputFile.absolutePath}") + val fileRelative = outputFile.absoluteFile.relativeTo(project.projectDir) + logger.l("Merged Detekt baseline files to $fileRelative") } } diff --git a/fluxo-kmp-conf/src/main/kotlin/fluxo/test/TestReportsMergeTask.kt b/fluxo-kmp-conf/src/main/kotlin/fluxo/test/TestReportsMergeTask.kt index 3bcd6f50..78a1029a 100644 --- a/fluxo-kmp-conf/src/main/kotlin/fluxo/test/TestReportsMergeTask.kt +++ b/fluxo-kmp-conf/src/main/kotlin/fluxo/test/TestReportsMergeTask.kt @@ -175,16 +175,17 @@ internal abstract class TestReportsMergeTask : DefaultTask() { val now = System.currentTimeMillis() val totalSuccesses = totalTests - totalFailures - totalSkipped val status = getStatusFrom(totalFailures, totalSuccesses) - val summary = "Overall tests result: $status (" + + val fileRelative = outputFile.absoluteFile.relativeTo(project.projectDir) + val summary = "Overall tests result: $status" + + " in ${TimeCategory.minus(Date(now), Date(now - totalTimeMillis))}" + + "\n(" + "$totalTests tests, " + "$totalSuccesses successes, " + "$totalFailures failures, " + "$totalSkipped skipped, " + "${kmpTargets.size} KMP targets" + - ") " + - "in ${TimeCategory.minus(Date(now), Date(now - totalTimeMillis))}" + - "\n" + - "Merged XML tests report to $outputFile" + ")\n" + + "Merged XML tests report to $fileRelative" logger.lifecycle(formatSummary(summary, fails))