Repository navigation
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
118 lines (102 loc) · 6.16 KB
/
Copy pathDirectory.Build.props
File metadata and controls
118 lines (102 loc) · 6.16 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup Condition="'$(TargetFramework)' == '' and '$(TargetFrameworks)' == ''">
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(MSBuildProjectName)' == 'TUnit.Pipeline'">
<TargetFrameworks>net10.0</TargetFrameworks>
</PropertyGroup>
<!-- .NET Framework only runs on Windows: elsewhere `dotnet test` would hand a net472 leg to Mono.
Test projects that also cover .NET Framework prepend this to their TargetFrameworks; the
.Net4_7 snapshots are verified by the Windows CI leg (ReceivedSnapshots-windows-latest artifact). -->
<PropertyGroup>
<WindowsNetFrameworkTestTarget Condition="'$(OS)' == 'Windows_NT'">net472;</WindowsNetFrameworkTestTarget>
</PropertyGroup>
<PropertyGroup>
<LibraryTargetFramework Condition="$(TargetFramework.StartsWith('net4'))">netstandard2.0</LibraryTargetFramework>
<LibraryTargetFramework Condition="!$(TargetFramework.StartsWith('net4'))">$(TargetFramework)</LibraryTargetFramework>
</PropertyGroup>
<PropertyGroup>
<!-- Versioning: CI computes the version once (GitVersion GitHub Action) and passes it to
every build/pack via -p:Version/-p:AssemblyVersion/... (see .github/workflows/dotnet.yml).
The GitVersion MSBuild task is intentionally NOT used - it crashes on some local repo
states (issue #6077) and would spawn a process per project×TFM. Locally we pin a high
dummy version so strong-named TUnit.Core loads cleanly and project-to-project references
resolve consistently. CI overrides these because it sets the properties explicitly. -->
<Version Condition="'$(GITHUB_ACTIONS)' != 'true' and '$(Version)' == ''">99.99.99</Version>
<AssemblyVersion Condition="'$(GITHUB_ACTIONS)' != 'true' and '$(AssemblyVersion)' == ''">99.99.99.0</AssemblyVersion>
<FileVersion Condition="'$(GITHUB_ACTIONS)' != 'true' and '$(FileVersion)' == ''">99.99.99.0</FileVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
<NoWarn>NU1507;NU1903;CS9107</NoWarn>
<BuildTransitivePath>buildTransitive/$(TargetFramework)/</BuildTransitivePath>
<BuildPath>build/netstandard2.0</BuildPath>
</PropertyGroup>
<!-- Shared properties for all Roslyn-versioned variant projects (e.g. TUnit.Analyzers.Roslyn44) -->
<PropertyGroup Condition="$(MSBuildProjectName.Contains('.Roslyn'))">
<_BaseProjectName>$([System.Text.RegularExpressions.Regex]::Replace($(MSBuildProjectName), '\.Roslyn\d+$', ''))</_BaseProjectName>
<_RoslynDigits>$([System.Text.RegularExpressions.Regex]::Match($(MSBuildProjectName), 'Roslyn(\d+)$').Groups[1].Value)</_RoslynDigits>
<RoslynVersion>$([System.Text.RegularExpressions.Regex]::Replace($(_RoslynDigits), '^(\d)', '$1.'))</RoslynVersion>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<AssemblyName>$(_BaseProjectName)</AssemblyName>
<RootNamespace>$(_BaseProjectName)</RootNamespace>
<IsPackable>false</IsPackable>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<!-- Opts out of the repo-internal analyzers wired in Directory.Build.targets: these compile the
sources of $(_BaseProjectName) (e.g. TUnit.Analyzers for TUnit.Analyzers.Roslyn44), and that
base project is analyzed. -->
<TUnitSkipInternalAnalyzers>true</TUnitSkipInternalAnalyzers>
</PropertyGroup>
<PropertyGroup>
<CurrentYear>$([System.DateTime]::Now.ToString("yyyy"))</CurrentYear>
</PropertyGroup>
<PropertyGroup>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>Copyright (c) Tom Longhurst $(CurrentYear)</Copyright>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://github.com/thomhurst/TUnit</PackageProjectUrl>
<Description>A .NET Testing Framework</Description>
<Authors>Tom Longhurst</Authors>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageIcon>logo.jpg</PackageIcon>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PackageTags>testing;unit;integration;component;test;assert;tester;framework</PackageTags>
</PropertyGroup>
<PropertyGroup>
<RoslynVersion Condition="'$(RoslynVersion)' == ''">4.7</RoslynVersion>
</PropertyGroup>
<PropertyGroup>
<IsTestingPlatformApplication Condition="'$(IsTestingPlatformApplication)' == ''">false</IsTestingPlatformApplication>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<!-- Verify 33+ enforces the Open Source Maintenance Fee at build time (SponsorCheck SC021).
TUnit is a non-revenue open source project, so it claims the OpenSource exemption.
The exemption end month must be no earlier than the build month and at most 12 months
after it, so it is computed from the build clock. Six months sits clear of both bounds,
which absorbs any UTC/local-time difference at a month boundary. The "s" format is
culture-invariant (a "yyyy-MM" custom format would follow the machine's calendar).
See https://github.com/VerifyTests/Verify/blob/main/docs/maintenance-fee.md -->
<PropertyGroup>
<Verify_SponsorshipExemption>OpenSource</Verify_SponsorshipExemption>
<Verify_SponsorshipExemptionUntil>$([System.DateTime]::UtcNow.AddMonths(6).ToString("s").Substring(0, 7))</Verify_SponsorshipExemptionUntil>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)assets/logo.jpg" Pack="true" PackagePath="\" />
</ItemGroup>
<PropertyGroup>
<PolyUseEmbeddedAttribute>true</PolyUseEmbeddedAttribute>
</PropertyGroup>
<!-- Include Polyfill for all target frameworks in internal projects -->
<ItemGroup>
<PackageReference Include="Polyfill">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>