K
Kord•11mo ago
Tic

Generate files based on annotation

Hello I have this class:
@Serializable
data class PacketWrapper(
@ProtoNumber(1)
val message: MessagePacket? = null,

@ProtoNumber(2)
val action: ActionPacket? = null,

@ProtoNumber(3)
val disconnect: DisconnectPacket? = null
)
@Serializable
data class PacketWrapper(
@ProtoNumber(1)
val message: MessagePacket? = null,

@ProtoNumber(2)
val action: ActionPacket? = null,

@ProtoNumber(3)
val disconnect: DisconnectPacket? = null
)
I would like to add an annotation like @GenerateProFile("packet.proto") to generate the protobuf files associate to the class definition. However I don't know where to start. Should I create KSP module, a gradle plugin, etc. Do you have any advices and (maybe) example to know how to start
14 Replies
g
g•11mo ago
that's KSP yeah is this really the right server for this question?
Tic
TicOP•11mo ago
Hum .. There are lot of experts here 🥲 That's why, but I can send in kordex if it's more appropriate
g
g•11mo ago
it wouldn't be more appropriate there either aren't you on the kotlin server or ayfri's french kotlin server?
Tic
TicOP•11mo ago
kotlin server? The slack?
g
g•11mo ago
no, kotlin discord, the one I run I mean I don't particularly care if you ask stuff here, but I don't think you should get used to using this server for general kotlin help when there are general kotlin spaces
Tic
TicOP•11mo ago
Kotlin Discord UG I imagine?
g
g•11mo ago
yeah
Tic
TicOP•11mo ago
Yeah that's what I call Kordex
g
g•11mo ago
that's not the kordex server the kordex server is https://discord.gg/nYzQWcjAmK
Tic
TicOP•11mo ago
Well I will ask there so 😄
g
g•11mo ago
you have your answer already that's KSP
Tic
TicOP•11mo ago
Do you have an example? Because the tutorial of Jetbrains is .. mhee
Tic
TicOP•11mo ago
Thanks !

Did you find this page helpful?

Generate files based on annotation - Kord