Skip to content

Instantly share code, notes, and snippets.

@kdabir
Created February 23, 2016 11:21
Show Gist options
  • Save kdabir/5218fe2ffe94b69bf088 to your computer and use it in GitHub Desktop.
Save kdabir/5218fe2ffe94b69bf088 to your computer and use it in GitHub Desktop.
When a task must always execute!
task someTask << {
println 'A task that will fail'
throw new RuntimeException()
}
task cleanup << {
println 'Will perform cleanup no matter what'
}
someTask.finalizedBy cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment