There are two ways now ``` tasks { "war"(War::c...
# gradle
g
There are two ways now
Copy code
tasks {
   "war"(War::class) {
      archiveName = "myapp.war"
   }
}
or
Copy code
val war: War by tasks // Now your task in variable [war]
war.archiveName = "myapp.war"
👍 1
I don’t think so. Because this syntax is for task configuration. “application” is another approach, extension/convention
I thought about how to implement it better (just for my project), but case with tasks is different
You should specify name of task and class of task
If you have Idea how to rewrite it in kotlin shorter and keep type safety please share with me
In case of Groovy you could specify only task name and then use task arguments without type safety (and code completion).
Maybe Rodrigo has some thoughts for future versions. the only that I probably would add is something like:
Copy code
val war: War by tasks.configure {
    archiveName = "myapp.war"
}
instead
Copy code
val war: War by tasks
war {
    archiveName = "myapp.war"
}