监视单个项目的构建进度 [英] Monitoring build progress of single project

查看:97
本文介绍了监视单个项目的构建进度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何方法可以监视单个项目的构建进度?换句话说,如果我有一个生成1000个.obj文件的项目,我可以查询MSBuild来告诉我已经完成了多少工作和ETA吗?

Is there any way to monitor progress of build for a single project? In other words, if I have a project generating 1000 .obj files, can I query MSBuild to tell me what amount of work has been completed and ETA?

我发现这个线程似乎很相似,但是我没有得到令人满意的答案 MS生成过程的进度条,例如,没有指向特定记录器界面的点,可用于监视进度.

I have found this thread which seems to be similar, but I don't get any satisfying answer there Progress bar for MS build process For instance, no points to specific logger interface useful to monitor progress.

我曾经有基于NMake和Makefile的项目,而NMake具有非常有用的功能 选项/N ,我可以用它来计算百分比已完成cl.exe命令与项目中.cpp文件的数量的比较.简单,但非常有效.

I used to have my projects based on NMake and makefiles and NMake has a very useful option /N which I could use to calculate what % of cl.exe commands has been completed versus number of .cpp files in project. Simple, but very effective.

有什么想法如何使用MSBuild实现类似的建筑进度计算吗?

Any ideas how to achieve similar building progress calculation with MSBuild?

推荐答案

您可以监控到该项目&目标级别(或更低),使用记录器并查看这些事件.要查看obj的进度,您 需要在该记录器中监视Message事件,并对其进行分析以确定它是obj.您大概会在为CL启动的taskstart上开始解析,并在匹配的taskfinished事件上停止解析.

You can monitor down to the project & target level (or below) using a logger and looking at those events. To see the obj progress, you’d need to monitor Message events in that logger, and parse them to determine it’s an obj. You’d presumably start parsing on taskstarted for CL, and stop on the matching taskfinished event.


这篇关于监视单个项目的构建进度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆