FxCop in CruiseControl.NET

7 篇文章 0 订阅
2 篇文章 0 订阅

原文地址:http://blog.webgear.co.nz/archive/2008/07/25/fxcop-in-cruisecontrol.net.aspx


I have finally integrated FxCop into my automated build process. Now i can see FxCop summary and detailed reports on theCruiseControls.NET dashboard.

Initially I was misguided somewhat by CruiseControl.NET's documentation when it said
We don't currently support running FxCop directly from CruiseControl.NET, but we plan on enabling this in a later release.
It seemed that the only way FxCop could be used with CC.NET is via NAnt.
However it turned out to be very easy to do it just via Executable Task. Here's what i did:
  1. Added FxCop project file to my solution (so i could select which assemblies to analyze and choose the rules)
  2. Added an exec task to project's tasks node in ccnet.config (after all the builds and unit tests are done)
  3. Added a File Merge Task to publishers node so that FxCop results are picked up by CC.NET
So the ccnet.config looks like this:
<cruisecontrol>
 <project name="project">
  ...
  <tasks>
   ...
   <exec>
    <executable>C:\Program Files\Microsoft 
          FxCop 1.35\FxCopCmd.exe</executable>
    <baseDirectory>C:\AllProjects\MyProject\</baseDirectory>
    <buildArgs>/p:"MyProject.sln.FxCop"
          /out:"(artifacts)\FxCop-results.xml" /gac</buildArgs>
    <buildTimeoutSeconds>300</buildTimeoutSeconds>
   </exec>
  </tasks>
  <publishers>
   <merge>
    <files>
     <file>(artifacts)\FxCop-results.xml</file>
    </files>
   </merge>
   ...
  </publishers>
 </project>
</cruisecontrol>
(Note i have added some linebreaks in there so it fits into the page).

I'm also using  different stylesheets to present FxCop results, which i think are nicer. 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值