https://kotlinlang.org logo
#serialization
Title
# serialization
j

jkbbwr

10/26/2018, 1:51 AM
Is there a simple gradle kts dsl example I can't figure this out
g

gildor

10/26/2018, 2:05 AM
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

jkbbwr

10/26/2018, 2:35 AM
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

gildor

10/26/2018, 2:45 AM
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

jkbbwr

10/26/2018, 2:55 AM
I was hoping it'd make gradle less bad but
g

gildor

10/26/2018, 3:28 AM
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

Nikky

10/26/2018, 3:41 AM
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

gildor

10/26/2018, 3:58 AM
@jkbbwr I created also small example
It has only serialization and kotlin config, no additional configs or instructions
also some comments
2 Views