Is it possible in ksp say I'm building some extensible codegen impl which can be defined by client l...
s
Is it possible in ksp say I'm building some extensible codegen impl which can be defined by client like below:
Copy code
class MyCodeGen : CodeGen {
     override fun generate(): {
         // codegen impl
     }
}
Then client passes the classpath to ksp arg:
Copy code
ksp {
    arg("custom_codegen", "classpath.to.MyCodeGen")
}
And somewhat processor able to construct the
MyCodeGen
instance via the classpath param and use it to generate custom code by using client's logic? Thank you
j
no, passing classpath does not help, as your custom codegen is defined in your client workload, which means at compile time it is still in the form of source code, therefore can’t be find anywhere on classpath.