Hi! Does anyone know what the kts command is for s...
# gradle
h
Hi! Does anyone know what the kts command is for setting a environment variable? in groovyn it would be
run { environment "key" "value" }
If anyone is interested:
Copy code
tasks {
    "run"(JavaExec::class) {
        environment("DB_HOST","<https://nowhere>")
    }
}
n
Here is a more readable version:
Copy code
val run by tasks.getting(JavaExec::class) {
    environment("DB_HOST", "<https://example.org>")
}
g
Gradle 5 version:
Copy code
tasks.run { ... }
Copy code
tasks.getByName<JavaExec>
also works