-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
146 lines (120 loc) · 9.22 KB
/
Copy pathDirectory.Build.props
File metadata and controls
146 lines (120 loc) · 9.22 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!-- Platform needs to be set with TreatAsLocalProperty since it is a global property and cannot be overridden otherwise. -->
<Project TreatAsLocalProperty="Platform">
<PropertyGroup Label="CalculateArch">
<BuildArchitecture Condition="'$(BuildArchitecture)' == ''">$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant())</BuildArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' AND ('$(BuildArchitecture)' == 'arm64' OR '$(BuildArchitecture)' == 's390x' OR '$(BuildArchitecture)' == 'ppc64le' OR '$(BuildArchitecture)' == 'loongarch64')">$(BuildArchitecture)</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
</PropertyGroup>
<!-- Host and target OS detection.
Uses full OS names (windows, linux, osx, freebsd, etc.) matching the VMR convention.
See https://github.com/dotnet/dotnet/blob/main/docs/VMR-Controls.md#output-controls -->
<PropertyGroup Label="CalculateTargetOS">
<HostOS Condition="'$(HostOS)' == '' AND $([MSBuild]::IsOSPlatform('WINDOWS'))">windows</HostOS>
<HostOS Condition="'$(HostOS)' == '' AND $([MSBuild]::IsOSPlatform('OSX'))">osx</HostOS>
<HostOS Condition="'$(HostOS)' == '' AND $([MSBuild]::IsOSPlatform('FREEBSD'))">freebsd</HostOS>
<HostOS Condition="'$(HostOS)' == '' AND $([MSBuild]::IsOSPlatform('OPENBSD'))">openbsd</HostOS>
<HostOS Condition="'$(HostOS)' == '' AND $([MSBuild]::IsOSPlatform('ILLUMOS'))">illumos</HostOS>
<HostOS Condition="'$(HostOS)' == '' AND $([MSBuild]::IsOSPlatform('SOLARIS'))">solaris</HostOS>
<HostOS Condition="'$(HostOS)' == '' AND $([MSBuild]::IsOSPlatform('HAIKU'))">haiku</HostOS>
<HostOS Condition="'$(HostOS)' == '' AND $([MSBuild]::IsOSPlatform('LINUX'))">linux</HostOS>
<IsLinux Condition="'$(HostOS)' == 'linux'">true</IsLinux>
<!-- TargetOS defaults to HostOS; overridable via /p:TargetOS from build scripts. -->
<TargetOS Condition="'$(TargetOS)' == ''">$(HostOS)</TargetOS>
<!-- OSName uses RID-style names (win, not windows) for downstream RID construction. -->
<OSName Condition="'$(OSName)' == '' AND '$(PortableTargetRid)' != ''">$(PortableTargetRid.Substring(0, $(PortableTargetRid.LastIndexOf('-'))))</OSName>
<OSName Condition="'$(OSName)' == '' AND '$(TargetRid)' != ''">$(TargetRid.Substring(0, $(TargetRid.LastIndexOf('-'))))</OSName>
<OSName Condition="'$(OSName)' == '' AND '$(TargetOS)' == 'windows'">win</OSName>
<OSName Condition="'$(OSName)' == ''">$(TargetOS)</OSName>
<TargetRid Condition="'$(TargetRid)' == ''">$(OSName)-$(TargetArchitecture)</TargetRid>
<PortableTargetRid Condition="'$(PortableTargetRid)' == ''">$(OSName)-$(TargetArchitecture)</PortableTargetRid>
</PropertyGroup>
<PropertyGroup>
<Nullable>enable</Nullable>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<PropertyGroup>
<!-- Workaround for https://github.com/NuGet/Home/issues/14745 -->
<SDKAnalysisLevel>10.0.200</SDKAnalysisLevel>
</PropertyGroup>
<PropertyGroup>
<SdkSrcRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src'))</SdkSrcRoot>
<TemplateEngSrcDir>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src', 'TemplateEngine'))</TemplateEngSrcDir>
<TemplateEngTestDir>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'test', 'TemplateEngine'))</TemplateEngTestDir>
<TemplateEngTestAssetsDir>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'test', 'TestAssets', 'TestPackages', 'TemplateEngine'))</TemplateEngTestAssetsDir>
<TestHostFolder>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'redist', '$(Configuration)'))</TestHostFolder>
<TestHostDotNetRoot>$([MSBuild]::NormalizeDirectory('$(TestHostFolder)', 'dotnet'))</TestHostDotNetRoot>
<TestHostDotNetTool>$(TestHostDotNetRoot)$([System.IO.Path]::GetFileName('$(DotNetTool)'))</TestHostDotNetTool>
<TestLayoutDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsTmpDir)', 'testing'))</TestLayoutDir>
<PackageProjectUrl>https://github.com/dotnet/sdk</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<LangVersion>Preview</LangVersion>
<LangVersion Condition="'$(Language)' == 'VB'">16</LangVersion>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<DebugSymbols>true</DebugSymbols>
<!-- Default to all packages generating a corresponding symbol package -->
<IncludeSymbols>true</IncludeSymbols>
<IsShippingPackage>false</IsShippingPackage>
<!-- TFMs -->
<SdkTargetFramework>$(NetCurrent)</SdkTargetFramework>
<VisualStudioServiceTargetFramework>net9.0</VisualStudioServiceTargetFramework>
<!-- NU1507 Disable multi-feed check as .NET uses multiple internal feeds intentionally -->
<!-- NU5039 Disable NuGet is unable to find the readme file in the package. -->
<NoWarn>$(NoWarn);NU1507;NU1202;NU5039</NoWarn>
<!-- do not enable analyzers on source build-->
<EnforceCodeStyleInBuild Condition="'$(DotNetBuildSourceOnly)' != 'true'">true</EnforceCodeStyleInBuild>
<UseSharedCompilation Condition="'$(DotNetBuildSourceOnly)' == 'true'">false</UseSharedCompilation>
<DisableImplicitPackageTargetFallback>true</DisableImplicitPackageTargetFallback>
<DefineConstants Condition="'$(TargetOS)' == 'windows'">$(DefineConstants),TARGET_WINDOWS</DefineConstants>
<DefineConstants Condition="'$(ContinuousIntegrationBuild)' == 'true'">$(DefineConstants),CI_BUILD</DefineConstants>
<DefineConstants Condition="'$(OfficialBuilder)' == 'Microsoft'">$(DefineConstants),MICROSOFT_ENABLE_TELEMETRY</DefineConstants>
<DefineConstants Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(DefineConstants),DOT_NET_BUILD_FROM_SOURCE</DefineConstants>
<!-- The Azure Monitor OTel Exporter is not yet onboarded to source build, so we need to conditionally compile the code that references it. -->
<DefineConstants Condition="'$(DotNetBuildSourceOnly)' != 'true'">$(DefineConstants),MICROSOFT_ENABLE_TELEMETRY_AZURE_MONITOR</DefineConstants>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<!-- Tell Arcade we are using MSTest.Sdk for MSTest test projects. This prevents
Arcade from implicitly adding Microsoft.TestPlatform / MSTest.TestFramework /
MSTest.TestAdapter / Microsoft.NET.Test.Sdk package references (MSTest.Sdk
brings them transitively with versions controlled by the SDK), so the MSTest
package versions don't need to be specified in Directory.Packages.props. -->
<UseMSTestSdk>true</UseMSTestSdk>
<!-- https://github.com/dotnet/source-build/issues/4115. -->
<PublishWindowsPdb>false</PublishWindowsPdb>
<!-- Enable NuGet Audit to check for security vulnerabilities -->
<NuGetAudit>true</NuGetAudit>
<NuGetAuditLevel>low</NuGetAuditLevel>
<NuGetAuditMode>all</NuGetAuditMode>
</PropertyGroup>
<PropertyGroup Condition="'$(IsTestProject)' == 'true'">
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
<!-- Disable NuGet audit in official builds. MSBuild does not correctly handle
WarningsNotAsErrors for NuGet warnings (https://github.com/dotnet/msbuild/issues/10801),
so audit findings become errors via TreatWarningsAsErrors. -->
<PropertyGroup Condition="'$(OfficialBuild)' == 'true'">
<NuGetAudit>false</NuGetAudit>
</PropertyGroup>
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<!-- Global usings -->
<!-- See: https://learn.microsoft.com/dotnet/core/project-sdk/msbuild-props#using -->
<ItemGroup>
<Using Include="System.Runtime.InteropServices" />
<Using Include="System.Text" />
<Using Include="System.Xml.Linq" />
</ItemGroup>
<!-- These aliases need to live outside of Versions.props as VMR / source-build overwrites some of the version properties for live builds. -->
<PropertyGroup>
<!-- Runtime and Apphost pack versions are the same for all RIDs. We flow the x64 version above and create aliases without the winx64 here for clarity elsewhere. -->
<MicrosoftNETCoreAppHostPackageVersion>$(MicrosoftNETCoreAppRefPackageVersion)</MicrosoftNETCoreAppHostPackageVersion>
<MicrosoftNETCoreAppRuntimePackageVersion>$(MicrosoftNETCoreAppRefPackageVersion)</MicrosoftNETCoreAppRuntimePackageVersion>
<MicrosoftAspNetCoreAppRuntimePackageVersion>$(MicrosoftAspNetCoreAppRefPackageVersion)</MicrosoftAspNetCoreAppRuntimePackageVersion>
<MicrosoftWindowsDesktopAppRuntimePackageVersion>$(MicrosoftWindowsDesktopAppRefPackageVersion)</MicrosoftWindowsDesktopAppRuntimePackageVersion>
<HostFxrVersion>$(MicrosoftNETCoreAppRuntimePackageVersion)</HostFxrVersion>
<SharedHostVersion>$(MicrosoftNETCoreAppRuntimePackageVersion)</SharedHostVersion>
<MicrosoftCodeAnalysisVersionForNetAnalyzers Condition="'$(DotNetBuildSourceOnly)' != 'true'">3.11.0</MicrosoftCodeAnalysisVersionForNetAnalyzers>
<MicrosoftCodeAnalysisVersionForNetAnalyzers Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(MicrosoftCodeAnalysisVersion)</MicrosoftCodeAnalysisVersionForNetAnalyzers>
</PropertyGroup>
<Import Project="build/GenerateResxSource.targets" />
</Project>