is it possible (yet?) with KSP2 (or the 2.0 kotlin...
# ksp
e
is it possible (yet?) with KSP2 (or the 2.0 kotlin compiler directly, for that matter) to invoke it directly? i.e., in a unit/integration test say
invokeKsp("somesource.kt")
such that I can pass it various sources files to test against?
t
Yes this is one of the design goal of KSP2. The
symbol-processing-aa-embeddable
artifact is designed for this. Here are a couple of examples, though that they use
symbol-processing-aa
rather than
symbol-processing-aa-embeddable
. 1. command line tool 2. test entry point
We're working on the documentation and will publish it soon.
👍🏻 1
👍🏾 1
e
I just cobbled together a prototype based on that
KspJvmMain
that seems to do the trick. i'll keep playing with it and refining it but I think that'll do it. I think i can see how to limit it to just parsing a specific test file either by clever filtering or a brute force approach of different folders per test. either way, making satisfactory progress.