Is there a way how SymbolProcessor can get the name of the configuration from the dependencies? I.e. if I added this line to my build.gradle.kts file:
Copy code
add("kspCommonMainMetadata", project(":ksp"))
I would like to get the string "kspCommonMainMetadata" inside of the process() function - especially if there are multiple processors added, I want to distinguish between them.
j
Jiaxiang Chen
05/03/2023, 12:32 AM
KSP APIs by itself can’t do that, you can try to pass the configuration names in Gradle via KSP options, but it’s up to your own use case as to how to write it in build scripts.
p
Pavel Lahoda
05/03/2023, 7:30 AM
How can you pass a different option to each of the configurations?
I can only see there is a global "ksp" extension, which can be used like this:
Copy code
ksp {
arg("optinName", "optionValue")
}
But I'd need for each configuration created using the add() to have a different "optionValue".
j
Jiaxiang Chen
05/05/2023, 1:42 PM
maybe try getting task by name? But I won’t count on that in general.