Allows to use all features of strongly typed language, such as autocompletion and highlighting of incorrect constructions, and for fan of course🙃
Inspired by github-workflows-kt
- Install Kotlin as a stand-alone binary, e.g. from Brew for macOS:
$ brew install kotlin
- Create a new executable file in your repository:
$ touch path/to/geminio/recipe/name.main.kts
$ chmod +x path/to/geminio/recipe/name.main.kts
IMPORTANT: name of file should end
.main.kts
- Put this template into previously created file and save it
#!/usr/bin/env kotlin
@file:Repository("https://jitpack.io")
@file:DependsOn("com.github.s097t0r1:geminio-kotlin-dsl:1.0.0")
import me.s097t0r1.geminio_kotlin_dsl.recipe.createRecipe
import me.s097t0r1.geminio_kotlin_dsl.recipe.yaml.toYaml
val recipe = createRecipe {
requiredParams(
name = "Test recipe",
description = "Test recipe description"
)
/* TYPE YOUR CODE HERE */
}.unwrap().toYaml().also(::println)
- Generate the YAML by calling the above script and redirecting its output to the desired YAML file path:
$ ./recipe.main.kts > recipe.yaml