Recompile only files from last iteration after compile error

This commit is contained in:
Alexey Tsvetkov
2017-12-07 05:04:10 +03:00
parent 3914c1b0e9
commit 0fee7883ed
18 changed files with 359 additions and 2 deletions
@@ -118,7 +118,7 @@ abstract class IncrementalCompilerRunner<
}.filterTo(dirtyFiles, File::isKotlinFile)
if (dirtySourcesSinceLastTimeFile.exists()) {
val files = dirtySourcesSinceLastTimeFile.readLines().map(::File).filter(File::exists)
val files = dirtySourcesSinceLastTimeFile.readLines().map(::File)
if (files.isNotEmpty()) {
reporter.report { "Source files added since last compilation: ${reporter.pathsAsString(files)}" }
}
@@ -206,7 +206,7 @@ abstract class IncrementalCompilerRunner<
// todo: more optimal to save only last iteration, but it will require adding standalone-ic specific logs
// (because jps rebuilds all files from last build if it failed and gradle rebuilds everything)
allSourcesToCompile.addAll(sourcesToCompile)
val text = allSourcesToCompile.joinToString(separator = System.getProperty("line.separator")) { it.canonicalPath }
val text = dirtySources.joinToString(separator = System.getProperty("line.separator")) { it.canonicalPath }
dirtySourcesSinceLastTimeFile.writeText(text)
val services = makeServices(args, lookupTracker, expectActualTracker, caches, compilationMode).build()