考虑这个简单的msbuild脚本(xaml):
<Activity xmlns=[....]>
<Sequence>
<mtbwa:WriteBuildMessage Message="Test message"/>
<mtbwa:WriteBuildWarning Message="Test warning"/>
</Sequence>
</Activity>
我有一个基于此脚本的tfs构建定义。 当我在tfs中排队新的构建时,警告显示在“查看日志”下,消息不显示。
你怎么看?
答案 0 :(得分:18)
这是约。有效的 minimal 工作流程xaml文件:
<Activity xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow">
<Sequence>
<mtbwa:WriteBuildMessage Importance="[Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.High]"
Message="Test WriteBuildMessage Importance High"/>
</Sequence>
</Activity>
用于登录查看日志的默认tfsbuild详细信息是正常,但这不会显示BuildMessageImportance.Normal
,仅显示High
。
另一个 gotcha 是你必须在 Process 项下的构建定义中点击构建过程模板的 Refresh 按钮。
这是一个最小的工作流示例,包括BuildVerbosity
属性。
<Activity xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow"
xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow"
xmlns:this="clr-namespace:TfsBuild"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="TfsBuild.Process"
this:Process.Verbosity="[Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Diagnostic]">
<x:Members>
<x:Property Name="Verbosity"
Type="InArgument(mtbw:BuildVerbosity)" />
</x:Members>
<Sequence>
<mtbwa:WriteBuildMessage Importance="[Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.Low]"
Message="Test WriteBuildMessage Importance Low"/>
</Sequence>
</Activity>