Reproduce Kotlin IC bug with KSP
This repo reproduces a bug where incremental build fails when compiling Android unit test that references code generated a KSP processor which takes code generated by other plugins as input.
Project setup
: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
An Android library project that adds source code generated by Apollo to the main sourceset for the:test-processor
to process. It has aKspConsumerTest
which demonstrates the IC bug.
Steps to reproduce
- Compile the test for the first time:
./gradlew ksp-consumer:compileDebugUnitTestKotlin
- Make any changes to
KspConsumerTest.kt
e.g. adding a space character. - Compile the test again:
./gradlew ksp-consumer:compileDebugUnitTestKotlin
The compilation will fail with Cannot access class 'com.example.icbug.DogsQuery.Dog'. Check your module classpath for missing or conflicting dependencies
.
This won't happen with ./gradlew ksp-consumer:compileDebugUnitTestKotlin -Pkotlin.incremental=false
.