https://kotlinlang.org logo
Title
t

TwoClocks

03/26/2022, 3:35 AM
I'm trying to convert some kapt annotations to KSP. and gradle is blowing up w/
FileAlreadyExistsException
. It seems really hard to get any debugging info out of grradle, but I think my annotation process is only called once, and the annotation only exists once. Any ideas? The file it's complaining about is a file I generate.
KSP is calling the processor twice for the same annotaion. Is there a way to mark that it's done? Or do I need to manually check if the file(s) I'm going to generate already exist?
I found this issue, which suggests a fix : https://github.com/google/ksp/issues/797
y

yigit

03/26/2022, 4:14 AM
Interesting. Someone reported that compiler error today for room and we weren't able to make any sense as the real error wasn't visible. Maybe it is the same problem but room's annotation processing is properly multi round (or we think so😁)
t

TwoClocks

03/26/2022, 4:42 AM
mine isn't multi-round, and I have only one annotation, and it's only used in once place (basically just a marker for what package name to place all the generate code in).
but it is being called twice. So I keep a boolean in my processor instace... as the issue suggested. And just return on the second call.
hmm... I think your right. I think I was doing multi-round unintentionally. I was returning a bad list from my processor.