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
El Zhang
05/12/2022, 2:00 PM
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
Jiaxiang
05/12/2022, 5:32 PM
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
El Zhang
05/12/2022, 11:20 PM
@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