Closed
Description
See https://docs.gradle.org/current/userguide/task_configuration_avoidance.html
This boils down to:
- using
project.tasks.register
instead ofproject.tasks.create
- moving call to
project.afterEvaluate
anddependsOn
outside the configuration closure, and to act on the task (inproject.afterEvaluate
), usetask.configure { … }
astask
would then actually be aTaskProvider
. - using
configureEach
instead ofall
- using
project.tasks.named(…).configure { … }
instead ofproject.tasks[…].…
This can generally be done quite easily with a couple utility functions using version checks.