tschuchortdev/kotlin-compile-testing

Annotated class is not recognized by KSP processor

NorbertSandor opened this issue · 4 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

nesk commented

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