Visual Studio用什么来确定构建是最新的? [英] What does visual studio use to determine that a build is up to date?

查看:78
本文介绍了Visual Studio用什么来确定构建是最新的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个VS插件,它拦截Visual Studio的build命令,并使用另一个构建系统进行构建.我的构建以正确的格式显示了错误,因此您可以在VS中单击它们,但要进行完全无缝集成,剩下的第一步是防止VS的运行"或调试"命令抱怨它不认为的错误.该项目已构建(当然是这样),有人知道我如何欺骗VS认为该项目已构建吗?

I've written a VS addin which intercepts Visual Studio's build command and uses another build system to do a build. I've got my build showing errors in the right format so that you can click on them in VS but the one step remaining for completely seamless integration is to prevent VS's "run" or "debug" commands from whining the it doesn't think the project is built (when of course it is) does anyone know how I can trick VS into thinking the project is built?

推荐答案

不久,MSBuild/Visual Studio将检查特定项目配置中已定义目标的输出.接下来,它将指定为目标输出的文件的时间戳与指定为该特定目标的输入的所有文件的时间戳进行比较.如果输入比输出最新,则它要求重新生成输出(重新编译源代码或重新链接目标文件等)

Shortly, MSBuild / Visual Studio checks what is output of defined targets in configuration of particular project. Next it compares timestamp of file(s) specified as target output with timestamps of all files specified as input for that particular target. If input is more up-to-date than output, then it requests to regenerate output (re-compile source code or re-link object files, etc.)

如何让VS认为项目已构建?

更新输入文件的时间戳,即源文件(.cpp.cs)或二进制文件(例如.obj)用作链接器和您感兴趣的其他文件的输入.

Update timestamp of input files, namely source files (.cpp, .cs) or binary files like .obj used as input for linker and other files that are of your interest.

有时,我会使用GnuWIn32 touch 实用工具手动发出以下命令

Sometimes I do it manually issuing the following command using touch utility from GnuWIn32

touch myfile.obj

这篇关于Visual Studio用什么来确定构建是最新的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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