This message was deleted.
# kotlin-dsl
s
This message was deleted.
v
It's usually unnecessary to post to the Kotlin Slack and the Gradle Slack. 😉 For reference, here the answer again: The
war
you marked is in Groovy DSL simply a reference to the task called
war
that in itself is also a
CopySpec
. So what you are after should be
with(tasks.war.get())
d
Thanks for the reply.... I only noticed there was a gradle slack from the MOTD banner in the Kotlin Slack and proceeded to join immediately after.
👌 1
Ah those pesky Provider interfaces that are not implicit .get(), maybe Groovy DSL is still better, shame it is being phased out, maybe in the future, the Kotlin engineers will have a Kotlin scriptable / DSL version of their dialect.
v
Nothing is phased out
But no, Groovy DSL is definitely not better.
Besides that Kotlin DSL is the default by now, you immediately get type-safe build scripts, actually helpful error messages if you mess up the syntax, and amazingly better IDE support if you use a good IDE like IntelliJ IDEA or Android Studio.
Groovy DSL is going nowhere, but I would noone recommend to use it nowadays.
The thing with
get()
would be the same in Groovy DSL, if it were not too old and backwards compatible.
The Groovy DSL is older than the lazy types and task-configuration avoidance. So many patterns you use in Groovy DSL by using the nice DSL are actually hurting build performance.
By doing the
get()
there you also break task-configuration avoidance for the
war
task now, but that's the price you have to pay in this specific case.