gradle
8.6

# getTasksByName

abstract fun getTasksByName(name: String, recursive: Boolean): Set<Task>(source)

Returns the set of tasks with the given name contained in this project, and optionally its subprojects. NOTE: This is an expensive operation since it requires all projects to be configured.

#### Return

The set of tasks. Returns an empty set if no such tasks exist in this project.

#### Parameters

name

The name of the task to locate.

recursive

If true, returns the tasks of this project and its subprojects. If false, returns the tasks of just this project.