-
Notifications
You must be signed in to change notification settings - Fork 390
Expand file tree
/
Copy pathXUnitRunner.targets
More file actions
87 lines (74 loc) · 5.06 KB
/
Copy pathXUnitRunner.targets
File metadata and controls
87 lines (74 loc) · 5.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>
<PropertyGroup>
<XUnitPublishTargetFramework Condition="'$(XUnitPublishTargetFramework)' == ''">net11.0</XUnitPublishTargetFramework>
<XUnitRuntimeTargetFramework Condition="'$(XUnitRuntimeTargetFramework)' == ''">netcoreapp2.0</XUnitRuntimeTargetFramework>
<XUnitRunnerVersion Condition="'$(XUnitRunnerVersion)' == ''">2.9.3</XUnitRunnerVersion>
<_XUnitPublishTargetsPath>$(MSBuildThisFileDirectory)XUnitPublish.targets</_XUnitPublishTargetsPath>
<XUnitArguments Condition="'$(XUnitArguments)' == ''">-nocolor</XUnitArguments>
</PropertyGroup>
<ItemGroup Condition="'@(XUnitProject)' != ''">
<HelixCorrelationPayload Include="xunit-runner">
<Uri>https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/dotnet-public/nuget/v3/flat2/xunit.runner.console/$(XUnitRunnerVersion)/xunit.runner.console.$(XUnitRunnerVersion).nupkg</Uri>
<Destination>xunit-runner</Destination>
</HelixCorrelationPayload>
</ItemGroup>
<!--
Phase 1 of the test-runner consolidation effort. XUnitProject is
scheduled for removal in favour of MTPProject + CreateMTPWorkItems,
which covers xUnit v3, MSTest 4.x, NUnit, TUnit and any other
Microsoft.Testing.Platform based framework. See
Documentation/TestRunnerConsolidation.md.
Suppress by setting:
<SuppressArcadeXUnitProjectDeprecationWarning>true</SuppressArcadeXUnitProjectDeprecationWarning>
-->
<Target Name="_WarnXUnitProjectDeprecated"
Condition="'@(XUnitProject)' != '' AND '$(SuppressArcadeXUnitProjectDeprecationWarning)' != 'true'"
BeforeTargets="Restore;Build">
<Warning Code="ARCADE0010"
Text="The 'XUnitProject' item and the xunit.runner.console-based Helix work-item generator are deprecated and will be removed in a future Arcade release. Migrate to 'MTPProject' (see src/Microsoft.DotNet.Helix/Sdk/Readme.md and Documentation/TestRunnerConsolidation.md)." />
</Target>
<Target Name="RestoreXUnitProjects"
Condition="'@(XUnitProject)' != ''"
BeforeTargets="Restore"
Outputs="%(XUnitProject.Identity)%(XUnitProject.TargetFramework)%(XUnitProject.RuntimeTargetFramework)%(XUnitProject.AdditionalProperties)">
<MSBuild Projects="%(XUnitProject.Identity)"
Targets="Restore"
Properties="CustomAfterMicrosoftCommonTargets=$(_XUnitPublishTargetsPath);%(XUnitProject.AdditionalProperties)">
</MSBuild>
</Target>
<Target Name="BuildXUnitProjects"
Condition="'@(XUnitProject)' != ''"
BeforeTargets="CoreBuild"
Outputs="%(XUnitProject.Identity)%(XUnitProject.TargetFramework)%(XUnitProject.RuntimeTargetFramework)%(XUnitProject.AdditionalProperties)">
<PropertyGroup>
<_CurrentXUnitProject>%(XUnitProject.Identity)</_CurrentXUnitProject>
<_CurrentPublishTargetFramework>%(XUnitProject.TargetFramework)</_CurrentPublishTargetFramework>
<_CurrentPublishTargetFramework Condition="'$(_CurrentPublishTargetFramework)' == ''">$(XUnitPublishTargetFramework)</_CurrentPublishTargetFramework>
<_CurrentRuntimeTargetFramework>%(XUnitProject.RuntimeTargetFramework)</_CurrentRuntimeTargetFramework>
<_CurrentRuntimeTargetFramework Condition="'$(_CurrentRuntimeTargetFramework)' == ''">$(XUnitRuntimeTargetFramework)</_CurrentRuntimeTargetFramework>
<_CurrentAdditionalProperties>%(XUnitProject.AdditionalProperties)</_CurrentAdditionalProperties>
</PropertyGroup>
<MSBuild Projects="$(_CurrentXUnitProject)" Targets="PublishWithOutput" Properties="CustomAfterMicrosoftCommonTargets=$(_XUnitPublishTargetsPath);TargetFramework=$(_CurrentPublishTargetFramework);$(_CurrentAdditionalProperties)">
<Output TaskParameter="TargetOutputs" PropertyName="_PublishOutputDir" />
</MSBuild>
<MSBuild Projects="$(_CurrentXUnitProject)" Targets="GetTargetPath" Properties="CustomAfterMicrosoftCommonTargets=$(_XUnitPublishTargetsPath);TargetFramework=$(_CurrentPublishTargetFramework);$(_CurrentAdditionalProperties)">
<Output TaskParameter="TargetOutputs" PropertyName="_TargetPath" />
</MSBuild>
<ItemGroup>
<XUnitProject Condition="'%(Identity)' == '$(_CurrentXUnitProject)'">
<PublishDirectory>$(_PublishOutputDir)</PublishDirectory>
<TargetPath>$(_TargetPath)</TargetPath>
<PublishTargetFramework>$(_CurrentPublishTargetFramework)</PublishTargetFramework>
<RuntimeTargetFramework>$(_CurrentRuntimeTargetFramework)</RuntimeTargetFramework>
</XUnitProject>
</ItemGroup>
</Target>
<Target Name="CreateXUnitWorkItems"
Condition="'@(XUnitProject)' != ''"
BeforeTargets="CoreTest">
<CreateXUnitWorkItems XUnitProjects="@(XUnitProject)" IsPosixShell="$(IsPosixShell)" XUnitArguments="$(XUnitArguments)" XUnitWorkItemTimeout="$(XUnitWorkItemTimeout)" DotNetCliVersion="$(DotNetCliVersion)">
<Output TaskParameter="XUnitWorkItems" ItemName="HelixWorkItem"/>
</CreateXUnitWorkItems>
</Target>
</Project>