Search code examples
kotlinkotlin-script

Azure DevOps Pipeline - How to run Kotlin script - *.kts files


To run a Kotlin script one needs to execute:

kotlinc -script myScript.kts

Do I need to download the Kotlin command-line compiler to have access to it, or there is an easier way?


Solution

  • Kotlin scripting is the solution to this problem, but it is still experimental, and it didn't work for me very well.

    I ended up using Gradle Kotlin DSL. Here is a nice samples repo to get you started fast.