api / org.gradle.api / Task / setDidWork

setDidWork

abstract fun setDidWork(didWork: Boolean): Unit

Sets whether the task actually did any work. Most built-in tasks will set this automatically, but it may be useful to manually indicate this for custom user tasks.

This is useful when combined with onlyIf { dependsOnTaskDidWork() }.

Parameters

didWork - indicates if the task did any work