In my previous question, I've invoked the ksp plug...
# ksp
w
In my previous question, I've invoked the ksp plugin from within a custom gradle plugin, is there any way to pass the gradle Project into my processor? I see that the SymbolProcessorProvider has options, but it is Map<String, String> so I can't pass in an object.
j
not sure I understand your question, what do you mean by passing a gradle project into a processor? The KSP options can be specified at build script with
ksp { }
blocks.
w
Rather than a string option, id like to pass in an extension object fetched from the gradle Project object, or the project object itself. I was looking at the ksp code the other day, I'm guessing the options are strings only because you want the map to be a gradle input for diff checking. Id like to pass options to my processor that are objects instead, but it doesn't look like that's possible. Was gonna fork ksp when I had time to add a set of extraOptions that are
Map<String, Any?>
so I can do something like
ksp { extraOption("gradleProject", project) }
j
options has to be string because we also need to pass them in command line.
w
Makes sense, and it seems like the use case where I need to pass actual objects from gradle to the processor are very niche. If I added something like this, should I make a PR for it?
j
you can create a feature request on our github and we can discuss there.