如何在 devenv 任务中指定多个构建类型,CruiseControl.net
我想在 devenv 中进行清理和构建。我刚刚注意到 buildtype 标志只能有一项(Clean;不允许 Build)。您知道如何指定多个 BuildType 吗?
<tasks>
<devenv>
<solutionfile>C:\Source\Developer.sln</solutionfile>
<configuration>Release</configuration>
<buildtype>Build</buildtype> // How to do Clean and build here???
<executable>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.com</executable>
<buildTimeoutSeconds>900</buildTimeoutSeconds>
</devenv>
</tasks>
I want to do Clean and Build in devenv. I just noticed that buildtype flag can have only one item (Clean;Build not allowed). Do you have any idea how to specify multiple BuildTypes?
<tasks>
<devenv>
<solutionfile>C:\Source\Developer.sln</solutionfile>
<configuration>Release</configuration>
<buildtype>Build</buildtype> // How to do Clean and build here???
<executable>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.com</executable>
<buildTimeoutSeconds>900</buildTimeoutSeconds>
</devenv>
</tasks>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你需要两个任务。每个
块对应于一次devenv.com
调用。devenv.com
的选项仅允许您进行/Clean
或/Rebuild
而不是构建。如果您想先清理然后正常构建,您将需要调用 devenv.com 两次,因此您需要两个任务。You need two tasks. Each
<devenv>
block corresponds to onedevenv.com
invocation. The options todevenv.com
only allow you to/Clean
or/Rebuild
instead of building. If you want to clean first and then build normally you will need to invokedevenv.com
twice and therefore you need two tasks.还有另一种方法可以解决这个问题,即针对项目文件调用 MSBUILD 任务;这反过来又针对解决方案文件调用 devenv ;这样做的优点是它使得集成单元测试、代码分析等想法变得更容易。
这是我的 Common.Targets 中的几个目标
然后对于我的 CruiseControl 任务
这也使得在构建场中添加新进程变得更容易,例如,假设您想在项目中引入 StyleCop 分析,则不必更改 CC.NET 设置,只需引入/扩展 CodeAnalysis 目标并将其作为 BuildAll 的一部分
There is another way around this, which is to invoke an MSBUILD task against a project file; this in turn calls devenv against the solution file; advantage to this is it makes it easier to integrate thinks like unit test, code analysis etc.
Here's a couple of targets from my Common.Targets
Then for the CruiseControl task I have
This also makes it easier to add new processes across your build farm, e.g. say you want to introduce StyleCop analysis into your project, you don't have to change the CC.NET settings just introduce/extend a CodeAnalysis target and make that part of BuildAll