-
Notifications
You must be signed in to change notification settings - Fork 326
/
Directory.Build.props
94 lines (85 loc) · 5.02 KB
/
Directory.Build.props
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
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="$(RepositoryEngineeringDir)Analyzers.props" />
<PropertyGroup>
<RepoRoot Condition=" '$(RepoRoot)' == '' ">$([MSBuild]::NormalizeDirectory('$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'LICENSE'))'))</RepoRoot>
<IsSourceFile>false</IsSourceFile>
<IsSourceFile Condition="$([MSBuild]::MakeRelative($(RepoRoot), $(MSBuildProjectFullPath)).StartsWith('src/')) OR $([MSBuild]::MakeRelative($(RepoRoot), $(MSBuildProjectFullPath)).StartsWith('src\'))">true</IsSourceFile>
<SrcPackageFolder>$(RepoRoot)src\package\</SrcPackageFolder>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<!--
This version is read by vsts-prebuild.ps1 and is a base for the current version, this should be updated at the start of
new iteration to the goal number. This is also used to version the local packages. This version needs to be statically
readable when we read the file as xml, don't move it to a .props file, unless you change the build server process
-->
<TPVersionPrefix>17.10.0</TPVersionPrefix>
<!--
Versioning is defined from the build script. Use a default dev build if it's not defined.
Sets the AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion
-->
<Version Condition="'$(Version)' == ''">$(TPVersionPrefix)-dev</Version>
<!-- Override the AssemblyVersion as 15.0.0 since protocol depends on this version for serialization. This is also defined in build script. -->
<AssemblyVersion Condition="'$(AssemblyVersion)' == ''">15.0.0</AssemblyVersion>
<!-- Auto generating binding redirects breaks testhost when running under netcoreapp3.1 vstest.console as .NET Framework net462. -->
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
<!-- But not autogenerating binding redirects also breaks build occasionally, so we tell MSBuild to unify assembly versions,
without outputting binding redirectes. -->
<AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
</PropertyGroup>
<!-- Language configuration -->
<PropertyGroup>
<!-- default to allowing all language features -->
<LangVersion>preview</LangVersion>
<!-- enable strict mode for Roslyn compiler -->
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<!-- default to max warnlevel -->
<AnalysisLevel>preview</AnalysisLevel>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CA1416;RS0037</NoWarn>
</PropertyGroup>
<!-- The TFMs to build and test against. -->
<PropertyGroup>
<!-- Naming is based on dotnet/runtime one -->
<NetFrameworkMinimum>net462</NetFrameworkMinimum>
<!-- When not building from source, hardcode the NetCurrent TFM value as it is hardcoded in a number of places, i.e. nuspec files. -->
<NetCurrent Condition="'$(DotNetBuildSourceOnly)' != 'true'">net9.0</NetCurrent>
<NetCoreAppMinimum>netcoreapp3.1</NetCoreAppMinimum>
<!--
Arcade is making things hard to work with. This property is unset when its value is equal to NetMinimum.
https://github.com/dotnet/arcade/blob/66c9c5397d599af40f2a94989241944f5a73442a/src/Microsoft.DotNet.Arcade.Sdk/tools/TargetFrameworkDefaults.props#L16-L18
Because I don't want to complexify further the logic on VSTest just for that, I will set it to NetMinimum.
-->
<NetPrevious Condition=" $(NetPrevious) == '' ">$(NetMinimum)</NetPrevious>
</PropertyGroup>
<!-- Build & pack config -->
<PropertyGroup>
<Copyright>$(CopyrightMicrosoft)</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<!-- Prevent warning about deprecated target frameworks -->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<DefineConstants Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(DefineConstants);DOTNET_BUILD_FROM_SOURCE</DefineConstants>
<!-- PDB -->
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<!-- Default to all packages generating a corresponding symbol package -->
<IncludeSymbols>true</IncludeSymbols>
<!-- Workaround for AD0001 in analyzers with .NET 9. See https://github.com/dotnet/arcade/issues/14311 -->
<BuildWithNetFrameworkHostedCompiler>true</BuildWithNetFrameworkHostedCompiler>
</PropertyGroup>
<!-- Sign config -->
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
</PropertyGroup>
<!-- Test config -->
<PropertyGroup>
<TestRunnerName>MSTest</TestRunnerName>
<!-- Skip windows only tests on non-windows systems. -->
<TestRunnerAdditionalArguments Condition=" '$(OS)' != 'Windows_NT' ">$(TestRunnerAdditionalArguments) --filter "TestCategory!=Windows&TestCategory!=Windows-Review"</TestRunnerAdditionalArguments>
</PropertyGroup>
</Project>