开发者

Fail on Post-Build event?

Is there a way to force the build to fail given certain conditions in the post-build event? The package I'm working with runs jslint and a few other solutions all together on post-build, I would like Visual Studio to fail if jslint produces an error.

I am aware of the jslint plugin for VS201开发者_运维技巧0 that will fail the build on error, but my requirements are restricting me to using the packaged bugchecking solution in which jslint is contained.


Post build events are basically batch scripts - you can check for error return values using "if ERRORLEVEL".

Example of a failing copy command:

copy "$(ProjectDir)myfile.ext" "$(TargetDir)"
if ERRORLEVEL 1 goto EXIT

:EXIT


I believe there is an attribute called continueonerror and breakonerror etc that can be added to these post build events. Can you take a look at the same.. I hv this implemented but right nw no access to my machine will get back to you if this doesn't solve your problem or if smbody else can't..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜