Incremental KAPT: fix typo and do check processed sources on
clean build
This commit is contained in:
committed by
Mikhael Bogdanov
parent
0522583602
commit
08a2b47c77
+11
-10
@@ -227,24 +227,25 @@ class KaptIncrementalWithIsolatingApt : KaptIncrementalIT() {
|
|||||||
}
|
}
|
||||||
""".trimIndent()
|
""".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") {
|
project.build("clean", "build") {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
|
assertEquals(allKotlinStubs + fileInWorkingDir("src/main/java/foo/JavaClass.java").canonicalPath, getProcessedSources(output))
|
||||||
}
|
}
|
||||||
|
|
||||||
// change type that all generated sources reference
|
// change type that all generated sources reference
|
||||||
classpathTypeSource.writeText(classpathTypeSource.readText().replace("}", "int i = 10;\n}"))
|
classpathTypeSource.writeText(classpathTypeSource.readText().replace("}", "int i = 10;\n}"))
|
||||||
project.build("build") {
|
project.build("build") {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
assertEquals(
|
assertEquals(allKotlinStubs, getProcessedSources(output))
|
||||||
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)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -71,7 +71,7 @@ class IncrementalProcessor(private val processor: Processor, private val kind: D
|
|||||||
|
|
||||||
fun isUnableToRunIncrementally() = !kind.canRunIncrementally
|
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()
|
fun getGeneratedToSources(): Map<File, String?> = dependencyCollector.value.getGeneratedToSources()
|
||||||
|
|
||||||
/** All top-level types that were processed by aggregating APs. */
|
/** All top-level types that were processed by aggregating APs. */
|
||||||
|
|||||||
Reference in New Issue
Block a user