Guys, I am struggling on making my processor incre...
# ksp
a
Guys, I am struggling on making my processor incremental. I am receiving some exceptions when modifying a dependency, sometimes it’s a NPE, sometimes it’s an ArrayOutOfBounds, but if I re-run everything executes just fine. I already tried to create the
Dependencies
instance by just adding the
symbol.containingFile
and also tried by adding all the files of the inherited interfaces. For more context, I am generating classes base on an annotated interface which can then inherit from other interfaces.
This is the stacktrace I’m receiving:
Copy code
e: java.lang.NullPointerException
	at com.google.devtools.ksp.DepInvalidator.invalidate(Incremental.kt:663)
	at com.google.devtools.ksp.DepInvalidator.invalidate(Incremental.kt:655)
	at com.google.devtools.ksp.IncrementalContext.calcDirtySetByDeps(Incremental.kt:232)
	at com.google.devtools.ksp.IncrementalContext.calcDirtyFiles(Incremental.kt:363)
	at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:118)
Also I did check the logs in
build/kspDirtySet.log
and all the files are dirty, no idea why
I am settings the
Dependency.aggregating = true
because my case is very similar to the first example here
z
Do you have a publicly reproducing example project? Your details are quite vague
a
Sorry about that… I’ll create a public repo with the code
👍 1
If you compile once an then change any of the interfaces in the
src/main/kotlin/sample/AppConfig.kt
it gives an NPE
I even used some code @Zac Sweers wrote in the moshi KSP implementation, specifically the
OriginatingKSFiles.kt
file, to better resolve the dependencies but no luck
Not sure if there's any relation with https://github.com/google/ksp/issues/223#issue-776800945 as the AppConfig interface is in a different module...
t
Thanks for the bug report. This is a bug regarding with the interaction between incremental and multipleround processing. Will try to fix before next release.