K
Kord•2mo 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
gdude
gdude•2mo ago
that's KSP yeah is this really the right server for this question?
Tic
TicOP•2mo ago
Hum .. There are lot of experts here 🥲 That's why, but I can send in kordex if it's more appropriate
gdude
gdude•2mo ago
it wouldn't be more appropriate there either aren't you on the kotlin server or ayfri's french kotlin server?
Tic
TicOP•2mo ago
kotlin server? The slack?
gdude
gdude•2mo 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•2mo ago
Kotlin Discord UG I imagine?
gdude
gdude•2mo ago
yeah
Tic
TicOP•2mo ago
Yeah that's what I call Kordex
gdude
gdude•2mo ago
that's not the kordex server the kordex server is https://discord.gg/nYzQWcjAmK
Tic
TicOP•2mo ago
Well I will ask there so 😄
gdude
gdude•2mo ago
you have your answer already that's KSP
Tic
TicOP•2mo ago
Do you have an example? Because the tutorial of Jetbrains is .. mhee
Tic
TicOP•2mo ago
Thanks !

Did you find this page helpful?