Created
July 30, 2017 21:41
-
-
Save Vandalko/054127135b591a9ee5e2e9bdf06efe75 to your computer and use it in GitHub Desktop.
Prints name and class of each executed 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
// Example use: gradle -I init.gradle clean assembleDebug | |
useLogger(new CustomEventLogger()) | |
class CustomEventLogger extends BuildAdapter implements TaskExecutionListener { | |
public void beforeExecute(Task task) { | |
println task + " " + task.class | |
} | |
public void afterExecute(Task task, TaskState state) { | |
} | |
public void buildFinished(BuildResult result) { | |
println 'build completed' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original code: https://discuss.gradle.org/t/how-do-i-easily-print-commands-being-run-by-exec-tasks/6440
Docs: https://docs.gradle.org/current/userguide/logging.html