In groovy you can set environment variables with environment key value
.
For example for run
you can do:
run {
environment DB_HOST "https://nowhere"
}
How can I accomplish this in Kotlin in build.gradle.kts?
Like this:
tasks {
"run"(JavaExec::class) {
environment("DB_HOST","https://nowhere")
}
}
Or if you like the delegation property style:
val run by tasks.getting(JavaExec::class) {
environment("DB_HOST","https://nowhere")
}