This repo reproduces a bug where KSP incremental processing fails to generate code when touching unrelated source files.
:annotations
an annotation class withAnnotationTarget.CLASS
and aKClass<*>
argument:test-processor
a simple KSP processor that returns the list of properties of the annotated target:ksp-consumer
A Kotlin JVM project that adds source code generated by Apollo to the main sourceset for the:test-processor
to process.
- Compile the project with KSP processor for the first time:
./gradlew ksp-consumer:compileKotlin
- Make any changes to
AnotherFile.kt
e.g. adding a space character. - Compile again:
./gradlew ksp-consumer:compileKotlin
The compilation will fail with KspConsumer.kt:10:31 Unresolved reference: properties
where properties
is the extension function generated by the KSP processor.
This won't happen with ./gradlew ksp-consumer:compileKotlin -Pksp.incremental=false
.
This also won't happen if touching KspConsumer.kt
which has the annotation entrypoint for the KSP processor.