Add non Incremental reason to build scan
This commit is contained in:
+2
-1
@@ -66,7 +66,8 @@ class KotlinBuildEsStatListener(val projectName: String, val reportStatistics :
|
||||
val compileStatData = CompileStatData(
|
||||
duration = duration, taskResult = taskResult.name, label = label,
|
||||
statData = statData, projectName = projectName, taskName = taskPath, changes = changes,
|
||||
tags = taskExecutionResult?.taskInfo?.properties?.map { it.name } ?: emptyList()
|
||||
tags = taskExecutionResult?.taskInfo?.properties?.map { it.name } ?: emptyList(),
|
||||
nonIncrementalAttributes = taskExecutionResult?.buildMetrics?.buildAttributes?.asMap()?.mapKeys { (key, _) -> key.name }?: emptyMap()
|
||||
)
|
||||
reportStatistics.forEach { it.report(compileStatData) }
|
||||
}
|
||||
|
||||
+1
@@ -14,6 +14,7 @@ data class CompileStatData(
|
||||
val duration: Long,
|
||||
val tags: List<String>,
|
||||
val changes: List<String>,
|
||||
val nonIncrementalAttributes: Map<String, Int>,
|
||||
val statData: Map<String, Long>
|
||||
)
|
||||
|
||||
|
||||
+4
@@ -13,5 +13,9 @@ import org.jetbrains.kotlin.gradle.plugin.stat.ReportStatistics
|
||||
class ReportStatisticsToBuildScan(val buildScan: BuildScanExtension) : ReportStatistics {
|
||||
override fun report(data: CompileStatData) {
|
||||
buildScan.value(data.taskName, Gson().toJson(data).toString())
|
||||
val keys = data.nonIncrementalAttributes.filterValues { it > 0 }.keys.joinToString()
|
||||
if (keys.isNotEmpty()) {
|
||||
buildScan.value("${data.taskName}_nonIncremental", keys)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user