Is there a simple gradle kts dsl example I can't f...
# serialization
j
Is there a simple gradle kts dsl example I can't figure this out
g
What kind example do you need? Do you have Groovy snipper or something like that? Because serilization plugin works exactly the same as with groovy, you just have to apply it
the only thing that you probably want to use plugins dsl, not buildscript, and because plugin is not published to Gradle Plugins Portal you should approach described in this chapter of official migration guide: https://guides.gradle.org/migrating-build-logic-from-groovy-to-kotlin/#declarative-scripts
j
I don't really understand or like gradle and adding the kotlin stuff ontop didn't clean it up imo.
So its pretty hard to figure out what I need to add to get a simple example compiling
g
Why do you use Kotlin dsl than?
this is still pre-release software and if you just want to copy-paste config groovy is better choice, at least you always have code snippet
j
I was hoping it'd make gradle less bad but
g
It will
but it’s still pre-release and documentation snippets are still much more rare
And actually to know how to apply plugins you just should read official section that I sent to you above
n
kotln-dsl for dealing with kotlinx-serialization should have been mentioned often enough already, but here is a snippet to start off with: https://github.com/NikkyAI/PluginManagementTutorial/blob/master/README.md#kotlinserialization not sure how this would work with mpp if thats what is required
g
@jkbbwr I created also small example
It has only serialization and kotlin config, no additional configs or instructions
also some comments