task ok

task broken(dependsOn: ok) << {
    throw new RuntimeException('broken')
}

build.taskGraph.beforeTask { task ->
    println "executing $task ..."
}

build.taskGraph.afterTask { task, exception ->
    if (exception) {
        println "FAILED"
    }
    else {
        println "done"
    }
}
