I created a tool to aggregate Kotlin Symbols for m...
# ksp
e
I created a tool to aggregate Kotlin Symbols for multi-modules development in compile-time, based on KSP. For instance, to gather all implementations of an interface across multi-modules, and later register/call them together in somewhere. https://github.com/2BAB/Koncat
👍 1
I’m not sure • whether this is a common scenario that somebody might encounter before • whether this is not a abuse of KSP Feel free to leave comments~
j
Thanks for the work! I do have a few questions: KSP does not support getting symbols for a given annotation from other modules, how do you get the subtypes for a given interface from other modules?
e
@Jiaxiang Well, for each module Koncat runs a processor and generates an intermediate file to export all metadata of current module in dedicated package name. Later, in the main project (for example the Android Application module), it aggregates from those metadata intermediates to a final map by
Copy code
resolver.getDeclarationsFromPackage(metadataPackage)
j
I see. Not a typical way to do annotation processing, but doesn’t seem to be abuse to me.
😄 1
e
thanks~