tschuchortdev / kotlin-compile-testing

A library for testing Kotlin and Java annotation processors, compiler plugins and code generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Annotated class is not recognized by KSP processor

NorbertSandor opened this issue · comments

I try to use this library but my pet example class is not recognized by the processor. (When I use "real" ksp processing it works as expected.)
Maybe do you have an idea what am I doing wrong?
Example test file: https://github.com/kotlinw/kotlinw/blob/main/kotlinw-immutator-processor/src/test/kotlin/kotlinw/immutator/processor/TestKsp.kt

To give some more insights: if I debug into the processing, my annotation type is not resolvable at the following line when calling annotationType.resolveToUnderlying():
image

Unfortunately, I have no idea how this could happen. Perhaps different compiler flags could cause the embedded compiler to behave differently? Let me know if you find out.

Thanks.
This solved the problem: inheritClassPath = true

Thank you @NorbertSandor, I had the same issue and using inheritClassPath = true works like a charm!