gradle
8.6

# addListener

abstract fun addListener(listener: Any)(source)

Adds the given listener to this build. The listener may implement any of the given listener interfaces:

- org.gradle.api.execution.TaskExecutionGraphListener
- org.gradle.api.ProjectEvaluationListener
- org.gradle.api.artifacts.DependencyResolutionListener

The following listener types can be used, but are not supported when configuration caching is enabled. Their usage is deprecated and adding a listener of these types become an error in a future Gradle version:

- org.gradle.BuildListener
- org.gradle.api.execution.TaskExecutionListener
- org.gradle.api.execution.TaskActionListener
- org.gradle.api.tasks.testing.TestListener
- org.gradle.api.tasks.testing.TestOutputListener

#### Parameters

listener

The listener to add. Does nothing if this listener has already been added.