does anyone know if there is a gradle plugin or th...
# scripting
n
does anyone know if there is a gradle plugin or the like to execute
.main.kts
files using kotlinc from the kotlin gradle plugin ?
👀 2
j
gradle can run cmd commands, but what is the reason to use a script instead of a gradle task?
n
generating gh action yml files with #github-actions-kotlin-dsl i would like to make it possible for others in the team to run the scripts with less setup and less system specific setup, eg. which package manager to use to install kotlin, which java env will it be using..
and the scripts have to be .main.kt so that during the github action it can run itself to compare output and cancel if there is inconsistencies
e
GitHub action runners have Kotlin cli installed by default, no need to set that up
m
I think the issue is to avoid having to install the Kotlin cli on the other devs machines?
Ideally, you could have the CI generate the YAML so that no one actually needs to run the main.kts scripts (https://github.com/krzema12/github-actions-kotlin-dsl/issues/155)
But it might still be useful to run it for troubleshooting... Then I guess installing Kotlin manually isn't that bad? (sdkman works well for me)
z
You can get into a chicken and egg situation. We just have a little bash script that can download the kotlinc binary from GitHub releases if need be. Definitely avoid putting it into a Gradle task
n
@ephemient see https://github.com/NikkyAI/twitch-announcement-discord-bot/blob/5272ddd387696d1a5882b4a8e33ece44281836ea/.github/workflows/docker_workflow.yml#L27 the idea is that have github execute them too.. but only to verfy that they did not change..
the reason i asked is that it would be somewhat easy to just have gradle manage kotlin install like with java toolchains the install directory and path to binary is available
the bash script (and powershit version of it too because windows) seems like the most immediate usable solution