How can i convert this gradle command to kotlin DS...
# gradle
m
How can i convert this gradle command to kotlin DSL? I want to set a different working directory for application plugin
e
tasks.run
is a
TaskProvider
you could write:
Copy code
kotlin
tasks.run.get().workingDir("some/path")
but it would save a bit of configuration time to lazily apply this configuration as follows:
Copy code
kotlin
(tasks.run) {
    workingDir("some/path")
}
Parentheses around
tasks.run
are required because
tasks.run {}
conflicts with Kotlin stdlib
.run {}
extension.
m
None of your suggestins are working for me or i don't understand, how to use them. However, i have another solution already
Copy code
tasks.getByName<JavaExec>("run")
e
ah sorry, I had Gradle 5.0 in mind, with 4.x what you found is good