api / org.gradle.api / Project / getTasksByName

getTasksByName

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

Returns the set of tasks with the given name contained in this project, and optionally its subprojects.

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.

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