What is the most elegant way to track the execution times on how long a task took in a gradle build script? In an optimal case, log the time directly same or next line to the task name:
:buildSrc:testClasses (0.518 secs)
:fooBar (28.652 secs)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The cleanest solution is to implement a TaskExecutionListener (I’m sure you can handle that part) and register it with
gradle.taskGraph.addTaskExecutionListener.