What's the status of code generation for multiplat...
# multiplatform
s
What's the status of code generation for multiplatform projects where the code to be generated needs to be in the common source set?
r
Code generation is very doable. Just add your generated code dir to your common source dirs. What’s hard is introspecting on common code so you know what you want to generate. But whether that’s an issue or not depends on your use-case.
s
My particular problem requires generation of members of a sealed class, which complicates things. As far as I'm aware, only Kotlin/JVM supports multifile classes, so I need to insert code into a class within my common source dir before compile time and remove it after compilation completes. Is there another way to do this?
r
Sounds hard. Probably would be easier to generate the entire sealed class instead of just some members. But I haven’t ever tried to do anything like this.