1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-27 00:38:11 -07:00

IncrementalManager logging level.

This commit is contained in:
Cedric Beust 2016-03-30 01:43:34 -08:00
parent 57c421ebc6
commit b8fffe9aca

View file

@ -93,14 +93,14 @@ class IncrementalManager(val fileName: String = IncrementalManager.BUILD_INFO_FI
if (outputChecksum == taskOutputChecksum) { if (outputChecksum == taskOutputChecksum) {
upToDate = true upToDate = true
} else { } else {
logIncremental(3, "Incremental task $taskName output is out of date, running it") logIncremental(LEVEL, "Incremental task $taskName output is out of date, running it")
} }
} }
} else { } else {
if (dependsOnDirtyProjects) { if (dependsOnDirtyProjects) {
logIncremental(3, "Project ${project.name} depends on dirty project, running $taskName") logIncremental(LEVEL, "Project ${project.name} depends on dirty project, running $taskName")
} else { } else {
logIncremental(3, "Incremental task $taskName input is out of date, running it" logIncremental(LEVEL, "Incremental task $taskName input is out of date, running it"
+ " old: $inputChecksum new: ${iit.inputChecksum}") + " old: $inputChecksum new: ${iit.inputChecksum}")
} }
project.projectExtra.isDirty = true project.projectExtra.isDirty = true
@ -109,24 +109,26 @@ class IncrementalManager(val fileName: String = IncrementalManager.BUILD_INFO_FI
if (! upToDate) { if (! upToDate) {
val result = iit.task(project) val result = iit.task(project)
if (result.success) { if (result.success) {
logIncremental(3, "Incremental task $taskName done running, saving checksums") logIncremental(LEVEL, "Incremental task $taskName done running, saving checksums")
iit.inputChecksum?.let { iit.inputChecksum?.let {
saveInputChecksum(taskName, it) saveInputChecksum(taskName, it)
logIncremental(3, " input checksum \"$it\" saved") logIncremental(LEVEL, " input checksum \"$it\" saved")
} }
// Important to rerun the checksum here since the output of the task might have changed it // Important to rerun the checksum here since the output of the task might have changed it
val os = iit.outputChecksum()
iit.outputChecksum()?.let { iit.outputChecksum()?.let {
saveOutputChecksum(taskName, it) saveOutputChecksum(taskName, it)
logIncremental(3, " output checksum \"$it\" saved") logIncremental(LEVEL, " output checksum \"$it\" saved")
} }
} }
result result
} else { } else {
logIncremental(3, "Incremental task \"$taskName\" is up to date, not running it") logIncremental(LEVEL, "Incremental task \"$taskName\" is up to date, not running it")
TaskResult() TaskResult()
} }
} }
} }
val LEVEL = 3
private fun logIncremental(level: Int, s: String) = log(level, " INC - $s") private fun logIncremental(level: Int, s: String) = log(level, " INC - $s")
} }