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()
@@ -0,0 +1,28 @@
================ Step #1 =================
Compiling files:
src/A.kt
src/B.kt
src/companionExtension.kt
src/companionReferenceExplicit.kt
src/companionReferenceImplicit.kt
src/importedMember.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?
================ Step #2 =================
Compiling files:
src/A.kt
src/companionExtension.kt
src/companionReferenceExplicit.kt
src/companionReferenceImplicit.kt
src/importedMember.kt
End of files
Exit code: OK
@@ -0,0 +1,26 @@
================ Step #1 =================
Compiling files:
src/A.kt
src/companionExtension.kt
src/companionReferenceExplicit.kt
src/companionReferenceImplicit.kt
src/importedMember.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?
================ Step #2 =================
Compiling files:
src/companionExtension.kt
src/companionReferenceExplicit.kt
src/companionReferenceImplicit.kt
src/importedMember.kt
End of files
Exit code: OK
@@ -0,0 +1,22 @@
================ Step #1 =================
Compiling files:
src/A.kt
src/companionExtension.kt
src/companionReferenceExplicit.kt
src/companionReferenceImplicit.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Unresolved reference: Companion
Unresolved reference: Companion
================ Step #2 =================
Compiling files:
src/companionExtension.kt
src/companionReferenceExplicit.kt
src/companionReferenceImplicit.kt
End of files
Exit code: OK
@@ -0,0 +1,22 @@
================ Step #1 =================
Compiling files:
src/A.kt
src/companionExtension.kt
src/companionReferenceExplicit.kt
src/companionReferenceImplicit.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Unresolved reference: x
================ Step #2 =================
Compiling files:
src/companionExtension.kt
src/companionReferenceExplicit.kt
src/companionReferenceImplicit.kt
End of files
Exit code: OK
@@ -0,0 +1,21 @@
================ Step #1 =================
Compiling files:
src/Enum.kt
src/getRandomEnumEntry.kt
src/use.kt
src/useEnumImplicitly.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
'when' expression must be exhaustive, add necessary 'C' branch or 'else' branch instead
================ Step #2 =================
Compiling files:
src/getRandomEnumEntry.kt
src/use.kt
src/useEnumImplicitly.kt
End of files
Exit code: OK
@@ -0,0 +1,21 @@
================ Step #1 =================
Compiling files:
src/Enum.kt
src/getRandomEnumEntry.kt
src/use.kt
src/useEnumImplicitly.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Unresolved reference: C
================ Step #2 =================
Compiling files:
src/getRandomEnumEntry.kt
src/use.kt
src/useEnumImplicitly.kt
End of files
Exit code: OK
@@ -0,0 +1,18 @@
================ Step #1 =================
Compiling files:
src/Enum.kt
src/useBecameNullable.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Any?
================ Step #2 =================
Compiling files:
src/useBecameNullable.kt
End of files
Exit code: OK
@@ -0,0 +1,17 @@
================ Step #1 =================
Compiling files:
src/Base.kt
src/use.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
'when' expression must be exhaustive, add necessary 'is C' branch or 'else' branch instead
================ Step #2 =================
Compiling files:
src/use.kt
End of files
Exit code: OK
@@ -0,0 +1,17 @@
================ Step #1 =================
Compiling files:
src/Base.kt
src/use.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
'when' expression must be exhaustive, add necessary 'is Impl2' branch or 'else' branch instead
================ Step #2 =================
Compiling files:
src/use.kt
End of files
Exit code: OK
@@ -0,0 +1,17 @@
================ Step #1 =================
Compiling files:
src/Base.kt
src/use.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
'when' expression must be exhaustive, add necessary 'is C' branch or 'else' branch instead
================ Step #2 =================
Compiling files:
src/use.kt
End of files
Exit code: OK
@@ -0,0 +1,22 @@
================ Step #1 =================
Compiling files:
src/A.kt
src/D.kt
src/useA.kt
src/useD.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Type mismatch: inferred type is A<B> but A<C> was expected
Type mismatch: inferred type is A<B> but A<C> was expected
================ Step #2 =================
Compiling files:
src/D.kt
src/useA.kt
src/useD.kt
End of files
Exit code: OK
@@ -0,0 +1,18 @@
================ Step #1 =================
Compiling files:
src/const.kt
src/usage.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Unresolved reference: FOO
================ Step #2 =================
Compiling files:
src/usage.kt
End of files
Exit code: OK
@@ -0,0 +1,22 @@
================ Step #1 =================
Compiling files:
src/A.kt
src/B.kt
src/createADefault.kt
src/createANonDefault.kt
src/useA.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Too many arguments for public constructor A() defined in foo.A
================ Step #2 =================
Compiling files:
src/B.kt
src/createADefault.kt
src/useA.kt
End of files
Exit code: OK
@@ -0,0 +1,24 @@
================ Step #1 =================
Compiling files:
src/A.kt
src/B.kt
src/createADefault.kt
src/createANonDefault.kt
src/useA.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
No value passed for parameter 'x'
No value passed for parameter 'x'
================ Step #2 =================
Compiling files:
src/B.kt
src/createADefault.kt
src/createANonDefault.kt
src/useA.kt
End of files
Exit code: OK
@@ -0,0 +1,19 @@
================ Step #1 =================
Compiling files:
src/fun.kt
src/useDefault.kt
src/useNonDefault.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
No value passed for parameter 'x'
================ Step #2 =================
Compiling files:
src/useDefault.kt
src/useNonDefault.kt
End of files
Exit code: OK
@@ -0,0 +1,22 @@
================ Step #1 =================
Compiling files:
src/fun.kt
src/useDefault1.kt
src/useDefault2.kt
src/useNonDefault.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
No value passed for parameter 'y'
No value passed for parameter 'y'
================ Step #2 =================
Compiling files:
src/useDefault1.kt
src/useDefault2.kt
src/useNonDefault.kt
End of files
Exit code: OK
@@ -0,0 +1,21 @@
================ Step #1 =================
Compiling files:
src/A.kt
src/useF.kt
src/useG.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Unresolved reference: f
Unresolved reference: g
================ Step #2 =================
Compiling files:
src/useF.kt
src/useG.kt
End of files
Exit code: OK