Track execution time per task in gradle script?

gradle

Solution

The cleanest solution is to implement a TaskExecutionListener (I'm sure you can handle that part) and register it with `gradle.taskGraph.addTaskExecutionListener`.

Problem

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) ```

Original source