AzureContinuousDeployment.11.xaml 75 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. <Activity mc:Ignorable="sad" x:Class="TfsBuild.Process" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mt="clr-namespace:Microsoft.TeamFoundation;assembly=Microsoft.TeamFoundation.Common" xmlns:mtb="clr-namespace:Microsoft.TeamFoundation.Build.Common;assembly=Microsoft.TeamFoundation.Build.Common" xmlns:mtbc="clr-namespace:Microsoft.TeamFoundation.Build.Client;assembly=Microsoft.TeamFoundation.Build.Client" xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mtdwa="clr-namespace:Microsoft.TeamFoundation.Deployment.Workflow.Activities;assembly=Microsoft.TeamFoundation.Deployment.Workflow" xmlns:mtdw="clr-namespace:Microsoft.TeamFoundation.Deployment.Workflow;assembly=Microsoft.TeamFoundation.Deployment.Workflow" xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mtbwt="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Tracking;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mttbb="clr-namespace:Microsoft.TeamFoundation.TestImpact.BuildIntegration.BuildActivities;assembly=Microsoft.TeamFoundation.TestImpact.BuildIntegration" xmlns:mtvc="clr-namespace:Microsoft.TeamFoundation.VersionControl.Client;assembly=Microsoft.TeamFoundation.VersionControl.Client" xmlns:mtvco="clr-namespace:Microsoft.TeamFoundation.VersionControl.Common;assembly=Microsoft.TeamFoundation.VersionControl.Common" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:sad="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sad1="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:this="clr-namespace:TfsBuild;" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <x:Members>
  3. <x:Property Name="SolutionToBuild" Type="InArgument(x:String)" />
  4. <x:Property Name="ConfigurationsToBuild" Type="InArgument(mtbwa:PlatformConfigurationList)" />
  5. <x:Property Name="TestSpecs" Type="InArgument(mtbwa:TestSpecList)" />
  6. <x:Property Name="BuildNumberFormat" Type="InArgument(x:String)" />
  7. <x:Property Name="CleanWorkspace" Type="InArgument(mtbwa:CleanWorkspaceOption)" />
  8. <x:Property Name="RunCodeAnalysis" Type="InArgument(mtbwa:CodeAnalysisOption)" />
  9. <x:Property Name="SourceAndSymbolServerSettings" Type="InArgument(mtbwa:SourceAndSymbolServerSettings)" />
  10. <x:Property Name="AgentSettings" Type="InArgument(mtbwa:AgentSettings)" />
  11. <x:Property Name="AssociateChangesetsAndWorkItems" Type="InArgument(x:Boolean)" />
  12. <x:Property Name="CreateWorkItem" Type="InArgument(x:Boolean)" />
  13. <x:Property Name="MSBuildArguments" Type="InArgument(x:String)" />
  14. <x:Property Name="MSBuildPlatform" Type="InArgument(mtbwa:ToolPlatform)" />
  15. <x:Property Name="MSBuildMultiProc" Type="InArgument(x:Boolean)" />
  16. <x:Property Name="PerformTestImpactAnalysis" Type="InArgument(x:Boolean)" />
  17. <x:Property Name="CreateLabel" Type="InArgument(x:Boolean)" />
  18. <x:Property Name="DisableTests" Type="InArgument(x:Boolean)" />
  19. <x:Property Name="GetVersion" Type="InArgument(x:String)" />
  20. <x:Property Name="PrivateDropLocation" Type="InArgument(x:String)" />
  21. <x:Property Name="Verbosity" Type="InArgument(mtbw:BuildVerbosity)" />
  22. <x:Property Name="Metadata" Type="mtbw:ProcessParameterMetadataCollection" />
  23. <x:Property Name="SupportedReasons" Type="mtbc:BuildReason" />
  24. <x:Property Name="DeploymentEnvironmentName" Type="InArgument(x:String)" />
  25. <x:Property Name="AllowUntrustedCertificates" Type="InArgument(x:Boolean)" />
  26. <!-- Additional Cloud Service Overrides -->
  27. <x:Property Name="AlternatePublishProfile" Type="InArgument(x:String)" />
  28. <x:Property Name="AlternateHostedServiceName" Type="InArgument(x:String)" />
  29. <x:Property Name="AllowUpgrade" Type="InArgument(x:Boolean)" />
  30. <!-- NOTE: this deliberately a String instead of Enum type so it can easily be set by server code. -->
  31. <x:Property Name="AlternateDeploymentSlot" Type="InArgument(x:String)" />
  32. <x:Property Name="AlternateStorageAccountName" Type="InArgument(x:String)" />
  33. <x:Property Name="AlternateDeploymentLabel" Type="InArgument(x:String)" />
  34. <x:Property Name="AlternateServiceConfiguration" Type="InArgument(x:String)" />
  35. <!-- Additional Web Deploy Overrides -->
  36. <x:Property Name="AlternateWebDeployPublishProfile" Type="InArgument(x:String)" />
  37. </x:Members>
  38. <this:Process.SolutionToBuild>
  39. <InArgument x:TypeArguments="x:String" />
  40. </this:Process.SolutionToBuild>
  41. <this:Process.ConfigurationsToBuild>[New Microsoft.TeamFoundation.Build.Workflow.Activities.PlatformConfigurationList()]</this:Process.ConfigurationsToBuild>
  42. <this:Process.DisableTests>[False]</this:Process.DisableTests>
  43. <this:Process.TestSpecs>[New Microsoft.TeamFoundation.Build.Workflow.Activities.TestSpecList(New Microsoft.TeamFoundation.Build.Workflow.Activities.AgileTestPlatformSpec("**\*test*.dll") With { .FailBuildOnFailure = True } )]</this:Process.TestSpecs>
  44. <this:Process.BuildNumberFormat>["$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)"]</this:Process.BuildNumberFormat>
  45. <this:Process.AssociateChangesetsAndWorkItems>[True]</this:Process.AssociateChangesetsAndWorkItems>
  46. <this:Process.CreateWorkItem>[True]</this:Process.CreateWorkItem>
  47. <this:Process.CleanWorkspace>[Microsoft.TeamFoundation.Build.Workflow.Activities.CleanWorkspaceOption.All]</this:Process.CleanWorkspace>
  48. <this:Process.MSBuildArguments>
  49. <InArgument x:TypeArguments="x:String" />
  50. </this:Process.MSBuildArguments>
  51. <this:Process.RunCodeAnalysis>[Microsoft.TeamFoundation.Build.Workflow.Activities.CodeAnalysisOption.AsConfigured]</this:Process.RunCodeAnalysis>
  52. <this:Process.MSBuildMultiProc>[True]</this:Process.MSBuildMultiProc>
  53. <this:Process.MSBuildPlatform>[Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto]</this:Process.MSBuildPlatform>
  54. <this:Process.PerformTestImpactAnalysis>[True]</this:Process.PerformTestImpactAnalysis>
  55. <this:Process.SourceAndSymbolServerSettings>[New Microsoft.TeamFoundation.Build.Workflow.Activities.SourceAndSymbolServerSettings(True, Nothing)]</this:Process.SourceAndSymbolServerSettings>
  56. <this:Process.CreateLabel>[True]</this:Process.CreateLabel>
  57. <this:Process.GetVersion>
  58. <InArgument x:TypeArguments="x:String" />
  59. </this:Process.GetVersion>
  60. <this:Process.AgentSettings>[New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly }]</this:Process.AgentSettings>
  61. <this:Process.Verbosity>[Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal]</this:Process.Verbosity>
  62. <this:Process.AllowUntrustedCertificates>[True]</this:Process.AllowUntrustedCertificates>
  63. <this:Process.AllowUpgrade>[True]</this:Process.AllowUpgrade>
  64. <this:Process.Metadata>
  65. <mtbw:ProcessParameterMetadataCollection>
  66. <mtbw:ProcessParameterMetadata BrowsableWhen="EditingDefinition" Category="#100 Required" Required="True" DisplayName="Solution To Build" Description="The solution to build, package and deploy." ParameterName="SolutionToBuild" Editor="Microsoft.TeamFoundation.Build.Controls.ServerFileBrowserEditor, Microsoft.TeamFoundation.Build.Controls" />
  67. <mtbw:ProcessParameterMetadata BrowsableWhen="EditingDefinition" Category="#200 Basic" DisplayName="Configuration To Build" Description="The configuration to build." ParameterName="ConfigurationsToBuild" />
  68. <mtbw:ProcessParameterMetadata BrowsableWhen="EditingDefinition" Category="#300 Advanced" DisplayName="MSBuild Multi-Proc" Description="Enable MSBuild Multi-proc to build your solutions' projects in parallel, when possible, using all available processors on the build server." ParameterName="MSBuildMultiProc" />
  69. <mtbw:ProcessParameterMetadata BrowsableWhen="EditingDefinition" Category="#300 Advanced" DisplayName="Solution Specific Build Outputs" Description="True will put build outputs into folders based on the solution name. False will put all build outputs into the same folder." ParameterName="SolutionSpecificBuildOutputs" />
  70. <mtbw:ProcessParameterMetadata BrowsableWhen="Always" Category="#400 Publishing -- General" Description="The named set of Deployment Settings to use for Application Deployment." DisplayName="Deployment Settings Name" ParameterName="DeploymentEnvironmentName" />
  71. <mtbw:ProcessParameterMetadata BrowsableWhen="Always" Category="#400 Publishing -- General" Description="True will allow non-rooted certificates during deployment." DisplayName="Allow Untrusted Certificates" ParameterName="AllowUntrustedCertificates" />
  72. <mtbw:ProcessParameterMetadata BrowsableWhen="Always" Category="#500 Publishing -- Azure Cloud Service" Description="Specify a source control path to an alternate publish profile." DisplayName="Alternate Publish Profile" ParameterName="AlternatePublishProfile" Editor="Microsoft.TeamFoundation.Build.Controls.ServerFileBrowserEditor, Microsoft.TeamFoundation.Build.Controls" />
  73. <mtbw:ProcessParameterMetadata BrowsableWhen="Always" Category="#500 Publishing -- Azure Cloud Service" Description="Specify the name of an alternate storage account." DisplayName="Alternate Storage Account Name" ParameterName="AlternateStorageAccountName" />
  74. <mtbw:ProcessParameterMetadata BrowsableWhen="Always" Category="#500 Publishing -- Azure Cloud Service" Description="Specify the Cloud Service Environment: Production or Staging." DisplayName="Alternate Cloud Service Environment" ParameterName="AlternateDeploymentSlot" />
  75. <mtbw:ProcessParameterMetadata BrowsableWhen="Always" Category="#500 Publishing -- Azure Cloud Service" Description="Specify an alternate deployment label." DisplayName="Alternate Deployment Label" ParameterName="AlternateDeploymentLabel" />
  76. <mtbw:ProcessParameterMetadata BrowsableWhen="Always" Category="#500 Publishing -- Azure Cloud Service" Description="Specify an alternate Cloud Service name." DisplayName="Alternate Cloud Service Name" ParameterName="AlternateHostedServiceName" />
  77. <mtbw:ProcessParameterMetadata BrowsableWhen="Always" Category="#500 Publishing -- Azure Cloud Service" Description="Specify an alternate service configuration." DisplayName="Alternate Service Configuration" ParameterName="AlternateServiceConfiguration" />
  78. <mtbw:ProcessParameterMetadata BrowsableWhen="Always" Category="#500 Publishing -- Azure Cloud Service" Description="Specify whether upgrade is allowed on deployment." DisplayName="Allow Upgrade" ParameterName="AllowUpgrade" />
  79. <mtbw:ProcessParameterMetadata BrowsableWhen="Always" Category="#600 Publishing -- Azure Website" Description="Specify a source control path to a Web Deploy publish profile." DisplayName="Web Deploy Publish Profile" ParameterName="AlternateWebDeployPublishProfile" Editor="Microsoft.TeamFoundation.Build.Controls.ServerFileBrowserEditor, Microsoft.TeamFoundation.Build.Controls" />
  80. </mtbw:ProcessParameterMetadataCollection>
  81. </this:Process.Metadata>
  82. <this:Process.SupportedReasons>All</this:Process.SupportedReasons>
  83. <mva:VisualBasic.Settings>Assembly references and imported namespaces serialized as XML namespaces</mva:VisualBasic.Settings>
  84. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  85. <Sequence.Variables>
  86. <Variable x:TypeArguments="mtbc:IBuildDetail" Name="BuildDetail" />
  87. <Variable x:TypeArguments="x:String" Name="DropLocation" />
  88. <Variable x:TypeArguments="mtbwa:PlatformConfiguration" Name="ConfigurationToBuild" />
  89. </Sequence.Variables>
  90. <mtbwa:GetBuildDetail DisplayName="Get the Build" Result="[BuildDetail]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  91. <Sequence DisplayName="Update Drop Location" mtbwt:BuildTrackingParticipant.Importance="Low">
  92. <mtbwa:InvokeForReason DisplayName="Update Build Number for Triggered Builds" Reason="Triggered">
  93. <mtbwa:UpdateBuildNumber BuildNumberFormat="[BuildNumberFormat]" DisplayName="Update Build Number" />
  94. </mtbwa:InvokeForReason>
  95. <If Condition="[(Not String.IsNullOrEmpty(BuildDetail.DropLocationRoot)) AndAlso (BuildDetail.Reason And Microsoft.TeamFoundation.Build.Client.BuildReason.Triggered) = BuildDetail.Reason]" DisplayName="If Build Reason is Triggered" mtbwt:BuildTrackingParticipant.Importance="Low">
  96. <If.Then>
  97. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  98. <Assign x:TypeArguments="x:String" mtbwt:BuildTrackingParticipant.Importance="None" Value="[BuildDropProvider.CombinePaths(BuildDetail.DropLocationRoot, BuildDetail.BuildDefinition.Name, BuildDetail.BuildNumber)]" To="[DropLocation]" />
  99. <mtbwa:SetBuildProperties DisplayName="Set Drop Location" DropLocation="[DropLocation]" PropertiesToSet="DropLocation" mtbwt:BuildTrackingParticipant.Importance="Low" />
  100. </Sequence>
  101. </If.Then>
  102. </If>
  103. <If Condition="[(Not String.IsNullOrEmpty(PrivateDropLocation)) AndAlso BuildDetail.Reason = Microsoft.TeamFoundation.Build.Client.BuildReason.ValidateShelveset]" DisplayName="If Build Reason is ValidateShelveset" mtbwt:BuildTrackingParticipant.Importance="Low">
  104. <If.Then>
  105. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  106. <Assign x:TypeArguments="x:String" Value="[BuildDropProvider.CombinePaths(PrivateDropLocation, BuildDetail.BuildDefinition.Name, BuildDetail.BuildNumber)]" To="[DropLocation]" mtbwt:BuildTrackingParticipant.Importance="None" />
  107. <mtbwa:SetBuildProperties DisplayName="Set Drop Location for Private Build" DropLocation="[DropLocation]" PropertiesToSet="DropLocation" mtbwt:BuildTrackingParticipant.Importance="Low" />
  108. </Sequence>
  109. </If.Then>
  110. </If>
  111. </Sequence>
  112. <mtbwa:AgentScope DisplayName="Run On Agent" MaxExecutionTime="[AgentSettings.MaxExecutionTime]" MaxWaitTime="[AgentSettings.MaxWaitTime]" ReservationSpec="[AgentSettings.GetAgentReservationSpec()]">
  113. <mtbwa:AgentScope.Variables>
  114. <Variable x:TypeArguments="mtbc:IBuildAgent" Name="BuildAgent" />
  115. <Variable x:TypeArguments="mtvc:Workspace" Name="Workspace" />
  116. <Variable x:TypeArguments="x:String" Name="BuildDirectory" />
  117. <Variable x:TypeArguments="x:String" Default="[BuildDetail.BuildNumber]" Name="LabelName" />
  118. <Variable x:TypeArguments="x:String" Name="WorkspaceName" />
  119. <Variable x:TypeArguments="x:String" Name="SourcesDirectory" />
  120. <Variable x:TypeArguments="x:String" Name="BinariesDirectory" />
  121. <Variable x:TypeArguments="x:String" Name="TestResultsDirectory" />
  122. </mtbwa:AgentScope.Variables>
  123. <Sequence DisplayName="Initialize Variables" mtbwt:BuildTrackingParticipant.Importance="Low">
  124. <mtbwa:GetBuildAgent DisplayName="Get the Agent" Result="[BuildAgent]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  125. <mtbwa:GetBuildDirectory DisplayName="Get the Build Directory" Result="[BuildDirectory]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  126. <Assign x:TypeArguments="x:String" DisplayName="Initialize Workspace Name" To="[WorkspaceName]" Value="[String.Format(&quot;{0}_{1}_{2}&quot;, BuildDetail.BuildDefinition.Id, Microsoft.TeamFoundation.LinkingUtilities.DecodeUri(BuildAgent.Uri.AbsoluteUri).ToolSpecificId, BuildAgent.ServiceHost.Name)]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  127. <Assign x:TypeArguments="x:String" DisplayName="Initialize Sources Directory" To="[SourcesDirectory]" Value="[String.Format(&quot;{0}\src&quot;, BuildDirectory)]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  128. <Assign x:TypeArguments="x:String" DisplayName="Initialize Binaries Directory" To="[BinariesDirectory]" Value="[String.Format(&quot;{0}\bin&quot;, BuildDirectory)]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  129. <Assign x:TypeArguments="x:String" DisplayName="Initialize TestResults Directory" To="[TestResultsDirectory]" Value="[String.Format(&quot;{0}\tst&quot;, BuildDirectory)]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  130. <If Condition="[ConfigurationsToBuild.Count = 0]" DisplayName="If ConfigurationsToBuild Is Empty" mtbwt:BuildTrackingParticipant.Importance="Low">
  131. <If.Then>
  132. <Assign x:TypeArguments="mtbwa:PlatformConfiguration" DisplayName="Use Default Platform Configuration" To="[ConfigurationToBuild]" Value="[Microsoft.TeamFoundation.Build.Workflow.Activities.PlatformConfiguration.Default]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  133. </If.Then>
  134. <If.Else>
  135. <Assign x:TypeArguments="mtbwa:PlatformConfiguration" DisplayName="Use user's Platform Configuration" To="[ConfigurationToBuild]" Value="[ConfigurationsToBuild(0)]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  136. </If.Else>
  137. </If>
  138. <If Condition="[WorkspaceName.Length &gt; Microsoft.TeamFoundation.VersionControl.Common.RepositoryConstants.MaxWorkspaceNameSize]" DisplayName="If WorkspaceName &gt; MaxSize" mtbwt:BuildTrackingParticipant.Importance="Low">
  139. <If.Then>
  140. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  141. <mtbwa:WriteBuildWarning DisplayName="Write Workspace Size Warning" Message="[String.Format(&quot;The workspace name '{0}' exceeds the maximum allowed limit of '{1}' characters. Truncating it to match the maximum limit.&quot;, WorkspaceName, Microsoft.TeamFoundation.VersionControl.Common.RepositoryConstants.MaxWorkspaceNameSize)]" />
  142. <Assign x:TypeArguments="x:String" DisplayName="Truncate WorkspaceName to MaxSize" To="[WorkspaceName]" Value="[WorkspaceName.Substring(0, Microsoft.TeamFoundation.VersionControl.Common.RepositoryConstants.MaxWorkspaceNameSize).TrimEnd()]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  143. </Sequence>
  144. </If.Then>
  145. </If>
  146. </Sequence>
  147. <Sequence DisplayName="Initialize Workspace" mtbwt:BuildTrackingParticipant.Importance="Low">
  148. <mtbwa:DeleteDirectory Directory="[TestResultsDirectory]" DisplayName="Delete Test Results Directory" Recursive="[True]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  149. <If Condition="[Not CleanWorkspace = Microsoft.TeamFoundation.Build.Workflow.Activities.CleanWorkspaceOption.None]" DisplayName="If Not CleanWorkspace = CleanWorkspaceOption.None" mtbwt:BuildTrackingParticipant.Importance="Low">
  150. <If.Then>
  151. <mtbwa:DeleteDirectory Directory="[BinariesDirectory]" DisplayName="Delete Binaries Directory" mtbwt:BuildTrackingParticipant.Importance="Low" />
  152. </If.Then>
  153. </If>
  154. <If Condition="[CleanWorkspace = Microsoft.TeamFoundation.Build.Workflow.Activities.CleanWorkspaceOption.All]" DisplayName="If CleanWorkspace = CleanWorkspaceOption.All" mtbwt:BuildTrackingParticipant.Importance="Low">
  155. <If.Then>
  156. <Sequence DisplayName="Delete Workspace and Sources Directory" mtbwt:BuildTrackingParticipant.Importance="Low">
  157. <mtbwa:DeleteWorkspace DeleteLocalItems="[True]" DisplayName="Delete Workspace" Name="[WorkspaceName]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  158. <mtbwa:DeleteDirectory Directory="[SourcesDirectory]" DisplayName="Delete Sources Directory" mtbwt:BuildTrackingParticipant.Importance="Low" />
  159. </Sequence>
  160. </If.Then>
  161. </If>
  162. <mtbwa:CreateWorkspace BuildDirectory="[BuildDirectory]" Comment="[&quot;Workspace Created by Team Build&quot;]" DisplayName="Create Workspace" Name="[WorkspaceName]" Result="[Workspace]" SourcesDirectory="[SourcesDirectory]" />
  163. <If Condition="[CleanWorkspace = Microsoft.TeamFoundation.Build.Workflow.Activities.CleanWorkspaceOption.Outputs]" DisplayName="If CleanWorkspace = CleanWorkspaceOption.Outputs" mtbwt:BuildTrackingParticipant.Importance="Low">
  164. <If.Then>
  165. <Sequence DisplayName="Clean Configuration">
  166. <If Condition="[Not String.IsNullOrEmpty(SolutionToBuild)]" DisplayName="If SolutionToBuild is Not Nothing" mtbwt:BuildTrackingParticipant.Importance="Low">
  167. <If.Then>
  168. <Sequence DisplayName="Clean Project" mtbwt:BuildTrackingParticipant.Importance="Low">
  169. <Sequence.Variables>
  170. <Variable x:TypeArguments="x:String" Name="localBuildProjectItem" />
  171. </Sequence.Variables>
  172. <mtbwa:ConvertWorkspaceItem DisplayName="Convert Server Paths to Local Paths" Input="[SolutionToBuild]" Result="[localBuildProjectItem]" Workspace="[Workspace]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  173. <If Condition="[System.IO.File.Exists(localBuildProjectItem)]" DisplayName="If File.Exists(Project)" mtbwt:BuildTrackingParticipant.Importance="Low">
  174. <If.Then>
  175. <mtbwa:MSBuild CommandLineArguments="[String.Format(&quot;/p:SkipInvalidConfigurations=true {0}&quot;, MSBuildArguments)]" Configuration="[ConfigurationToBuild.Configuration]" DisplayName="Run MSBuild for Project" GenerateVSPropsFile="[True]" MaxProcesses="[If (MSBuildMultiProc, 0, 1)]" OutDir="[BinariesDirectory]" Platform="[ConfigurationToBuild.Platform]" Project="[localBuildProjectItem]" Targets="[New String() { &quot;Clean&quot; }]" TargetsNotLogged="[New String() {&quot;GetNativeManifest&quot;, &quot;GetCopyToOutputDirectoryItems&quot;, &quot;GetTargetPath&quot;}]" ToolPlatform="[MSBuildPlatform]" Verbosity="[Verbosity]" />
  176. </If.Then>
  177. </If>
  178. </Sequence>
  179. </If.Then>
  180. </If>
  181. </Sequence>
  182. </If.Then>
  183. </If>
  184. <mtbwa:SyncWorkspace DisplayName="Get Workspace" VersionOverride="[GetVersion]" Workspace="[Workspace]">
  185. <mtbwa:SyncWorkspace.RequestsFailed>
  186. <ActivityAction x:TypeArguments="scg:ICollection(mtbc:IQueuedBuild)">
  187. <ActivityAction.Argument>
  188. <DelegateInArgument x:TypeArguments="scg:ICollection(mtbc:IQueuedBuild)" Name="failedRequests" />
  189. </ActivityAction.Argument>
  190. <mtbwa:RetryRequests Behavior="[Microsoft.TeamFoundation.Build.Workflow.Activities.RetryBehavior.DoNotBatch]" DisplayName="Mark Requests for Retry" Requests="[failedRequests]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  191. </ActivityAction>
  192. </mtbwa:SyncWorkspace.RequestsFailed>
  193. </mtbwa:SyncWorkspace>
  194. </Sequence>
  195. <If Condition="[CreateLabel]" DisplayName="If CreateLabel" mtbwt:BuildTrackingParticipant.Importance="Low">
  196. <If.Then>
  197. <mtbwa:InvokeForReason DisplayName="Create and Set Label for non-Shelveset Builds" Reason="Manual, IndividualCI, BatchedCI, Schedule, ScheduleForced, UserCreated">
  198. <mtbwa:LabelWorkspace Comment="[&quot;Label Created by Team Build&quot;]" DisplayName="Create Label" Name="[LabelName]" Scope="[String.Format(&quot;$/{0}&quot;, BuildDetail.BuildDefinition.TeamProject)]" Workspace="[Workspace]" />
  199. <mtbwa:SetBuildProperties DisplayName="Set Label on BuildDetail" LabelName="[String.Format(&quot;{0}@$/{1}&quot;, LabelName, BuildDetail.BuildDefinition.TeamProject)]" PropertiesToSet="LabelName" mtbwt:BuildTrackingParticipant.Importance="Low" />
  200. </mtbwa:InvokeForReason>
  201. </If.Then>
  202. <If.Else>
  203. <mtbwa:WriteBuildMessage DisplayName="Write Message" Message="Not Labeling sources" Importance="[Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.High]" />
  204. </If.Else>
  205. </If>
  206. <TryCatch DisplayName="Try Compile, Test, and Associate Changesets and Work Items" mtbwt:BuildTrackingParticipant.Importance="Low">
  207. <TryCatch.Finally>
  208. <Sequence DisplayName="Revert Workspace and Copy Files to Drop Location" mtbwt:BuildTrackingParticipant.Importance="Low">
  209. <mtbwa:InvokeForReason DisplayName="Revert Workspace for Shelveset Builds" Reason="CheckInShelveset, ValidateShelveset">
  210. <mtbwa:RevertWorkspace DisplayName="Revert Workspace" Workspace="[Workspace]" />
  211. </mtbwa:InvokeForReason>
  212. <If Condition="[Not String.IsNullOrEmpty(DropLocation)]" DisplayName="If DropLocation is Set" mtbwt:BuildTrackingParticipant.Importance="Low">
  213. <If.Then>
  214. <mtbwa:CopyDirectory DisplayName="Drop Files to Drop Location" Source="[BinariesDirectory]" Destination="[DropLocation]" />
  215. </If.Then>
  216. </If>
  217. </Sequence>
  218. </TryCatch.Finally>
  219. <TryCatch.Try>
  220. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  221. <Sequence.Variables>
  222. <Variable x:TypeArguments="s:Exception" Name="compilationException" />
  223. <Variable x:TypeArguments="scg:IList(mtvc:Changeset)" Name="associatedChangesets" />
  224. <Variable x:TypeArguments="s:Boolean" Name="treatTestFailureAsBuildFailure" />
  225. </Sequence.Variables>
  226. <Parallel DisplayName="Compile, Test, and Associate Changesets and Work Items">
  227. <TryCatch DisplayName="Try Compile and Test" mtbwt:BuildTrackingParticipant.Importance="Low">
  228. <TryCatch.Try>
  229. <Sequence DisplayName="Compile and Test">
  230. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  231. <Sequence.Variables>
  232. <Variable x:TypeArguments="x:String" Name="outputDirectory" />
  233. <Variable x:TypeArguments="x:String" Name="logFileDropLocation" />
  234. <Variable x:TypeArguments="mtbc:DeploymentEnvironment" Name="deploymentEnvironment" />
  235. <Variable x:TypeArguments="mtdw:MSDeployProfile" Name="azureWebSiteProfile" />
  236. <Variable x:TypeArguments="mtb:AzureCloudAppProfile" Name="azureCloudAppProfile" />
  237. <Variable x:TypeArguments="x:Boolean" Name="deployOutput" Default="False" />
  238. <Variable x:TypeArguments="x:String" Name="targetSite" />
  239. <Variable x:TypeArguments="x:String" Name="AlternateWebDeployPublishProfileName" />
  240. <Variable x:TypeArguments="x:Boolean" Name="CreateWebDeployPackage" Default="False" />
  241. </Sequence.Variables>
  242. <Sequence DisplayName="Initialize Variables" mtbwt:BuildTrackingParticipant.Importance="Low">
  243. <Assign x:TypeArguments="x:String" DisplayName="Create OutputDirectory" To="[outputDirectory]" Value="[BinariesDirectory]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  244. <If Condition="[Not String.IsNullOrEmpty(DropLocation)]" DisplayName="If DropLocation is Set" mtbwt:BuildTrackingParticipant.Importance="Low">
  245. <If.Then>
  246. <Assign x:TypeArguments="x:String" DisplayName="Initialize LogFile Drop Location" To="[logFileDropLocation]" Value="[BuildDropProvider.CombinePaths(DropLocation, &quot;logs&quot;)]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  247. </If.Then>
  248. </If>
  249. <If Condition="[Not String.IsNullOrEmpty(DeploymentEnvironmentName)]" DisplayName="If DeploymentEnvironmentName is Set" mtbwt:BuildTrackingParticipant.Importance="Low">
  250. <If.Then>
  251. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  252. <mtdwa:GetDeploymentEnvironment DisplayName="Get Deployment Environment" DeploymentEnvironmentName="[DeploymentEnvironmentName]" Result="[deploymentEnvironment]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  253. <Assign x:TypeArguments="x:Boolean" DisplayName="Set Deploy Output to True" mtbwt:BuildTrackingParticipant.Importance="Low" Value="True" To="[deployOutput]" />
  254. <If Condition="[deploymentEnvironment.EnvironmentMetadata.Kind = Microsoft.TeamFoundation.Build.Client.DeploymentEnvironmentKind.AzureWebSite]" DisplayName="If DeploymentEnvironment is Azure Web Site" mtbwt:BuildTrackingParticipant.Importance="Low">
  255. <If.Then>
  256. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  257. <mtdwa:GetAzureWebsitePublishProfile DisplayName="Fetch Azure Web Site Publish Profile" ConnectedService="[deploymentEnvironment.ConnectedService]" WebsiteEnvironment="[deploymentEnvironment]" AllowUntrustedCertificates="[AllowUntrustedCertificates]" Result="[azureWebSiteProfile]" />
  258. <Assign x:TypeArguments="x:Boolean" DisplayName="Set Create Web Deploy Package to True" mtbwt:BuildTrackingParticipant.Importance="Low" Value="True" To="[CreateWebDeployPackage]" />
  259. <!-- The following value is passed to MSBuild for packaging -->
  260. <Assign x:TypeArguments="x:String" DisplayName="Set Target Site Variable" mtbwt:BuildTrackingParticipant.Importance="Low" Value="[azureWebSiteProfile.MSDeploySite]" To="[targetSite]" />
  261. <If Condition="[Not String.IsNullOrEmpty(AlternateWebDeployPublishProfile)]" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="If Use Alternate Web Deploy Publish Profile">
  262. <If.Then>
  263. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  264. <Sequence.Variables>
  265. <Variable x:TypeArguments="x:String" Name="localProfile" />
  266. </Sequence.Variables>
  267. <mtbwa:ConvertWorkspaceItem DisplayName="Convert Server Path to Local Path" Input="[AlternateWebDeployPublishProfile]" Result="[localProfile]" Workspace="[Workspace]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  268. <Assign x:TypeArguments="x:String" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="Record Alternate Web Deploy Publish Profile Name" To="[AlternateWebDeployPublishProfileName]" Value="[System.IO.Path.GetFileNameWithoutExtension(localProfile)]" />
  269. </Sequence>
  270. </If.Then>
  271. </If>
  272. </Sequence>
  273. </If.Then>
  274. </If>
  275. <If Condition="[deploymentEnvironment.EnvironmentMetadata.Kind = Microsoft.TeamFoundation.Build.Client.DeploymentEnvironmentKind.AzureCloudApp]" DisplayName="If DeploymentEnvironment is Azure Cloud Service" mtbwt:BuildTrackingParticipant.Importance="Low">
  276. <If.Then>
  277. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  278. <If Condition="[String.IsNullOrEmpty(AlternatePublishProfile)]" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="If Use Default Publish Profile">
  279. <If.Then>
  280. <mtdwa:GetAzureCloudAppPublishProfile DisplayName="Get Default Azure Cloud Service Publish Profile" CloudAppEnvironment="[deploymentEnvironment]" Result="[azureCloudAppProfile]" />
  281. </If.Then>
  282. <If.Else>
  283. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  284. <Sequence.Variables>
  285. <Variable x:TypeArguments="x:String" Name="localProfile" />
  286. </Sequence.Variables>
  287. <mtbwa:ConvertWorkspaceItem DisplayName="Convert Server Path to Local Path" Input="[AlternatePublishProfile]" Result="[localProfile]" Workspace="[Workspace]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  288. <Assign x:TypeArguments="mtb:AzureCloudAppProfile" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="Load Alternate Publish Profile" To="[azureCloudAppProfile]" Value="[AzureCloudAppProfile.Parse(System.IO.File.ReadAllText(localProfile))]" />
  289. </Sequence>
  290. </If.Else>
  291. </If>
  292. <If Condition="[Not String.IsNullOrEmpty(AlternateHostedServiceName)]" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="If Alternate Cloud Service name is set.">
  293. <If.Then>
  294. <Assign x:TypeArguments="x:String" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="Set Alternate Cloud Service name in profile." To="[azureCloudAppProfile.AzureHostedServiceName]" Value="[AlternateHostedServiceName]" />
  295. </If.Then>
  296. </If>
  297. <If Condition="[Not String.IsNullOrEmpty(AlternateDeploymentSlot)]" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="If Alternate Deployment Slot is set.">
  298. <If.Then>
  299. <Assign x:TypeArguments="mtb:AzureDeploymentSlot" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="Set Alternate Deployment Slot in profile." To="[azureCloudAppProfile.AzureSlot]" Value="[CType([Enum].Parse(GetType(AzureDeploymentSlot), AlternateDeploymentSlot, True), AzureDeploymentSlot)]" />
  300. </If.Then>
  301. </If>
  302. <If Condition="[Not String.IsNullOrEmpty(AlternateStorageAccountName)]" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="If Alternate Storage Account Name is set.">
  303. <If.Then>
  304. <Assign x:TypeArguments="x:String" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="Set Alternate Storage Account Name in profile." To="[azureCloudAppProfile.AzureStorageAccountName]" Value="[AlternateStorageAccountName]" />
  305. </If.Then>
  306. </If>
  307. <If Condition="[Not String.IsNullOrEmpty(AlternateServiceConfiguration)]" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="If Alternate Service Configuration is set.">
  308. <If.Then>
  309. <Assign x:TypeArguments="x:String" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="Set Alternate Service Configuration in profile." To="[azureCloudAppProfile.AzureServiceConfiguration]" Value="[AlternateServiceConfiguration]" />
  310. </If.Then>
  311. </If>
  312. <If Condition="[Not String.IsNullOrEmpty(AlternateDeploymentLabel)]" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="If Alternate Deployment Label is set.">
  313. <If.Then>
  314. <Assign x:TypeArguments="x:String" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="Set Alternate Deployment Label in profile." To="[azureCloudAppProfile.AzureDeploymentLabel]" Value="[AlternateDeploymentLabel]" />
  315. </If.Then>
  316. </If>
  317. <If Condition="[Not AllowUpgrade = azureCloudAppProfile.AzureAllowUpgrade]" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="If Allow Upgrade is overridden">
  318. <If.Then>
  319. <Assign x:TypeArguments="x:Boolean" mtbwt:BuildTrackingParticipant.Importance="Low" DisplayName="Set Allow Upgrade in profile." To="[azureCloudAppProfile.AzureAllowUpgrade]" Value="[AllowUpgrade]" />
  320. </If.Then>
  321. </If>
  322. <If Condition="[(Not ConfigurationToBuild.IsConfigurationEmpty) AndAlso (Not String.IsNullOrEmpty(azureCloudAppProfile.AzureSolutionConfiguration))]" DisplayName="If Build Configuration and Azure Profile Solution Configuration are set." mtbwt:BuildTrackingParticipant.Importance="Low">
  323. <If.Then>
  324. <If Condition="[Not (String.Compare(ConfigurationToBuild.Configuration, azureCloudAppProfile.AzureSolutionConfiguration, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.CompareOptions.OrdinalIgnoreCase) = 0)]" DisplayName="If Build Configuration and Azure Profile Solution Profile Configuration are not equal." mtbwt:BuildTrackingParticipant.Importance="Low">
  325. <If.Then>
  326. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  327. <Assign x:TypeArguments="x:Boolean" DisplayName="Set Deploy Output to False" mtbwt:BuildTrackingParticipant.Importance="Low" Value="False" To="[deployOutput]" />
  328. <mtbwa:WriteBuildMessage DisplayName="Write Message" Message="[String.Format(&quot;This build will not be deployed because the build configuration -- {0} -- and the Azure Profile Solution Configuration -- {1} -- do not match.&quot;, ConfigurationToBuild.Configuration, azureCloudAppProfile.AzureSolutionConfiguration)]" Importance="[Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.Normal]" />
  329. </Sequence>
  330. </If.Then>
  331. </If>
  332. </If.Then>
  333. </If>
  334. </Sequence>
  335. </If.Then>
  336. </If>
  337. <If Condition="[deployOutput]" DisplayName="Deploy Output" mtbwt:BuildTrackingParticipant.Importance="Low">
  338. <If.Then>
  339. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  340. <mtdwa:UpdateDeployment BuildDetail="[BuildDetail]" Stage="[Microsoft.TeamFoundation.Deployment.Workflow.Activities.DeploymentStage.Start]" DeploymentEnvironmentName="[deploymentEnvironment.EnvironmentMetadata.Name]" DisplayName="Mark this build as including a deployment" mtbwt:BuildTrackingParticipant.Importance="Low" />
  341. <If Condition="[deploymentEnvironment.EnvironmentMetadata.Kind = Microsoft.TeamFoundation.Build.Client.DeploymentEnvironmentKind.AzureCloudApp]" DisplayName="If DeploymentEnvironment is Azure Cloud Service" mtbwt:BuildTrackingParticipant.Importance="Low">
  342. <If.Then>
  343. <mtdwa:UpdateDeployment BuildDetail="[BuildDetail]" Stage="[Microsoft.TeamFoundation.Deployment.Workflow.Activities.DeploymentStage.AddProperty]" PropertyKey="AzureSlot" PropertyValue="[azureCloudAppProfile.AzureSlot.ToString()]" DisplayName="Add AzureSlot property to the deployment" mtbwt:BuildTrackingParticipant.Importance="Low" />
  344. </If.Then>
  345. </If>
  346. </Sequence>
  347. </If.Then>
  348. </If>
  349. </Sequence>
  350. </If.Then>
  351. </If>
  352. </Sequence>
  353. <If Condition="[Not String.IsNullOrEmpty(SolutionToBuild)]" DisplayName="If SolutionToBuild is Not Nothing" mtbwt:BuildTrackingParticipant.Importance="Low">
  354. <If.Then>
  355. <TryCatch DisplayName="Try to Compile the Project" mtbwt:BuildTrackingParticipant.Importance="Low">
  356. <TryCatch.Try>
  357. <Sequence DisplayName="Compile the Project" mtbwt:BuildTrackingParticipant.Importance="Low">
  358. <Sequence.Variables>
  359. <Variable x:TypeArguments="x:String" Name="localProject" />
  360. </Sequence.Variables>
  361. <mtbwa:ConvertWorkspaceItem DisplayName="Convert Server Path to Local Path" Input="[SolutionToBuild]" Result="[localProject]" Workspace="[Workspace]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  362. <If Condition="[(deploymentEnvironment IsNot Nothing) AndAlso (deploymentEnvironment.EnvironmentMetadata.Kind = Microsoft.TeamFoundation.Build.Client.DeploymentEnvironmentKind.AzureCloudApp)]" DisplayName="If Deployment Environment is Azure Cloud Service" mtbwt:BuildTrackingParticipant.Importance="Low">
  363. <If.Then>
  364. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  365. <Sequence.Variables>
  366. <Variable x:TypeArguments="x:String" Name="ccprojName" />
  367. </Sequence.Variables>
  368. <mtdwa:FindCCProjInSln DisplayName="Find the Azure Project in the Solution" mtbwt:BuildTrackingParticipant.Importance="Low" SolutionPath="[localProject]" Result="[ccprojName]" />
  369. <Assign x:TypeArguments="x:String" DisplayName="Set Project to build CSPack" To="[MSBuildArguments]" Value="[String.Format(&quot;/t:{0}:Publish /p:PublishDir=&quot;&quot;{1}/app.publish/&quot;&quot; {2}&quot;, ccprojName, outputDirectory, MSBuildArguments)]" />
  370. <If Condition="[Not String.IsNullOrEmpty(azureCloudAppProfile.AzureServiceConfiguration)]" DisplayName="If Service Configuration is specified" mtbwt:BuildTrackingParticipant.Importance="Low">
  371. <If.Then>
  372. <Assign x:TypeArguments="x:String" DisplayName="Set Azure Service Configuration" To="[MSBuildArguments]" Value="[String.Format(&quot;/p:TargetProfile={0} {1}&quot;, azureCloudAppProfile.AzureServiceConfiguration, MSBuildArguments)]" />
  373. </If.Then>
  374. </If>
  375. </Sequence>
  376. </If.Then>
  377. </If>
  378. <If Condition="[Not String.IsNullOrEmpty(AlternateWebDeployPublishProfileName) AndAlso (deploymentEnvironment.EnvironmentMetadata.Kind = Microsoft.TeamFoundation.Build.Client.DeploymentEnvironmentKind.AzureWebSite)]" DisplayName="If DeploymentEnvironment is Azure Web Site" mtbwt:BuildTrackingParticipant.Importance="Low">
  379. <If.Then>
  380. <Assign x:TypeArguments="x:String" DisplayName="Set Web Deploy Publish Profile" To="[MSBuildArguments]" Value="[String.Format(&quot;/p:WebPublishMethod=Package;PublishProfile=&quot;&quot;{0}&quot;&quot; {1}&quot;, AlternateWebDeployPublishProfileName, MSBuildArguments)]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  381. </If.Then>
  382. </If>
  383. <mtbwa:MSBuild CommandLineArguments="[String.Format(&quot;/p:SkipInvalidConfigurations=true {0}&quot;, MSBuildArguments)]" Configuration="[ConfigurationToBuild.Configuration]" DisplayName="Run MSBuild for Project" GenerateVSPropsFile="[True]" LogFileDropLocation="[logFileDropLocation]" MaxProcesses="[If (MSBuildMultiProc, 0, 1)]" OutDir="[outputDirectory]" Platform="[ConfigurationToBuild.Platform]" Project="[localProject]" RunCodeAnalysis="[RunCodeAnalysis]" TargetsNotLogged="[New String() {&quot;GetNativeManifest&quot;, &quot;GetCopyToOutputDirectoryItems&quot;, &quot;GetTargetPath&quot;}]" ToolPlatform="[MSBuildPlatform]" Verbosity="[Verbosity]" DeployOnBuild="[CreateWebDeployPackage]" DeployIisAppPath="[targetSite]" />
  384. </Sequence>
  385. </TryCatch.Try>
  386. <TryCatch.Catches>
  387. <Catch x:TypeArguments="s:Exception">
  388. <ActivityAction x:TypeArguments="s:Exception">
  389. <ActivityAction.Argument>
  390. <DelegateInArgument x:TypeArguments="s:Exception" Name="ex" />
  391. </ActivityAction.Argument>
  392. <Sequence DisplayName="Handle Exception">
  393. <Sequence.Variables>
  394. <Variable x:TypeArguments="scg:ICollection(mtbc:IQueuedBuild)" Name="failedRequests" />
  395. </Sequence.Variables>
  396. <mtbwa:SetBuildProperties CompilationStatus="[Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Failed]" DisplayName="Set CompilationStatus to Failed" PropertiesToSet="CompilationStatus" mtbwt:BuildTrackingParticipant.Importance="Low" />
  397. <If Condition="[CreateWorkItem]" DisplayName="If CreateWorkItem" mtbwt:BuildTrackingParticipant.Importance="Low">
  398. <If.Then>
  399. <mtbwa:InvokeForReason DisplayName="Create Work Item for non-Shelveset Builds" Reason="Manual, IndividualCI, BatchedCI, Schedule, ScheduleForced, UserCreated">
  400. <mtbwa:OpenWorkItem AssignedTo="[BuildDetail.RequestedFor]" Comment="[&quot;This work item was created by TFS Build on a build failure.&quot;]" CustomFields="[New Dictionary(Of String, String) From { {&quot;System.Reason&quot;, &quot;Build Failure&quot;}, {&quot;Microsoft.VSTS.TCM.ReproSteps&quot;, &quot;Start the build using TFS Build&quot;}, {&quot;Severity&quot;, &quot;1 - Critical&quot;} }]" DisplayName="Create Work Item" Title="[String.Format(&quot;Build Failure in Build: {0}&quot;, BuildDetail.BuildNumber)]" Type="[&quot;Bug&quot;]" />
  401. </mtbwa:InvokeForReason>
  402. </If.Then>
  403. </If>
  404. <mtbwa:GetApprovedRequests DisplayName="Get Requests Approved for Check In" Result="[failedRequests]" mtbwt:BuildTrackingParticipant.Importance="None" />
  405. <mtbwa:RetryRequests Behavior="[Microsoft.TeamFoundation.Build.Workflow.Activities.RetryBehavior.DoNotBatch]" DisplayName="Mark Requests for Retry" Requests="[failedRequests]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  406. <Rethrow DisplayName="Rethrow the exception so the build will stop" mtbwt:BuildTrackingParticipant.Importance="Low" />
  407. </Sequence>
  408. </ActivityAction>
  409. </Catch>
  410. </TryCatch.Catches>
  411. </TryCatch>
  412. </If.Then>
  413. </If>
  414. <If Condition="[Not DisableTests]" DisplayName="If Not DisableTests" mtbwt:BuildTrackingParticipant.Importance="Low">
  415. <If.Then>
  416. <Sequence DisplayName="Run Tests" mtbwt:BuildTrackingParticipant.Importance="Low">
  417. <If Condition="[Not TestSpecs Is Nothing]" DisplayName="If Not TestSpecs Is Nothing" mtbwt:BuildTrackingParticipant.Importance="Low">
  418. <If.Then>
  419. <ForEach x:TypeArguments="mtbwa:TestSpec" DisplayName="For Each TestSpec in TestSpecs" Values="[TestSpecs]" mtbwt:BuildTrackingParticipant.Importance="Low">
  420. <ActivityAction x:TypeArguments="mtbwa:TestSpec">
  421. <ActivityAction.Argument>
  422. <DelegateInArgument x:TypeArguments="mtbwa:TestSpec" Name="spec" />
  423. </ActivityAction.Argument>
  424. <TryCatch DisplayName="Try Run Tests" mtbwt:BuildTrackingParticipant.Importance="Low">
  425. <TryCatch.Try>
  426. <If Condition="[TypeOf spec Is Microsoft.TeamFoundation.Build.Workflow.Activities.AgileTestPlatformSpec]" DisplayName="If spec Is AgileTestPlatformSpec" mtbwt:BuildTrackingParticipant.Importance="None">
  427. <If.Then>
  428. <Sequence DisplayName="Run Visual Studio Test Runner for Test Sources" mtbwt:BuildTrackingParticipant.Importance="Low">
  429. <Sequence.Variables>
  430. <Variable x:TypeArguments="mtbwa:AgileTestPlatformSpec" Name="agileTestPlatformAssembly" />
  431. <Variable x:TypeArguments="scg:IEnumerable(x:String)" Name="agileTestPlatformAssemblies" />
  432. </Sequence.Variables>
  433. <Assign x:TypeArguments="mtbwa:AgileTestPlatformSpec" DisplayName="Assign spec to agileTestPlatformAssembly" To="[agileTestPlatformAssembly]" Value="[DirectCast(spec, Microsoft.TeamFoundation.Build.Workflow.Activities.AgileTestPlatformSpec)]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  434. <mtbwa:FindMatchingFiles DisplayName="Find Visual Studio Test Platform Test Assemblies" MatchPattern="[String.Format(&quot;{0}\{1}&quot;, outputDirectory, agileTestPlatformAssembly.AssemblyFileSpec)]" Result="[agileTestPlatformAssemblies]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  435. <If Condition="[agileTestPlatformAssemblies.Count() &gt; 0]" DisplayName="If Visual Studio Test Platform Test Assemblies Found" mtbwt:BuildTrackingParticipant.Importance="Low">
  436. <If.Then>
  437. <If Condition="[agileTestPlatformAssembly.HasRunSettingsFile]" DisplayName="If agileTestPlatformAssembly.HasRunSettingsFile" mtbwt:BuildTrackingParticipant.Importance="Low">
  438. <If.Then>
  439. <Sequence DisplayName="Find Run Settings File And Run Visual Studio Test Runner" mtbwt:BuildTrackingParticipant.Importance="Low">
  440. <Sequence.Variables>
  441. <Variable x:TypeArguments="x:String" Name="localRunSettings" />
  442. </Sequence.Variables>
  443. <mtbwa:GenerateRunSettings DisplayName="Generate Run Settings File" RunSettingsForTestRun="[agileTestPlatformAssembly.RunSettingsForTestRun]" Result="[localRunSettings]" Workspace="[Workspace]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  444. <mtbwa:RunTests DisplayName="Run Visual Studio Test Runner for Test Sources" RunName="[agileTestPlatformAssembly.RunName]" Flavor="[ConfigurationToBuild.Configuration]" Platform="[ConfigurationToBuild.Platform]" TestSources="[agileTestPlatformAssemblies]" RunSettings="[localRunSettings]" TestCaseFilter="[agileTestPlatformAssembly.TestCaseFilter]" ExecutionPlatform="[agileTestPlatformAssembly.ExecutionPlatform]" />
  445. </Sequence>
  446. </If.Then>
  447. <If.Else>
  448. <mtbwa:RunTests DisplayName="Run Visual Studio Test Runner for Test Sources" RunName="[agileTestPlatformAssembly.RunName]" Flavor="[ConfigurationToBuild.Configuration]" Platform="[ConfigurationToBuild.Platform]" TestSources="[agileTestPlatformAssemblies]" TestCaseFilter="[agileTestPlatformAssembly.TestCaseFilter]" ExecutionPlatform="[agileTestPlatformAssembly.ExecutionPlatform]" />
  449. </If.Else>
  450. </If>
  451. </If.Then>
  452. </If>
  453. </Sequence>
  454. </If.Then>
  455. <If.Else>
  456. <If Condition="[TypeOf spec Is Microsoft.TeamFoundation.Build.Workflow.Activities.TestMetadataFileSpec]" DisplayName="If spec Is TestMetadataFileSpec" mtbwt:BuildTrackingParticipant.Importance="None">
  457. <If.Then>
  458. <Sequence DisplayName="Run MSTest for Metadata File">
  459. <Sequence.Variables>
  460. <Variable x:TypeArguments="mtbwa:TestMetadataFileSpec" Name="testMetadataFile" />
  461. <Variable x:TypeArguments="x:String" Name="localTestMetadata" />
  462. </Sequence.Variables>
  463. <Assign x:TypeArguments="mtbwa:TestMetadataFileSpec" DisplayName="Assign spec to testMetadataFile" To="[testMetadataFile]" Value="[DirectCast(spec, Microsoft.TeamFoundation.Build.Workflow.Activities.TestMetadataFileSpec)]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  464. <mtbwa:ConvertWorkspaceItem DisplayName="Convert Server Path to Local Path" Input="[testMetadataFile.MetadataFileName]" Result="[localTestMetadata]" Workspace="[Workspace]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  465. <mtbwa:MSTest RunTitle="[testMetadataFile.RunName]" Category="[testMetadataFile.CategoryFilter]" DisplayName="Run MSTest for Metadata File" Flavor="[ConfigurationToBuild.Configuration]" MaxPriority="[testMetadataFile.MaximumPriority]" MinPriority="[testMetadataFile.MinimumPriority]" PathToResultsFilesRoot="[TestResultsDirectory]" Platform="[ConfigurationToBuild.Platform]" SearchPathRoot="[outputDirectory]" TestLists="[testMetadataFile.TestLists]" TestMetadata="[localTestMetadata]" TestSettings="[String.Empty]" CommandLineArguments="[testMetadataFile.MSTestCommandLineArgs]" />
  466. </Sequence>
  467. </If.Then>
  468. <If.Else>
  469. <Sequence DisplayName="Run MSTest for Test Assemblies" mtbwt:BuildTrackingParticipant.Importance="Low">
  470. <Sequence.Variables>
  471. <Variable x:TypeArguments="mtbwa:TestAssemblySpec" Name="testAssembly" />
  472. <Variable x:TypeArguments="scg:IEnumerable(x:String)" Name="testAssemblies" />
  473. <Variable x:TypeArguments="x:String" Default="[String.Empty]" Name="testFlavor" />
  474. <Variable x:TypeArguments="x:String" Default="[String.Empty]" Name="testPlatform" />
  475. </Sequence.Variables>
  476. <Assign x:TypeArguments="mtbwa:TestAssemblySpec" DisplayName="Assign spec to testAssembly" To="[testAssembly]" Value="[DirectCast(spec, Microsoft.TeamFoundation.Build.Workflow.Activities.TestAssemblySpec)]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  477. <mtbwa:FindMatchingFiles DisplayName="Find Test Assemblies" MatchPattern="[String.Format(&quot;{0}\{1}&quot;, outputDirectory, testAssembly.AssemblyFileSpec)]" Result="[testAssemblies]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  478. <If Condition="[testAssemblies.Count() &gt; 0]" DisplayName="If Test Assemblies Found" mtbwt:BuildTrackingParticipant.Importance="Low">
  479. <If.Then>
  480. <If Condition="[testAssembly.HasTestSettingsFile]" DisplayName="If testAssembly.HasTestSettingsFile" mtbwt:BuildTrackingParticipant.Importance="Low">
  481. <If.Then>
  482. <Sequence DisplayName="Find Test Settings File And Run MSTest" mtbwt:BuildTrackingParticipant.Importance="Low">
  483. <Sequence.Variables>
  484. <Variable x:TypeArguments="x:String" Name="localTestSettings" />
  485. </Sequence.Variables>
  486. <mtbwa:ConvertWorkspaceItem DisplayName="Convert Server Path to Local Path" Input="[testAssembly.TestSettingsFileName]" Result="[localTestSettings]" Workspace="[Workspace]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  487. <mtbwa:MSTest RunTitle="[testAssembly.RunName]" Category="[testAssembly.CategoryFilter]" DisplayName="Run MSTest for Test Assemblies" Flavor="[ConfigurationToBuild.Configuration]" MaxPriority="[testAssembly.MaximumPriority]" MinPriority="[testAssembly.MinimumPriority]" PathToResultsFilesRoot="[TestResultsDirectory]" Platform="[ConfigurationToBuild.Platform]" SearchPathRoot="[outputDirectory]" TestContainers="[testAssemblies]" TestSettings="[localTestSettings]" CommandLineArguments="[testAssembly.MSTestCommandLineArgs]" />
  488. </Sequence>
  489. </If.Then>
  490. <If.Else>
  491. <mtbwa:MSTest RunTitle="[testAssembly.RunName]" Category="[testAssembly.CategoryFilter]" DisplayName="Run MSTest for Test Assemblies" Flavor="[ConfigurationToBuild.Configuration]" MaxPriority="[testAssembly.MaximumPriority]" MinPriority="[testAssembly.MinimumPriority]" PathToResultsFilesRoot="[TestResultsDirectory]" Platform="[ConfigurationToBuild.Platform]" SearchPathRoot="[outputDirectory]" TestContainers="[testAssemblies]" CommandLineArguments="[testAssembly.MSTestCommandLineArgs]" />
  492. </If.Else>
  493. </If>
  494. </If.Then>
  495. </If>
  496. </Sequence>
  497. </If.Else>
  498. </If>
  499. </If.Else>
  500. </If>
  501. </TryCatch.Try>
  502. <TryCatch.Catches>
  503. <Catch x:TypeArguments="s:Exception">
  504. <ActivityAction x:TypeArguments="s:Exception">
  505. <ActivityAction.Argument>
  506. <DelegateInArgument x:TypeArguments="s:Exception" Name="testException" />
  507. </ActivityAction.Argument>
  508. <Sequence DisplayName="Handle Test Run Exception">
  509. <Sequence.Variables>
  510. <Variable x:TypeArguments="scg:ICollection(mtbc:IQueuedBuild)" Name="failedRequests" />
  511. </Sequence.Variables>
  512. <If Condition="[Not (TypeOf testException Is Microsoft.TeamFoundation.Build.Workflow.Activities.TestFailureException)]" DisplayName="If testException is NOT TestFailureException" mtbwt:BuildTrackingParticipant.Importance="Low">
  513. <If.Then>
  514. <mtbwa:WriteBuildError DisplayName="Write Test Failure Message" Message="[testException.Message]" />
  515. </If.Then>
  516. </If>
  517. <mtbwa:SetBuildProperties DisplayName="Set TestStatus to Failed" PropertiesToSet="TestStatus" TestStatus="[Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Failed]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  518. <If Condition="[spec.FailBuildOnFailure]" DisplayName="If spec.FailBuildOnFailure" mtbwt:BuildTrackingParticipant.Importance="Low">
  519. <If.Then>
  520. <Assign x:TypeArguments="s:Boolean" DisplayName="Set treatTestFailureAsBuildFailure to True" To="[treatTestFailureAsBuildFailure]" Value="[True]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  521. </If.Then>
  522. </If>
  523. <mtbwa:GetApprovedRequests DisplayName="Get Requests Approved for Check In" Result="[failedRequests]" mtbwt:BuildTrackingParticipant.Importance="None" />
  524. <mtbwa:RetryRequests Behavior="[Microsoft.TeamFoundation.Build.Workflow.Activities.RetryBehavior.DoNotBatch]" DisplayName="Mark Requests for Retry" Requests="[failedRequests]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  525. </Sequence>
  526. </ActivityAction>
  527. </Catch>
  528. </TryCatch.Catches>
  529. </TryCatch>
  530. </ActivityAction>
  531. </ForEach>
  532. </If.Then>
  533. </If>
  534. </Sequence>
  535. </If.Then>
  536. </If>
  537. <If Condition="[deployOutput]" DisplayName="Deploy Output" mtbwt:BuildTrackingParticipant.Importance="Low">
  538. <If.Then>
  539. <If Condition="[treatTestFailureAsBuildFailure And (BuildDetail.TestStatus = Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Failed)]" DisplayName="Deploy on Test Success" mtbwt:BuildTrackingParticipant.Importance="Low">
  540. <If.Then>
  541. <mtbwa:WriteBuildMessage DisplayName="Write Message" Message="Skipping Deployment Due to Test Failures." Importance="[Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.Normal]" />
  542. </If.Then>
  543. <If.Else>
  544. <If Condition="[Not azureWebSiteProfile Is Nothing]" DisplayName="Publish Output">
  545. <If.Then>
  546. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  547. <mtdwa:MSDeploy DisplayName="MSDeploy" BuildPath="[outputDirectory]" PublishEndpoint="[azureWebSiteProfile.PublishUrl]" TargetSite="[azureWebSiteProfile.MSDeploySite]" UserName="[azureWebSiteProfile.UserName]" Password="[azureWebSiteProfile.UserPWD]" AllowUntrustedCertificates="[AllowUntrustedCertificates]" />
  548. <mtbwa:WriteCustomSummaryInformation DisplayName="Write Custom Deployment Summary" Message="[String.Format(&quot;Your Website was deployed to : [{0}]({0})&quot;,azureWebSiteProfile.DestinationAppUrl.ToString())]" SectionDisplayName="Deployment Summary" SectionKey="customSummarySectionKey" SectionPriority="160" />
  549. <mtdwa:SetCurrentAzureWebsiteBuildNumber DisplayName="Set the current build number in the web site portal." ConnectedService="[deploymentEnvironment.ConnectedService]" AllowUntrustedCertificates="[AllowUntrustedCertificates]" WebsiteEnvironment="[deploymentEnvironment]" mtbwt:BuildTrackingParticipant.Importance="Normal" />
  550. </Sequence>
  551. </If.Then>
  552. <If.Else>
  553. <If Condition="[deploymentEnvironment.EnvironmentMetadata.Kind = Microsoft.TeamFoundation.Build.Client.DeploymentEnvironmentKind.AzureCloudApp]" DisplayName="DeploymentEnvironment is Azure Cloud Service" mtbwt:BuildTrackingParticipant.Importance="Low">
  554. <If.Then>
  555. <Sequence mtbwt:BuildTrackingParticipant.Importance="None">
  556. <mtdwa:DeployAzureCloudApp DisplayName="Deploy application to Azure" ConnectedService="[deploymentEnvironment.ConnectedService]" DeploymentProfile="[azureCloudAppProfile]" AllowUntrustedCertificates="[AllowUntrustedCertificates]" BuildPath="[outputDirectory]" />
  557. </Sequence>
  558. </If.Then>
  559. </If>
  560. </If.Else>
  561. </If>
  562. </If.Else>
  563. </If>
  564. </If.Then>
  565. </If>
  566. </Sequence>
  567. <If Condition="[BuildDetail.CompilationStatus = Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Unknown]" DisplayName="If CompilationStatus = Unknown" mtbwt:BuildTrackingParticipant.Importance="Low">
  568. <If.Then>
  569. <mtbwa:SetBuildProperties CompilationStatus="[Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Succeeded]" DisplayName="Set CompilationStatus to Succeeded" PropertiesToSet="CompilationStatus" mtbwt:BuildTrackingParticipant.Importance="Low" />
  570. </If.Then>
  571. </If>
  572. <If Condition="[BuildDetail.TestStatus = Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Unknown]" DisplayName="If TestStatus = Unknown" mtbwt:BuildTrackingParticipant.Importance="Low">
  573. <If.Then>
  574. <mtbwa:SetBuildProperties DisplayName="Set TestStatus to Succeeded" PropertiesToSet="TestStatus" TestStatus="[Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Succeeded]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  575. </If.Then>
  576. </If>
  577. <If Condition="[treatTestFailureAsBuildFailure And (BuildDetail.TestStatus = Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Failed)]" DisplayName="If TreatTestFailureAsBuildFailure And (TestStatus = Failed)" mtbwt:BuildTrackingParticipant.Importance="Low">
  578. <If.Then>
  579. <mtbwa:SetBuildProperties DisplayName="Set Status to Failed" PropertiesToSet="Status" Status="[Microsoft.TeamFoundation.Build.Client.BuildStatus.Failed]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  580. </If.Then>
  581. </If>
  582. </Sequence>
  583. </TryCatch.Try>
  584. <TryCatch.Catches>
  585. <Catch x:TypeArguments="s:Exception">
  586. <ActivityAction x:TypeArguments="s:Exception">
  587. <ActivityAction.Argument>
  588. <DelegateInArgument x:TypeArguments="s:Exception" Name="compilationExceptionArgument" />
  589. </ActivityAction.Argument>
  590. <Assign x:TypeArguments="s:Exception" DisplayName="Save the Compilation Exception" To="[compilationException]" Value="[compilationExceptionArgument]" mtbwt:BuildTrackingParticipant.Importance="None" />
  591. </ActivityAction>
  592. </Catch>
  593. </TryCatch.Catches>
  594. </TryCatch>
  595. <If Condition="[AssociateChangesetsAndWorkItems]" DisplayName="If AssociateChangesetsAndWorkItems" mtbwt:BuildTrackingParticipant.Importance="Low">
  596. <If.Then>
  597. <If Condition="[CreateLabel]" DisplayName="If CreateLabel and AssociateChangesetsAndWorkItems" mtbwt:BuildTrackingParticipant.Importance="Low">
  598. <If.Then>
  599. <mtbwa:InvokeForReason DisplayName="Associate Changesets and Work Items for non-Shelveset Builds" Reason="Manual, IndividualCI, BatchedCI, Schedule, ScheduleForced, UserCreated">
  600. <mtbwa:AssociateChangesetsAndWorkItems DisplayName="Associate Changesets and Work Items" Result="[associatedChangesets]" />
  601. </mtbwa:InvokeForReason>
  602. </If.Then>
  603. <If.Else>
  604. <mtbwa:WriteBuildWarning DisplayName="Write Associate Changesets and Work Items Warning" Message="Cannot Associate Changesets and Work Items because the Label Sources option is set to False." />
  605. </If.Else>
  606. </If>
  607. </If.Then>
  608. </If>
  609. </Parallel>
  610. <If Condition="[Not compilationException Is Nothing]" DisplayName="If a Compilation Exception Occurred" mtbwt:BuildTrackingParticipant.Importance="Low">
  611. <If.Then>
  612. <Throw DisplayName="Rethrow Compilation Exception" Exception="[compilationException]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  613. </If.Then>
  614. </If>
  615. <Parallel DisplayName="Get Impacted Tests, Index Sources and Publish Symbols">
  616. <If Condition="[PerformTestImpactAnalysis]" DisplayName="If PerformTestImpactAnalysis" mtbwt:BuildTrackingParticipant.Importance="Low">
  617. <If.Then>
  618. <Sequence DisplayName="Get Impacted Tests" mtbwt:BuildTrackingParticipant.Importance="Low">
  619. <Sequence.Variables>
  620. <Variable x:TypeArguments="scg:IEnumerable(x:String)" Name="assemblies" />
  621. </Sequence.Variables>
  622. <mtbwa:FindMatchingFiles DisplayName="Find Build Outputs" MatchPattern="[String.Format(&quot;{0}\**\*.dll;{0}\**\*.exe&quot;, BinariesDirectory)]" Result="[assemblies]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  623. <mttbb:GetImpactedTests Assemblies="[assemblies]" AssociatedChangesets="[associatedChangesets]" BinariesRoot="[BinariesDirectory]" Build="[BuildDetail]" CodeChanges="{x:Null}" DisplayName="Get Impacted Tests" ImpactedTests="{x:Null}" Workspace="[Workspace]" />
  624. </Sequence>
  625. </If.Then>
  626. </If>
  627. <If Condition="[SourceAndSymbolServerSettings.IndexSources Or SourceAndSymbolServerSettings.HasSymbolStorePath]" DisplayName="If SourceAndSymbolServerSettings.IndexSources Or SourceAndSymbolServerSettings.HasSymbolStorePath" mtbwt:BuildTrackingParticipant.Importance="Low">
  628. <If.Then>
  629. <mtbwa:InvokeForReason DisplayName="Index Sources and Publish Symbols for Triggered Builds" Reason="Triggered">
  630. <mtbwa:InvokeForReason.Variables>
  631. <Variable x:TypeArguments="scg:IEnumerable(x:String)" Name="symbolFiles" />
  632. </mtbwa:InvokeForReason.Variables>
  633. <mtbwa:FindMatchingFiles DisplayName="Find Symbol Files" MatchPattern="[String.Format(&quot;{0}\**\*.pdb&quot;, BinariesDirectory)]" Result="[symbolFiles]" mtbwt:BuildTrackingParticipant.Importance="Low" />
  634. <If Condition="[SourceAndSymbolServerSettings.IndexSources]" DisplayName="If SourceAndSymbolServerSettings.IndexSources" mtbwt:BuildTrackingParticipant.Importance="Low">
  635. <If.Then>
  636. <TryCatch DisplayName="Try Index Sources" mtbwt:BuildTrackingParticipant.Importance="Low">
  637. <TryCatch.Try>
  638. <mtbwa:IndexSources DisplayName="Index Sources" FileList="[symbolFiles]" />
  639. </TryCatch.Try>
  640. <TryCatch.Catches>
  641. <Catch x:TypeArguments="s:Exception">
  642. <ActivityAction x:TypeArguments="s:Exception">
  643. <ActivityAction.Argument>
  644. <DelegateInArgument x:TypeArguments="s:Exception" Name="exception" />
  645. </ActivityAction.Argument>
  646. <mtbwa:WriteBuildError DisplayName="Write Indexing Sources Error" Message="[exception.Message]" />
  647. </ActivityAction>
  648. </Catch>
  649. </TryCatch.Catches>
  650. </TryCatch>
  651. </If.Then>
  652. </If>
  653. <If Condition="[SourceAndSymbolServerSettings.HasSymbolStorePath]" DisplayName="If SourceAndSymbolServerSettings.HasSymbolStorePath" mtbwt:BuildTrackingParticipant.Importance="Low">
  654. <If.Then>
  655. <TryCatch DisplayName="Try Publish Symbols" mtbwt:BuildTrackingParticipant.Importance="Low">
  656. <TryCatch.Try>
  657. <mtbwa:SharedResourceScope DisplayName="Synchronize Access to Symbol Store" MaxExecutionTime="[TimeSpan.Zero]" MaxWaitTime="[New TimeSpan(1, 0, 0)]" ResourceName="[SourceAndSymbolServerSettings.SymbolStorePath]" mtbwt:BuildTrackingParticipant.Importance="Low">
  658. <mtbwa:PublishSymbols DisplayName="Publish Symbols" FileList="[symbolFiles]" ProductName="[BuildDetail.BuildDefinition.Name]" StorePath="[SourceAndSymbolServerSettings.SymbolStorePath]" Version="[BuildDetail.BuildNumber]" />
  659. </mtbwa:SharedResourceScope>
  660. </TryCatch.Try>
  661. <TryCatch.Catches>
  662. <Catch x:TypeArguments="s:Exception">
  663. <ActivityAction x:TypeArguments="s:Exception">
  664. <ActivityAction.Argument>
  665. <DelegateInArgument x:TypeArguments="s:Exception" Name="exception" />
  666. </ActivityAction.Argument>
  667. <mtbwa:WriteBuildError DisplayName="Write Publishing Symbols Error" Message="[exception.Message]" />
  668. </ActivityAction>
  669. </Catch>
  670. </TryCatch.Catches>
  671. </TryCatch>
  672. </If.Then>
  673. </If>
  674. </mtbwa:InvokeForReason>
  675. </If.Then>
  676. </If>
  677. </Parallel>
  678. </Sequence>
  679. </TryCatch.Try>
  680. </TryCatch>
  681. </mtbwa:AgentScope>
  682. <mtbwa:InvokeForReason DisplayName="Check In Gated Changes for CheckInShelveset Builds" Reason="CheckInShelveset">
  683. <mtbwa:CheckInGatedChanges DisplayName="Check In Gated Changes" />
  684. </mtbwa:InvokeForReason>
  685. </Sequence>
  686. </Activity>