-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSerilog.Formatting.Log4Net.Tests.csproj
More file actions
87 lines (76 loc) · 4.76 KB
/
Copy pathSerilog.Formatting.Log4Net.Tests.csproj
File metadata and controls
87 lines (76 loc) · 4.76 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
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AwesomeAssertions" Version="9.1.0" />
<PackageReference Include="coverlet.collector" Version="6.0.4" PrivateAssets="all" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="PublicApiGenerator" Version="11.4.6" />
<PackageReference Include="ReportGenerator" Version="5.4.10" PrivateAssets="all" />
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" />
<PackageReference Include="Verify.Xunit" Version="30.5.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.3" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<VSTestLogger Include="GitHubActions%3Bsummary.includePassedTests=true%3Bsummary.includeSkippedTests=true" Visible="false" Condition="$(GITHUB_STEP_SUMMARY) != ''" />
<VSTestLogger Include="trx%3BLogFileName=TestResults-$(TargetFramework).trx" Visible="false" Condition="$(ContinuousIntegrationBuild) == 'true'" />
<VSTestLogger Include="html%3BLogFileName=TestResults-$(TargetFramework).html" Visible="false" />
</ItemGroup>
<PropertyGroup Label="Coverage">
<RootDirectory>$([System.IO.Directory]::GetParent($(MSBuildProjectDirectory)))</RootDirectory>
<CoverageReportDirectory>$([System.IO.Path]::Combine($(RootDirectory),'coverage',$(TargetFramework)))</CoverageReportDirectory>
<VSTestResultsDirectory Condition="$(ContinuousIntegrationBuild) == 'true'">$(RootDirectory)</VSTestResultsDirectory>
<VSTestResultsDirectory Condition="$(ContinuousIntegrationBuild) != 'true'">$([System.IO.Path]::Combine($(CoverageReportDirectory),'results'))</VSTestResultsDirectory>
<VSTestCollect>XPlat Code Coverage</VSTestCollect>
<VSTestLogger>@(VSTestLogger)</VSTestLogger>
</PropertyGroup>
<Target Name="GenerateHtmlCoverageReport" AfterTargets="VSTest" Condition="$(TargetFramework) != ''">
<ItemGroup>
<CoverageReport Include="$(VSTestResultsDirectory)/*/coverage.cobertura.xml" />
</ItemGroup>
<ReportGenerator ReportFiles="@(CoverageReport)" TargetDirectory="$(CoverageReportDirectory)" ReportTypes="HtmlInline;TextSummary" />
</Target>
<!-- Because of https://github.com/microsoft/vstest/issues/2378 -->
<Target Name="MoveCoverageReport" AfterTargets="GenerateHtmlCoverageReport" Condition="$(TargetFramework) != ''">
<Move SourceFiles="@(CoverageReport)" DestinationFolder="$(CoverageReportDirectory)" />
<PropertyGroup>
<CoverageReport>@(CoverageReport)</CoverageReport>
</PropertyGroup>
<ItemGroup>
<CoverageReportParentDirectory Include="$([System.IO.Path]::Combine($(CoverageReport),'..'))" Condition="$(CoverageReport) != ''" />
</ItemGroup>
<RemoveDir Directories="@(CoverageReportParentDirectory)" />
</Target>
<Target Name="DisplayCoverageSummary" AfterTargets="MoveCoverageReport" Condition="$(TargetFramework) != ''">
<PropertyGroup>
<CatCommand Condition="!$([MSBuild]::IsOSPlatform('Windows'))">cat</CatCommand>
<CatCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">type</CatCommand>
</PropertyGroup>
<Exec WorkingDirectory="$(CoverageReportDirectory)" Command="$(CatCommand) Summary.txt" />
</Target>
<Target Name="OpenHtmlCoverageReport" AfterTargets="MoveCoverageReport" Condition="$(TargetFramework) != '' AND $(ContinuousIntegrationBuild) != 'true'">
<PropertyGroup>
<OpenCommand Condition="$([MSBuild]::IsOSPlatform('Linux'))">xdg-open</OpenCommand>
<OpenCommand Condition="$([MSBuild]::IsOSPlatform('OSX'))">open</OpenCommand>
<OpenCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">explorer</OpenCommand>
</PropertyGroup>
<!-- executing "explorer path\to\index.html" returns exit code 1, so we ignore it -->
<Exec WorkingDirectory="$(CoverageReportDirectory)" Command="$(OpenCommand) index.html" Condition="$(OpenCommand) != ''" IgnoreExitCode="true" />
</Target>
<ItemGroup>
<ProjectReference Include="../src/Serilog.Formatting.Log4Net.csproj">
<!-- Run with `dotnet test -p:TestNetStandard20=true` in order to test the netstandard2.0 implementation -->
<SetTargetFramework Condition="$(TestNetStandard20) == 'true'">TargetFramework=netstandard2.0</SetTargetFramework>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Remove="PublicApi.*.cs" />
<None Include="PublicApi.*.cs" />
</ItemGroup>
</Project>