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

Merge pull request #302 from DevCharly/master

Completed synchronization for the incremental manager.
This commit is contained in:
Cedric Beust 2016-08-04 08:05:58 -07:00 committed by GitHub
commit 896b133d66

View file

@ -56,18 +56,18 @@ class IncrementalManager @Inject constructor(val args: Args, @Assisted val fileN
val bi = BuildInfo(map.values.toList())
val json = GsonBuilder().setPrettyPrinting().create().toJson(bi)
synchronized(BUILD_INFO_FILE) {
Files.write(Paths.get(fileName), json.toByteArray(Charset.defaultCharset()))
}
Files.write(Paths.get(fileName), json.toByteArray(Charset.defaultCharset()))
}
private fun taskInfoFor(taskInfos: HashMap<String, TaskInfo>, taskName: String)
= taskInfos.getOrPut(taskName, { -> TaskInfo(taskName) })
fun saveInputChecksum(taskName: String, inputChecksum: String) {
with(taskInfos()) {
taskInfoFor(this, taskName).inputChecksum = inputChecksum
save(this)
synchronized(BUILD_INFO_FILE) {
with(taskInfos()) {
taskInfoFor(this, taskName).inputChecksum = inputChecksum
save(this)
}
}
}