Incremental KAPT - invalidate obsolete types
Once set of dirty symbols is computed, filter these types when they are requested from the JavaFileManager. This is accomplished by tracking all declared types in the sources and generated sources. It is not necessary track types in generated class files, as these will be removed before the APs are incrementally run. Motivation: APs (e.g. Dagger) may use Elements.getTypeElement(String) to determine if type is already present, and if it is, they will not generate it. Therefore, whenever generated sources is invalidated, types it defines need to be filtered in the JavaFileManager. Issue is https://youtrack.jetbrains.com/issue/KT-23880
This commit is contained in:
committed by
Alexey Tsvetkov
parent
2f3d234516
commit
b2ad82b7d2
@@ -216,7 +216,7 @@ abstract class AbstractKapt3Extension(
|
||||
private fun runAnnotationProcessing(kaptContext: KaptContext, processors: LoadedProcessors) {
|
||||
if (!options.mode.runAnnotationProcessing) return
|
||||
|
||||
val javaSourceFiles = options.collectJavaSourceFiles(kaptContext.cacheManager)
|
||||
val javaSourceFiles = options.collectJavaSourceFiles(kaptContext.sourcesToReprocess)
|
||||
logger.info { "Java source files: " + javaSourceFiles.joinToString { it.canonicalPath } }
|
||||
|
||||
val (annotationProcessingTime) = measureTimeMillis {
|
||||
|
||||
Reference in New Issue
Block a user