TeamCity通过工件路径将fxcop和coveragereport引入构建工件

TeamCity通过工件路径将fxcop和coveragereport引入构建工件,teamcity,Teamcity,我正在尝试在构建之后将fxCop结果xml和coveragereport.xml发布到工件 以下是我现在的情况, %system.teamcity.build.tempDir%/fxcop-output*/fxcop-result.xml => BuildLog/FxCop %system.teamcity.build.tempDir%/teamcity*ncover/CoverageReport.xml => BuildLog/Coverage 但是结果目录的格式如下 Build

我正在尝试在构建之后将fxCop结果xml和coveragereport.xml发布到工件

以下是我现在的情况,

%system.teamcity.build.tempDir%/fxcop-output*/fxcop-result.xml => BuildLog/FxCop
%system.teamcity.build.tempDir%/teamcity*ncover/CoverageReport.xml => BuildLog/Coverage
但是结果目录的格式如下

BuildLog --> Coverage --> teamcity8681981431807223307ncover --> CoverageReport.xml
BuildLog --> FxCop --> fxcop-output-3810116228914218788 --> fxcop-result.xml
我很好奇,在没有包含文件夹结构的情况下,我应该怎么做才能使它像下面这样

BuildLog --> Coverage --> CoverageReport.xml
BuildLog --> FxCop --> fxcop-result.xml

谢谢

因为工件源定义中有一个星号(*),搜索模式可能会捕获多个源文件

为了在输出路径中区分这些(理论上是多个)文件,TeamCity将在输出结构中添加*-模式的匹配项,例如[…]TeamCity8681981431807223307ncover[…]。因此,不可能选择(可能)多个文件并将其存储为一个文件

也许答案是另一种方法。可以编写使用的MSBuild脚本,如下所示:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" 
     ToolsVersion="4.0">

<ItemGroup>
  <FxCopResults Include="%system.teamcity.build.tempDir%/fxcop-output*/fxcop-result.xml" />
  <CoverageResults Include="%system.teamcity.build.tempDir%/teamcity*ncover/CoverageReport.xml" />
</ItemGroup>

<Target Name="PublishArtifacts">
  <Message Text="##teamCity[publishArtifacts '%(FxCopResults) => BuildLog\FxCop'" />
  <Message Text="##teamCity[publishArtifacts '%(CoverageResults) => BuildLog\Coverage'" />
</Target>


最后,在执行分析生成步骤后,可以使用带有MSBuild生成运行程序的TeamCity生成步骤在此脚本中启动MSBuild目标“PublishArtifacts”。

由于工件源定义中有星号(*),搜索模式可能会捕获多个源文件

为了在输出路径中区分这些(理论上是多个)文件,TeamCity将在输出结构中添加*-模式的匹配项,例如[…]TeamCity8681981431807223307ncover[…]。因此,不可能选择(可能)多个文件并将其存储为一个文件

也许答案是另一种方法。可以编写使用的MSBuild脚本,如下所示:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" 
     ToolsVersion="4.0">

<ItemGroup>
  <FxCopResults Include="%system.teamcity.build.tempDir%/fxcop-output*/fxcop-result.xml" />
  <CoverageResults Include="%system.teamcity.build.tempDir%/teamcity*ncover/CoverageReport.xml" />
</ItemGroup>

<Target Name="PublishArtifacts">
  <Message Text="##teamCity[publishArtifacts '%(FxCopResults) => BuildLog\FxCop'" />
  <Message Text="##teamCity[publishArtifacts '%(CoverageResults) => BuildLog\Coverage'" />
</Target>

最后,在执行分析构建步骤后,可以使用带有MSBuild构建运行程序的TeamCity构建步骤启动此脚本中的MSBuild目标“PublishArtifacts”