withType<T>(action)
is equivalent to
withType<T>().all(action)
which is an eager API. Meaning, every task is realized and the action is immediately executed. Every task that is going to be added to the task collection is immediately realized and the action is executed.
withType<T>().configureEach(action)
on the other hand is a lazy API. No task gets realized and the action is not executed. When any of the tasks the action was registered for gets realized, the action is executed.
As you can see, there's a
big difference. Always prefer
withType<T>().configureEach(action)
unless you have a good reason not to.