Created
February 9, 2017 19:36
-
-
Save dnozay/cb646e995e5b79c459143487791a2364 to your computer and use it in GitHub Desktop.
add markers to gradle output so it's easy to extract the block for a failed task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
add markers to gradle output so it's easy to extract the block for a failed task, | |
e.g. with a stream editor like sed. | |
*/ | |
useLogger(new CustomEventLogger()) | |
class CustomEventLogger implements TaskExecutionListener { | |
public void beforeExecute(Task task) { | |
println "## Start-task: $task.name" | |
} | |
public void afterExecute(Task task, TaskState state) { | |
if (state.getFailure() != null) { | |
println "## End-task-ERR: $task.name" | |
} else { | |
println "## End-task-OK: $task.name" | |
} | |
println() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment