Incremental KAPT - pass changed classpath entries
Pass computed list of changed classpath names to KAPT instead of relying on the history files to be computed by stub generation. Also, stop generating classpath history changes during the stub generation. This commit does not compute the actual changed classpath entries, and that will be done in the following commits. #KT-23880
This commit is contained in:
committed by
Alexey Tsvetkov
parent
0c09f56118
commit
c85e21d43b
-12
@@ -35,26 +35,14 @@ class KaptIncrementalWithAggregatingApt : KaptIncrementalIT() {
|
||||
fun testIncrementalChanges() {
|
||||
val project = getProject()
|
||||
|
||||
var aptTimestamp = 0L
|
||||
|
||||
project.build("clean", "build") {
|
||||
assertSuccessful()
|
||||
|
||||
val classpathHistory =
|
||||
fileInWorkingDir("build/kotlin/kaptGenerateStubsKotlin/classpath-fq-history").listFiles().asList().single()
|
||||
val stubsTimestamp = classpathHistory.name.toLong()
|
||||
|
||||
aptTimestamp = fileInWorkingDir("build/tmp/kapt3/incApCache/main/last-build-ts.bin").readText().toLong()
|
||||
assertTrue(stubsTimestamp < aptTimestamp)
|
||||
}
|
||||
|
||||
project.projectFile("useB.kt").modify { current -> "$current\nfun otherFunction() {}" }
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
|
||||
val newAptTimestamp = fileInWorkingDir("build/tmp/kapt3/incApCache/main/last-build-ts.bin").readText().toLong()
|
||||
assertTrue(aptTimestamp < newAptTimestamp)
|
||||
|
||||
assertEquals(
|
||||
setOf(
|
||||
fileInWorkingDir("build/tmp/kapt3/stubs/main/bar/UseBKt.java").absolutePath,
|
||||
|
||||
-12
@@ -38,26 +38,14 @@ class KaptIncrementalWithIsolatingApt : KaptIncrementalIT() {
|
||||
fun testIncrementalChanges() {
|
||||
val project = getProject()
|
||||
|
||||
var aptTimestamp = 0L
|
||||
|
||||
project.build("clean", "build") {
|
||||
assertSuccessful()
|
||||
|
||||
val classpathHistory =
|
||||
fileInWorkingDir("build/kotlin/kaptGenerateStubsKotlin/classpath-fq-history").listFiles().asList().single()
|
||||
val stubsTimestamp = classpathHistory.name.toLong()
|
||||
|
||||
aptTimestamp = fileInWorkingDir("build/tmp/kapt3/incApCache/main/last-build-ts.bin").readText().toLong()
|
||||
assertTrue(stubsTimestamp < aptTimestamp)
|
||||
}
|
||||
|
||||
project.projectFile("useB.kt").modify { current -> "$current\nfun otherFunction() {}" }
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
|
||||
val newAptTimestamp = fileInWorkingDir("build/tmp/kapt3/incApCache/main/last-build-ts.bin").readText().toLong()
|
||||
assertTrue(aptTimestamp < newAptTimestamp)
|
||||
|
||||
assertEquals(setOf(fileInWorkingDir("build/tmp/kapt3/stubs/main/bar/UseBKt.java").absolutePath), getProcessedSources(output))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user