https://kotlinlang.org logo
#ksp
Title
# ksp
d

Derek Ellis

03/03/2023, 9:18 PM
Are there any patterns for generating files from a symbol processor that aren't code/resource files while still maintaining support for incremental processing? e.g. I want to write a report to some path so that I can use it in later gradle tasks
j

Jiaxiang

03/03/2023, 9:57 PM
KSP’s incremental relies on Gradle therefore if you depend on other sources other than code/resource, it is unlikely it will even get sent to KSP’s gradle plugin for incremental analysis.
d

Derek Ellis

03/06/2023, 4:01 PM
What I meant is that with
codeGenerator.createNewFile
you can pass it an array of dependencies that can invalidate the output if those dependent source files change is there anything similar/equivalent if I'm generating a file to some arbitrary location outside of the generated resource/source files?
j

Jiaxiang

03/06/2023, 6:18 PM
What I can think of is that you can try to create a dummy file with code generator interface, and you can keep the track of your actual generated file’s dependency through this dummy file. But generating outside of generated folder still sounds flaky to me, there might be more things to break.
8 Views