【问题标题】:nant nantcontrib configuration to use fxcop使用 fxcop 的 nant nantcontrib 配置
【发布时间】:2010-03-25 14:09:16
【问题描述】:

我需要运行我在 NAnt 构建文件中实现的 FxCop 属性。 我有 NAnt 和 NAntContrib。我已将nantcontrib\bin 的内容复制到nant\bin 文件夹,并将环境变量设置为FxCopCmd.exe

然后我在运行 NAnt 脚本时遇到错误:

无效属性(fxcop)

可能是什么问题?

【问题讨论】:

    标签: nant fxcop nantcontrib


    【解决方案1】:

    使用 NAnt 的 exec 任务直接从 NAnt 调用 FxCop 会更简单一些,无需使用 NAntContrib 任务。有关实现细节,请查看article I wrote 关于集成 NAnt 和 FxCop。

    代码如下:

    <!-- specify location of required tools -->
    <property name="dir.tools" value="tools" />
    
    <!-- analyze build for code quality -->
    <target name="analyze.fxcop" depends="build" description="Analyze generated code using FxCop"> 
        <!-- specify location of input and output files -->
        <property name="fxcop.input" value="wadmt.fxcop" />
        <property name="fxcop.output" value="${dir.build}fxcop-results.xml" /> 
    
        <!-- send the analysis work to the FxCop command-line tool -->
        <exec program="${dir.tools}fxcopFxCopCmd.exe" failonerror="false">
            <arg value="/project:${fxcop.input}" /> <!-- use the fxcop project file -->
            <arg value="/forceoutput" /> <!-- create output even if no violations are found -->
            <arg value="/summary" /> <!-- show some summary info -->
            <arg value="/out:${fxcop.output}" /> <!-- specify an output file -->
        </exec>
    </target>
    

    【讨论】:

      猜你喜欢
      • 2011-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-26
      • 1970-01-01
      相关资源
      最近更新 更多