How to parse yaml in build.gradle.kt

I have a task to read the yaml file in build.gradle.kts. I did not find helpful information online.

But I do see some examples that use SnakeYml to parse in groovy. But I’m using Kotlin DSL so I’m looking for something that can parse yaml in kts build gradle.

Any suggestions ?
Thanks!

SnakeYAML is a JVM library for parsing YAML. It doesn’t really matter what JVM language you’re using. Put SnakeYAML on your buildscript classpath and you can reference the same classes in Kotlin as you can in Groovy.

1 Like

that worked. Thanks James.