api / org.gradle.tooling / LongRunningOperation / addProgressListener

addProgressListener

abstract fun addProgressListener(listener: ProgressListener): LongRunningOperation

Adds a progress listener which will receive progress events as the operation runs.

This method is intended to be replaced by #addProgressListener(org.gradle.tooling.events.ProgressListener). The new progress listener type provides much richer information and much better handling of parallel operations that run during the build, such as tasks that run in parallel. You should prefer using the new listener interface where possible. Note, however, that the new interface is supported only for Gradle 2.5.

Parameters

listener - The listener

Return
this

Since
1.0-milestone-7

abstract fun addProgressListener(listener: ProgressListener): LongRunningOperation

Adds a progress listener which will receive progress events of all types as the operation runs.

This method is intended to replace #addProgressListener(ProgressListener). You should prefer using the new progress listener method where possible, as the new interface provides much richer information and much better handling of parallel operations that run during the build.

Supported by Gradle 2.5 or later. Gradle 2.4 supports OperationType#TEST operations only. Ignored for older versions.

Parameters

listener - The listener

Return
this

Since
2.5

abstract fun addProgressListener(listener: ProgressListener, operationTypes: MutableSet<OperationType>): LongRunningOperation

Adds a progress listener which will receive progress events as the operations of the requested type run.

This method is intended to replace #addProgressListener(ProgressListener). You should prefer using the new progress listener method where possible, as the new interface provides much richer information and much better handling of parallel operations that run during the build.

Supported by Gradle 2.5 or later. Gradle 2.4 supports OperationType#TEST operations only. Ignored for older versions.

Parameters

listener - The listener

operationTypes - The types of operations to receive progress events for.

Return
this

Since
2.5

abstract fun addProgressListener(listener: ProgressListener, vararg operationTypes: OperationType): LongRunningOperation

Adds a progress listener which will receive progress events as the operations of the requested type run.

This method is intended to replace #addProgressListener(ProgressListener). You should prefer using the new progress listener method where possible, as the new interface provides much richer information and much better handling of parallel operations that run during the build.

Supported by Gradle 2.5 or later. Gradle 2.4 supports OperationType#TEST operations only. Ignored for older versions.

Parameters

listener - The listener

operationTypes - The types of operations to receive progress events for.

Return
this

Since
2.6