https://kotlinlang.org logo
#ksp
Title
# ksp
h

Hristijan

10/17/2023, 5:58 PM
Hey guys I want to generated an aggregator that brings together a list of classes but it needs to wait for the latest processor (multi module project) to bring them together into one, is there a sample code how this might be achieved? For example I want to achieve this First round creates the object:
object GraphFactory { val list = listOf<Graph>(GraphFirstProcessor,
module A: appends
MyGraphA,
module B: appends
MyGraphB,
module C (last module): appends
MyGraphC) }
In the end I want to achieve
Copy code
object GraphFactory { 
val list = listOf<Graph>(
GraphFirstProcessor,
MyGraphA,
MyGraphB,
MyGraphC
)
}
a

agrosner

10/17/2023, 11:38 PM
I think you’d need an umbrella module that takes dependencies on the class path. It may use a hint file of where the class exists and then uses that. Anvil does this in kapt but concept would be the same I think https://github.com/square/anvil
Each module has a processor and outputs the generated file. The main processor in umbrella module looks for them
h

Hristijan

10/20/2023, 8:55 PM
Thank you