Skip to content

Gradle: use new lazy tasks API when supported (Gradle 4.9+) #145

Closed
@tbroyer

Description

@tbroyer

See https://docs.gradle.org/current/userguide/task_configuration_avoidance.html

This boils down to:

  • using project.tasks.register instead of project.tasks.create
  • moving call to project.afterEvaluate and dependsOn outside the configuration closure, and to act on the task (in project.afterEvaluate), use task.configure { … } as task would then actually be a TaskProvider.
  • using configureEach instead of all
  • using project.tasks.named(…).configure { … } instead of project.tasks[…].…

This can generally be done quite easily with a couple utility functions using version checks.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions