Incremental KAPT: fix typo and do check processed sources on

clean build
This commit is contained in:
Ivan Gavrilovic
2020-12-01 17:12:14 +00:00
committed by Mikhael Bogdanov
parent 0522583602
commit 08a2b47c77
2 changed files with 12 additions and 11 deletions
@@ -227,24 +227,25 @@ class KaptIncrementalWithIsolatingApt : KaptIncrementalIT() {
}
""".trimIndent()
)
val allKotlinStubs = setOf(
project.projectDir.resolve("build/tmp/kapt3/stubs/main/foo/A.java").canonicalPath,
project.projectDir.resolve("build/tmp/kapt3/stubs/main/bar/B.java").canonicalPath,
project.projectDir.resolve("build/tmp/kapt3/stubs/main/bar/UseBKt.java").canonicalPath,
project.projectDir.resolve("build/tmp/kapt3/stubs/main/baz/UtilKt.java").canonicalPath,
project.projectDir.resolve("build/tmp/kapt3/stubs/main/error/NonExistentClass.java").canonicalPath
)
project.build("clean", "build") {
assertSuccessful()
assertEquals(allKotlinStubs + fileInWorkingDir("src/main/java/foo/JavaClass.java").canonicalPath, getProcessedSources(output))
}
// change type that all generated sources reference
classpathTypeSource.writeText(classpathTypeSource.readText().replace("}", "int i = 10;\n}"))
project.build("build") {
assertSuccessful()
assertEquals(
setOf(
fileInWorkingDir("build/tmp/kapt3/stubs/main/foo/A.java").canonicalPath,
fileInWorkingDir("build/tmp/kapt3/stubs/main/bar/B.java").canonicalPath,
fileInWorkingDir("build/tmp/kapt3/stubs/main/bar/UseBKt.java").canonicalPath,
fileInWorkingDir("build/tmp/kapt3/stubs/main/baz/UtilKt.java").canonicalPath,
fileInWorkingDir("build/tmp/kapt3/stubs/main/error/NonExistentClass.java").canonicalPath
),
getProcessedSources(output)
)
assertEquals(allKotlinStubs, getProcessedSources(output))
}
}
@@ -71,7 +71,7 @@ class IncrementalProcessor(private val processor: Processor, private val kind: D
fun isUnableToRunIncrementally() = !kind.canRunIncrementally
/** Mapping fromm generated file to type that were used as originating elements. For aggregating APs types will be [null]. */
/** Mapping from generated file to type that were used as originating elements. For aggregating APs types will be [null]. */
fun getGeneratedToSources(): Map<File, String?> = dependencyCollector.value.getGeneratedToSources()
/** All top-level types that were processed by aggregating APs. */