mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Format correctly.
This commit is contained in:
parent
6401a9d2af
commit
ffd641310d
1 changed files with 7 additions and 2 deletions
|
@ -76,10 +76,15 @@ class BuildListeners : IBuildListener, IBuildReportContributor {
|
|||
|
||||
}
|
||||
|
||||
// Calculate the longest short message so we can create a column long enough to contain it
|
||||
val width = 12 + (projectInfos.values.map { it.shortMessage?.length ?: 0 }.maxBy { it } ?: 0)
|
||||
|
||||
fun col1(s: String) = String.format(" %1\$-30s", s)
|
||||
fun col2(s: String) = String.format(" %1\$-13s", s)
|
||||
fun col2(s: String) = String.format(" %1\$-${width}s", s)
|
||||
fun col3(s: String) = String.format(" %1\$-8s", s)
|
||||
|
||||
|
||||
|
||||
// Only print the build report if there is more than one project and at least one of them failed
|
||||
if (timings.any()) {
|
||||
// if (timings.size > 1 && hasFailures) {
|
||||
|
@ -89,7 +94,7 @@ class BuildListeners : IBuildListener, IBuildReportContributor {
|
|||
table.append(AsciiArt.logBox(listOf(line), AsciiArt.bottomLeft2, AsciiArt.bottomRight2, indent = 10) + "\n")
|
||||
projectStatuses.forEach { pair ->
|
||||
val projectName = pair.first.name
|
||||
val cl = listOf(col1(projectName), col2(pair.second.toString()),
|
||||
val cl = listOf(col1(projectName), col2(pair.second),
|
||||
col3(formatMillisLeft(projectInfos[projectName]!!.durationMillis, 8)))
|
||||
.joinToString(AsciiArt.verticalBar)
|
||||
table.append(" " + AsciiArt.verticalBar + " " + cl + " " + AsciiArt.verticalBar + "\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue