I'm writing a KSP processor that works just fine o...
# ksp
n
I'm writing a KSP processor that works just fine on the first compilation after clean. But later on an incremental(?) compilation the previously generated files get deleted (by the compiler?) and my processor is not called to generate them again. So I have to clean the Gradle module to force my processor to be called again. (I have just started to experiment with the
ksp.incremental=false
flag but my processor seems to be working as expected with incremental compilation turned off.) Do you have any recommendation how can I debug/fix this problem? (Or similar problems related to incremental processing?) Thanks.
l
I got the same issue, and I got it fixed by specifying
sources
in
Dependencies
that I pass to
output.writeTo(...)
I have something like:
Copy code
output.writeTo(
    codeGenerator,
    Dependencies(true, inputFiles)
)
The
inputFiles
being the files that are used to produce the
output
🙏 1
1
n
Thanks, @Lilian GALLON, I will take a look at how to use it in kotlin-poet.
👌 1
d
Maybe you can also look at the logs that you get by manipulating the Gradle properties explained here: https://kotlinlang.org/docs/ksp-incremental.html#reporting-bugs
🙏 1
j
Hi, @Norbi, when I try to experiment with
ksp.incremental=false
in
gradle.properties
, the
kspDebugKotlin
task fails when I attempt to build the app. Is there a specific reason for this, or am I missing something?
n
Sorry, I don't know, I don't have
kspDebugKotlin
task in my project. Maybe ask in the channel with the error details and stack trace...
j
Thanks for replying @Norbi, My error got cleared after i cleared caches and restart studio.
👍🏻 1