mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Handle zero projects more gracefully.
This commit is contained in:
parent
2498284043
commit
c2c4a156de
2 changed files with 23 additions and 17 deletions
|
@ -59,7 +59,6 @@ class BuildListeners : IBuildListener, IBuildReportContributor {
|
|||
fun formatMillisLeft(millis: Long, length: Int) = formatMillis(millis, "%1\$-$length.2f")
|
||||
|
||||
fun millisToSeconds(millis: Long) = (millis.toDouble() / 1000).toInt()
|
||||
val buildTime = millisToSeconds(System.currentTimeMillis() - buildStartTime!!)
|
||||
|
||||
val profiling = args.profiling
|
||||
if (profiling) {
|
||||
|
@ -94,6 +93,11 @@ class BuildListeners : IBuildListener, IBuildReportContributor {
|
|||
// }
|
||||
}
|
||||
|
||||
val buildTime =
|
||||
if (buildStartTime != null)
|
||||
millisToSeconds(System.currentTimeMillis() - buildStartTime!!)
|
||||
else
|
||||
0
|
||||
// BUILD SUCCESSFUL / FAILED message
|
||||
val message =
|
||||
if (hasFailures) {
|
||||
|
|
|
@ -339,26 +339,28 @@ class DynamicGraphExecutor<T>(val graph : DynamicGraph<T>, val factory: IThreadW
|
|||
}
|
||||
|
||||
fun displayRegularLog(table: AsciiTable.Builder) : AsciiTable.Builder {
|
||||
val start = historyLog[0].timestamp
|
||||
val projectStart = ConcurrentHashMap<String, Long>()
|
||||
historyLog.forEach { line ->
|
||||
val row = arrayListOf<String>()
|
||||
row.add(toSeconds(line.timestamp - start))
|
||||
threadIds.keys.forEach {
|
||||
if (line.threadId == it) {
|
||||
var duration = ""
|
||||
if (line.start) {
|
||||
projectStart[line.name] = line.timestamp
|
||||
if (historyLog.any()) {
|
||||
val start = historyLog[0].timestamp
|
||||
val projectStart = ConcurrentHashMap<String, Long>()
|
||||
historyLog.forEach { line ->
|
||||
val row = arrayListOf<String>()
|
||||
row.add(toSeconds(line.timestamp - start))
|
||||
threadIds.keys.forEach {
|
||||
if (line.threadId == it) {
|
||||
var duration = ""
|
||||
if (line.start) {
|
||||
projectStart[line.name] = line.timestamp
|
||||
} else {
|
||||
duration = " (" + ((line.timestamp - projectStart[line.name]!!) / 1000)
|
||||
.toInt().toString() + ")"
|
||||
}
|
||||
row.add((line.name + duration))
|
||||
} else {
|
||||
duration = " (" + ((line.timestamp - projectStart[line.name]!!) / 1000)
|
||||
.toInt().toString() + ")"
|
||||
row.add("")
|
||||
}
|
||||
row.add((line.name + duration))
|
||||
} else {
|
||||
row.add("")
|
||||
}
|
||||
table.addRow(row)
|
||||
}
|
||||
table.addRow(row)
|
||||
}
|
||||
return table
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue