Robert Elliot
03/10/2025, 10:43 AMtasks.taskName {
...
}
or should I be using
tasks.taskName.configure {
....
}
In the same vein, is this OK:
tasks.withType<KotlinCompile> {
compilerOptions.jvmTarget = JVM_21
}
or should it be
tasks.withType<KotlinCompile>().configureEach {
compilerOptions.jvmTarget = JVM_21
}
Javi
03/10/2025, 10:48 AMtasks.taskName {
...
}
tasks.taskName.configure {
....
}
You should always use configureEach
. As you can see, both returns different types, and the one without configureEach
provokes that you need to register the tasks eagerly.Javi
03/10/2025, 10:48 AMconfigureEach
.Robert Elliot
03/10/2025, 10:52 AMVampire
03/12/2025, 8:30 PM