在gradle脚本中跟踪每个任务的执行时间? [英] Track execution time per task in gradle script?
本文介绍了在gradle脚本中跟踪每个任务的执行时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在gradle构建脚本中跟踪任务执行时间的最优雅的方法是什么?在最佳情况下,将时间直接记录在任务名称的同一行或下一行
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)
推荐答案
最干净的解决方案是实现TaskExecutionListener (我确定您可以处理该部分)并向gradle.taskGraph.addTaskExecutionListener
注册.
The cleanest solution is to implement a TaskExecutionListener (I'm sure you can handle that part) and register it with gradle.taskGraph.addTaskExecutionListener
.
这篇关于在gradle脚本中跟踪每个任务的执行时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文