代码之家  ›  专栏  ›  技术社区  ›  Bernhard Hofmann

在CruiseControl.net中,使用什么XSLT来格式化msbuild XML输出?

  •  3
  • Bernhard Hofmann  · 技术社区  · 16 年前

    我们目前不在cc.net(CruiseControl.net)中格式化msbuild输出,因此,查找中断生成的原因涉及读取XML以查找输出中的最后一个“success=”false“”实例。

    您使用什么XSLT来格式化msbuild输出,并且您对得到的HTML满意?也就是说,你发现很容易找出构建失败的原因吗?

    谢谢 乙

    编辑: 下面是一个经过消毒的CC项目XML元素示例。我现在想知道合并日志是否是问题所在。

        <project name="StackOverflowSample">
        <workingDirectory>D:\_300</workingDirectory>
        <webURL>&viewFarmReportWebURL;</webURL>
        <sourcecontrol type="multi">
            <sourceControls>
                <vsts>
                    <!-- We get latest from TSF -->
                </vsts>
            </sourceControls>
        </sourcecontrol>
        <triggers>
            <intervalTrigger seconds="60" />
        </triggers>
        <tasks>
            <msbuild>
                <executable>&msbuildExecutable;</executable>
                <workingDirectory>app\consoleApp1</workingDirectory>
                <projectFile>consoleApp1.sln</projectFile>
                <buildArgs>/noconlog /p:Configuration=Release /v:quiet</buildArgs>
                <logger>ThoughtWorks.CruiseControl.MsBuild.XmlLogger,"D:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll"</logger>
            </msbuild>
            <nunit>
                <path>&nunitConsoleExecutable;</path>
                <assemblies>
                    <assembly> D:\_300\app\consoleApp1\bin\Release\consoleApp1.exe</assembly>
                </assemblies>
            </nunit>
            <exec>
                <executable>&ncoverExecutable;</executable>
                <buildArgs>"&nunitConsoleExecutable;" "app\consoleApp1\bin\Release\consoleApp1.exe" /nologo</buildArgs>
            </exec>
            <exec>
                <executable>&ndependExecutable;</executable>
                <buildArgs>D:\_300\app\consoleApp1.xml /Silent</buildArgs>
            </exec>
    
            <merge>
                <files>
                    <file>D:\_300\app\consoleApp1\unit-test.xml</file>
                    <file>D:\_300\app\consoleApp1\ApplicationMetrics.xml</file>
                    <file>D:\_300\app\consoleApp1\AssembliesBuildOrder.xml</file>
                    <file>D:\_300\app\consoleApp1\AssembliesDependencies.xml</file>
                    <file>D:\_300\app\consoleApp1\AssembliesMetrics.xml</file>
                    <file>D:\_300\app\consoleApp1\CQLResult.xml</file>
                    <file>D:\_300\app\consoleApp1\InfoWarnings.xml</file>
                    <file>D:\_300\app\consoleApp1\NDependMain.xml</file>
                    <file>D:\_300\app\consoleApp1\TypesDependencies.xml</file>
                    <file>D:\_300\app\consoleApp1\TypesMetrics.xml</file>
                </files>
            </merge>
        </tasks>
        <publishers>
            <merge>
                <files>
                    <file>D:\_300\app\consoleApp1\SymbolModule.Xml</file>
                </files>
            </merge>
            <xmllogger logDir="." />
            &emailconsoleApp1;
        </publishers>
    </project>
    
    3 回复  |  直到 16 年前
        1
  •  1
  •   skolima    16 年前

    在与开发人员进行了一次对话之后(我被告知您链接到的替代记录器已经很旧了,不鼓励使用它),我使用的是默认的、标准的记录器和XSLT。如果它确实给您带来了问题,请在 CruiseControl.Net Jira ,对此进行投票的人越多,对代码具有提交访问权限的人越早可能会调查它。

    “视图生成日志”是一个原始视图,除了调试生成服务器安装程序外,它不可用-对于我的某些项目,这几乎是5MB大,不会给服务器带来任何问题(尽管打开它会使浏览器挂起一段时间)。ncover可能会导致buildlog.xml膨胀到100MB以上的问题-如果发生这种情况,在合并结果之前必须使用ncoverexplorer来分析结果(但在开始从服务器获取异常之前不要麻烦)。

    要在WebDashboard中查看格式化的msbuild结果,请确保Dashboard配置包括 msbuild.xsl (这将给您一个链接,指向viewbuildreport页面上的“msbuild report”,并在页面本身包含一些基本信息)。

        2
  •  2
  •   alexandrul    16 年前

    我试过了 CruiseControl.net 1.4.4.83 具有 rodemeyer.msbuildtocnet.dll 1.0.0.5 作为一个记录器 msbuild2ccnet.xsl ,输出与文章中的输出示例完全不同:

    Build started
    Project "" (Integration.Common.csproj target(s)):
    error CS1002: 
    Build succeeded
    error CS1002: 
    1 Error(s)
    0 Warning(s)
    Time elapsed
    

    使用 thoughtworks.cruisecontrol.msbuild.dll(thoughtworks.cruisecontrol.msbuild.dll) 作为一个记录器 MSBuux.xSL 结果很好:

    Build started 07/16/2009 13:46:38
    Person.cs (18,53):  error CS1002: ; expected
    Build FAILED
    Person.cs (18,53):  error CS1002: ; expected
    1 Error(s)
    0 Warning(s)
    Time elapsed 00:00:00
    
        3
  •  1
  •   Bernhard Hofmann    16 年前

    我觉得回答自己的问题有点困难,但也有可能有人会有同样的问题,并且欣赏我的回答,所以就在这里。

    我访问了下一页 http://confluence.public.thoughtworks.org/display/CCNETCOMM/Improved+MSBuild+Integration 这描述了使用不同于传统记录器的记录器(普通记录器生成非常大的文件,在执行XSLT转换时会使服务器陷入困境)。

    该页面提供了日志程序和一个XSLT文件,以及有关如何将其合并到CC.NET项目中的简单而清晰的说明。我尝试了这个日志和XSLT,发现我仍然得到了原始的XML;事实上,所有的XML组合在一个巨大的页面中。

    推荐文章