Hi. It seems I've already gotten answer for this n...
# gradle
a
Hi. It seems I've already gotten answer for this newbie question but it's already behind the time horizon, I can't find it. What is the proper way to access existing tasks for configuring them? For example I want to add a spring profile when running application via gradle. Now I'm doing it like this:
Copy code
val run: JavaExec by tasks
run.systemProperties["spring.profiles.active"] = "dev"
Second line is ok, but the first one looks like get any Task from map by name and cast it to JavaExec. Where is my strict typed model?) Or I want to run coberturaReport prior to test:
Copy code
val test by tasks
val coberturaReport by tasks
test.dependsOn(coberturaReport)
Ok, no casts but still getting tasks from map by name.
And the second one can be something like this:
Copy code
tasks.withType<GenerateReportTask> {
    dependsOn(tasks.withType<Test>())
}
?
oh, vice versa
Copy code
tasks.withType<Test> {
    dependsOn(tasks.withType<GenerateReportTask>())
}
hm.. this doesn't work... Actually I'm a bit confused with the doc:
Copy code
The coberturaReport task will cause instrumentation to happen before tests are run, and a coverage report to be generated after tests are run
What does it mean? Should I make test depends on coberturaReport? Or should I just enable somehow it, because there is something to do before tests and something -- after (Or maybe instrumentation will produce all reports). I'm still thinking in terms of maven's lifecycles and it spoils my gradle experience...