-
Notifications
You must be signed in to change notification settings - Fork 1
/
NetCoreProject.UnitTests.csproj
102 lines (90 loc) · 4.74 KB
/
NetCoreProject.UnitTests.csproj
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Unit tests for NetCoreProject.</Description>
<!-- Multi-target all frameworks to test, newest first (for VS runner) -->
<TargetFrameworks>net7.0</TargetFrameworks>
<!-- Test older frameworks in CI (to avoid requiring devs to install) -->
<!--
TODO: Test opportunistically outside of CI?
https://docs.microsoft.com/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
Newtonsoft.Json passes TestFrameworks from checks in build.ps1. Painful.
-->
<TargetFrameworks Condition="'$(CI)' == 'True'">$(TargetFrameworks);netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="'$(CI)' == 'True' and $([MSBuild]::IsOSPlatform('Windows'))">$(TargetFrameworks);net462</TargetFrameworks>
<!--
Disable check for EOL Target Framework (NETSDK1138).
Libraries may want to test against unsupported frameworks to accommodate
users or simplify upgrade paths. No need to warn or fail build.
-->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<IsPackable>false</IsPackable>
<!--
Analyze additional files (for Puma Scan)
https://github.com/pumasecurity/puma-scan/wiki/Installation#step-3-enable-additional-file-analysis
-->
<AdditionalFileItemNames>$(AdditionalFileItemNames);Content</AdditionalFileItemNames>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Remove="stylecop.json" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="stylecop.json" />
</ItemGroup>
<ItemGroup>
<!--
Note: Intentionally not using the following analyzers:
Microsoft.CodeQuality.Analyzers (part of NetAnalyzers)
Microsoft.NetCore.Analyzers (part of NetAnalyzers)
Microsoft.NetFramework.Analyzers (part of NetAnalyzers)
Microsoft.CodeAnalysis.VersionCheckAnalyzer (NetAnalyzers dep only)
Text.Analyzers (https://github.com/dotnet/roslyn-analyzers/issues/2200)
-->
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<!--
Microsoft.CodeAnalysis.NetAnalyzers ships with .NET SDK 5.
Reference it conditionally to support building with old SDKs.
-->
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0" Condition="!$([MSBuild]::VersionGreaterThanOrEquals($(NETCoreSdkVersion), '5.0.0'))">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<!-- TODO: Add Microsoft.EntityFrameworkCore.Analyzers for EF Core proj -->
<PackageReference Include="Puma.Security.Rules.2022" Version="2.4.23">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers" Version="4.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.48.0.56517">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<!-- Note: .Unstable is recommended by devs due to update frequency. See:
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2585 -->
<PackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NetCoreProject\NetCoreProject.csproj" />
</ItemGroup>
</Project>