Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Directory.Build.props « libraries « src - github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ebeb3d8048b7d566f3469d56d47d802e5278da22 (plain)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<Project TreatAsLocalProperty="TargetOS">
  <PropertyGroup>
    <SkipImportArcadeSdkFromRoot>true</SkipImportArcadeSdkFromRoot>
  </PropertyGroup>
  <Import Project="..\..\Directory.Build.props" />

  <PropertyGroup Condition="$(MSBuildProjectName.StartsWith('Microsoft.Extensions.'))">
    <IsAspNetCoreApp>true</IsAspNetCoreApp>
    <!-- Temporarily ignore nit warning/errors (e.g. extra whitespace) from Extensions projects -->
    <NoWarn Condition="!$(MSBuildProjectName.EndsWith('.Tests'))">$(NoWarn);SA1129;SA1028;SA1027;SA1121;CA1200;SA1000;CA1507;CA1802;CA1825;CA1018;SA1648;CA2007;SA1001;SA1026;CA1810;SA1206</NoWarn>
    <NoWarn Condition="!$(MSBuildProjectName.Contains('ref'))">$(NoWarn);CS0618</NoWarn>
  </PropertyGroup>

  <PropertyGroup>
    <ToolSetCommonDirectory>$(RepoRoot)artifacts\toolset\Common\</ToolSetCommonDirectory>
    <IsSourceProject>$([System.Text.RegularExpressions.Regex]::IsMatch($(MSBuildProjectDirectory), 'src%24'))</IsSourceProject>
    <IsReferenceAssembly Condition="'$(IsReferenceAssembly)' == '' and ($(MSBuildProjectFullPath.Contains('\ref\')) or $(MSBuildProjectFullPath.Contains('/ref/')))">true</IsReferenceAssembly> 
    <LanguageTargets Condition="'$(MSBuildProjectExtension)' == '.depproj'">$(RepositoryEngineeringDir)depProj.common.targets</LanguageTargets>
    <RuntimeGraph>$(LibrariesProjectRoot)OSGroups.json</RuntimeGraph>
    <BuildTargetFramework>netcoreapp5.0</BuildTargetFramework>
    <ShouldUnsetParentConfigurationAndPlatform>false</ShouldUnsetParentConfigurationAndPlatform>
    <!-- TargetOS can be removed after renaming the property in arcade repo-->
    <BuildOS>$(TargetOS)</BuildOS>
    <AdditionalBuildTargetFrameworks Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(AdditionalBuildTargetFrameworks);$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-NetBSD;$(NetCoreAppCurrent)-FreeBSD</AdditionalBuildTargetFrameworks>
    <!-- Remove once is fixed: https://github.com/dotnet/roslyn/issues/42344 -->
    <GeneratePlatformNotSupportedAssemblyHeaderFile>$(RepositoryEngineeringDir)LicenseHeader.txt</GeneratePlatformNotSupportedAssemblyHeaderFile>
  </PropertyGroup>

  <Import Project="$(RuntimePropsFile)" Condition="Exists('$(RuntimePropsFile)')"/>

  <Import Sdk="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Project="Sdk.props" />
  
  <PropertyGroup>
    <HostArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</HostArch>
    <TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(HostArch)' == 'arm'">arm</TargetArchitecture>
    <TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(HostArch)' == 'arm64'">arm64</TargetArchitecture>
    <TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(TargetOS)' == 'WebAssembly'">wasm</TargetArchitecture>
    <TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(TargetOS)' == 'iOS'">x64</TargetArchitecture>
    <TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(TargetOS)' == 'Android'">x64</TargetArchitecture>
    <TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>

    <!-- RuntimeOS is calculated based on the build system OS, however if building for WebAssembly/iOS/Android we need to let
         the build system to use webassembly/ios/android as the RuntimeOS for produced package RIDs. -->
    <RuntimeOS Condition="'$(TargetOS)' == 'WebAssembly'">$(TargetOS.ToLowerInvariant())</RuntimeOS>
    <RuntimeOS Condition="'$(TargetOS)' == 'iOS'">$(TargetOS.ToLowerInvariant())</RuntimeOS>
    <RuntimeOS Condition="'$(TargetOS)' == 'Android'">$(TargetOS.ToLowerInvariant())</RuntimeOS>
 
    <!-- Initialize BuildSettings from the individual properties if it wasn't already explicitly set -->
    <Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
    <BuildSettings Condition="'$(BuildSettings)' == ''">$(BuildTargetFramework)-$(TargetOS)-$(Configuration)-$(TargetArchitecture)</BuildSettings>
  </PropertyGroup>

  <!-- Define test projects and companions -->
  <PropertyGroup>
    <IsTestProject>false</IsTestProject>
    <IsTestProject Condition="$(MSBuildProjectName.EndsWith('.UnitTests')) or $(MSBuildProjectName.EndsWith('.Tests'))">true</IsTestProject>

    <IsTestSupportProject>false</IsTestSupportProject>
    <IsTestSupportProject Condition="($(MSBuildProjectFullPath.Contains('\tests\')) or $(MSBuildProjectFullPath.Contains('/tests/'))) and '$(IsTestProject)' != 'true'">true</IsTestSupportProject>
    <IsTestProject Condition="'$(IsTestSupportProject)' == 'true'">true</IsTestProject>

    <!-- Treat test assemblies as non-shipping (do not publish or sign them). -->
    <IsShipping Condition="'$(IsTestProject)' == 'true'">false</IsShipping>
  </PropertyGroup>

  <!-- Common repo directories -->
  <PropertyGroup>
    <!-- Need to try and keep the same logic as the native builds as we need this for packaging -->
    <NativeBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'native', '$(BuildTargetFramework)-$(TargetOS)-$(Configuration)-$(TargetArchitecture)'))</NativeBinDir>
    <PkgDir>$([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'pkg'))</PkgDir>
  </PropertyGroup>

  <PropertyGroup>
    <!-- By default make all libraries to be AnyCPU but individual projects can override it if they need to -->
    <Platform>AnyCPU</Platform>
  </PropertyGroup>

  <PropertyGroup>
    <RunApiCompatForSrc>$(IsSourceProject)</RunApiCompatForSrc>
    <RunMatchingRefApiCompat>$(IsSourceProject)</RunMatchingRefApiCompat>
    <ApiCompatExcludeAttributeList>$(RepositoryEngineeringDir)DefaultGenApiDocIds.txt,$(RepositoryEngineeringDir)ApiCompatExcludeAttributes.txt</ApiCompatExcludeAttributeList>
  </PropertyGroup>

  <ItemGroup>
    <!-- Projects which are manually built. -->
    <ProjectExclusions Include="$(CommonTestPath)System\Net\Prerequisites\**\*.csproj" />
    <!-- TODO: Reenable when mono supports utf8string. -->
    <ProjectExclusions Include="$(MSBuildThisFileDirectory)\System.Utf8String.Experimental\**\*.csproj" Condition="'$(RuntimeFlavor)' == 'Mono'" />
  </ItemGroup>

  <PropertyGroup>
    <_runtimeOSVersionIndex>$(RuntimeOS.IndexOfAny(".-0123456789"))</_runtimeOSVersionIndex>
    <_runtimeOSFamily Condition="'$(_runtimeOSVersionIndex)' != '-1'">$(RuntimeOS.SubString(0, $(_runtimeOSVersionIndex)))</_runtimeOSFamily>
    <_portableOS>linux</_portableOS>
    <_portableOS Condition="'$(RuntimeOS)' == 'linux-musl'">linux-musl</_portableOS>
    <_portableOS Condition="'$(_runtimeOSFamily)' == 'win' or '$(TargetOS)' == 'Windows_NT'">win</_portableOS>
    <_portableOS Condition="'$(_runtimeOSFamily)' == 'osx'">osx</_portableOS>
    <_portableOS Condition="'$(_runtimeOSFamily)' == 'FreeBSD'">freebsd</_portableOS>
    <_portableOS Condition="'$(RuntimeOS)' == 'WebAssembly'">webassembly</_portableOS>
    <_portableOS Condition="'$(RuntimeOS)' == 'ios'">ios</_portableOS>
    <_portableOS Condition="'$(RuntimeOS)' == 'android'">android</_portableOS>

    <_runtimeOS>$(RuntimeOS)</_runtimeOS>
    <_runtimeOS Condition="'$(_runtimeOS)' == 'tizen.4.0.0'">linux</_runtimeOS>
    <_runtimeOS Condition="'$(_runtimeOS)' == 'tizen.5.0.0'">linux</_runtimeOS>
    <_runtimeOS Condition="'$(PortableBuild)' == 'true'">$(_portableOS)</_runtimeOS>
    <ToolRuntimeRID Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(_runtimeOS)-x64</ToolRuntimeRID>
    <ToolRuntimeRID Condition="'$(ToolRuntimeID)' == ''">$(_runtimeOS)-$(HostArch)</ToolRuntimeRID>
    <!-- We build linux-musl-arm on a ubuntu container, so we can't use the toolset build for alpine runtime. We need to use portable linux RID for our toolset in order to be able to use it. -->
    <ToolRuntimeRID Condition="'$(_runtimeOS)' == 'linux-musl' and $(TargetArchitecture.StartsWith('arm')) and !$(HostArch.StartsWith('arm'))">linux-x64</ToolRuntimeRID>

    <!-- There are no WebAssembly tools, so use the default ones -->
    <_buildingInOSX>$([MSBuild]::IsOSPlatform('OSX'))</_buildingInOSX>
    <ToolRuntimeRID Condition="'$(RuntimeOS)' == 'webassembly' and '$(TargetOS)' == 'Windows_NT'">win-x64</ToolRuntimeRID>
    <ToolRuntimeRID Condition="'$(RuntimeOS)' == 'webassembly' and '$(TargetOS)' != 'Windows_NT' and $(_buildingInOSX)">osx-x64</ToolRuntimeRID>
    <ToolRuntimeRID Condition="'$(RuntimeOS)' == 'webassembly' and '$(TargetOS)' != 'Windows_NT' and !$(_buildingInOSX)">linux-x64</ToolRuntimeRID>

    <!-- There are no Android tools, so use the default ones -->
    <ToolRuntimeRID Condition="'$(RuntimeOS)' == 'android' and '$(TargetOS)' == 'Windows_NT'">win-x64</ToolRuntimeRID>
    <ToolRuntimeRID Condition="'$(RuntimeOS)' == 'android' and '$(TargetOS)' != 'Windows_NT' and $(_buildingInOSX)">osx-x64</ToolRuntimeRID>
    <ToolRuntimeRID Condition="'$(RuntimeOS)' == 'android' and '$(TargetOS)' != 'Windows_NT' and !$(_buildingInOSX)">linux-x64</ToolRuntimeRID>

    <!-- There are no iOS tools and it can be built on OSX only, so use that -->
    <ToolRuntimeRID Condition="'$(RuntimeOS)' == 'ios'">osx-x64</ToolRuntimeRID>
    <MicrosoftNetCoreIlasmPackageRuntimeId>$(ToolRuntimeRID)</MicrosoftNetCoreIlasmPackageRuntimeId>

    <!-- support cross-targeting by choosing a RID to restore when running on a different machine that what we're build for -->
    <_portableOS Condition="'$(TargetOS)' == 'Unix' and '$(_runtimeOSFamily)' != 'osx' and '$(_runtimeOSFamily)' != 'FreeBSD' and '$(_runtimeOS)' != 'linux-musl'">linux</_portableOS>

    <!-- support cross-targeting by choosing a RID to restore when running on a different machine that what we're build for -->
    <_portableOS Condition="'$(TargetOS)' == 'Unix' and '$(_runtimeOSFamily)' != 'osx' and '$(_runtimeOSFamily)' != 'FreeBSD' and '$(_runtimeOS)' != 'linux-musl'">linux</_portableOS>

    <_packageRID />
    <_packageRID Condition="'$(PortableBuild)' == 'true'">$(_portableOS)-$(TargetArchitecture)</_packageRID>
    <PackageRID Condition="'$(PackageRID)' == ''">$(_packageRID)</PackageRID>
    <PackageRID Condition="'$(PackageRID)' == ''">$(RuntimeOS)-$(TargetArchitecture)</PackageRID>
  </PropertyGroup>

  <!-- set properties for each vertical -->
  <PropertyGroup>
    <BuildingNETCoreAppVertical Condition="'$(BuildingNETCoreAppVertical)' == '' and ('$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildAllConfigurations)' == 'true')">true</BuildingNETCoreAppVertical>
    <BuildingNETFxVertical Condition="'$(BuildingNETFxVertical)' == '' and ('$(BuildTargetFramework)' == '$(NetFrameworkCurrent)' or '$(BuildAllConfigurations)' == 'true')">true</BuildingNETFxVertical>
    <BinPlaceNETCoreAppPackage Condition="'$(BuildingNETCoreAppVertical)' == 'true'">true</BinPlaceNETCoreAppPackage>
  </PropertyGroup>

  <!--
    Import the arcade sdk with these requirements.
    After:
      Configuration setup

    Before:
      DebugType needs to be not be set to embedded at least for facades
      OutputPath setup
  -->
  <PropertyGroup>
    <DisableArcadeTestFramework>true</DisableArcadeTestFramework>
  </PropertyGroup>

  <Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />

  <!-- Import packaging props -->
  <Import Project="$(RepositoryEngineeringDir)packaging.props" />
  
  <PropertyGroup>
    <RefRootPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'ref'))</RefRootPath>
    <!-- Assembly bin directory where implementation and ref output are placed -->
    <AssemblyBinDirOutputPath Condition="'$(ReferenceAssemblyOutputPath)' == ''">$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', '$(MSBuildProjectName)'))</AssemblyBinDirOutputPath>  
    <BaseIntermediateOutputPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsObjDir)', '$(MSBuildProjectName)'))</BaseIntermediateOutputPath>
    <BaseIntermediateOutputPath Condition="'$(IsReferenceAssembly)' == 'true'">$([MSBuild]::NormalizeDirectory('$(ArtifactsObjDir)', '$(MSBuildProjectName)', 'ref'))</BaseIntermediateOutputPath>
    <BaseOutputPath Condition="'$(IsReferenceAssembly)' == 'true'">$([MSBuild]::NormalizeDirectory('$(AssemblyBinDirOutputPath)', 'ref'))</BaseOutputPath>    
  </PropertyGroup>
  
  <Import Project="$(MSBuildThisDirectory)targetframework.props" Condition="'$(DesignTimeBuild)' != 'true'" />

  <PropertyGroup>
    <!-- Always pass portable to override arcade sdk which uses embedded for local builds -->
    <DebugType>portable</DebugType>

    <!-- Default any assembly not specifying a key to use the Open Key -->
    <StrongNameKeyId>Open</StrongNameKeyId>
    <!-- Microsoft.Extensions projects have a separate StrongNameKeyId -->
    <StrongNameKeyId Condition="$(MSBuildProjectName.StartsWith('Microsoft.Extensions.'))">MicrosoftAspNetCore</StrongNameKeyId>

    <!-- Empty DebugType when building for netfx and in windows so that it is set to full or pdbonly later -->
    <DebugType Condition="'$(TargetsNetFx)' == 'true' and '$(TargetOS)' == 'Windows_NT'" />

    <!-- Workaround for codecov issue https://github.com/tonerdo/coverlet/issues/312 -->
    <EnableSourceLink Condition="'$(ContinuousIntegrationBuild)' != 'true' and '$(OfficialBuildId)' == ''">false</EnableSourceLink>

    <!-- TODO-NULLABLE: Remove once netstandard has annotations for Debug.Assert, string.IsNullOrEmpty, etc. -->
    <NoWarn Condition="'$(TargetsNetFx)' == 'true' or '$(TargetsNetStandard)' == 'true'">$(NoWarn);nullable</NoWarn>
  </PropertyGroup>

  <!-- Set up Default symbol and optimization for Configuration -->
  <Choose>
    <When Condition="'$(Configuration)' == 'Debug'">
      <PropertyGroup>
        <DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
        <Optimize Condition="'$(Optimize)' == ''">false</Optimize>
        <DebugType Condition="'$(DebugType)' == ''">full</DebugType>
        <DefineConstants>$(DefineConstants),TRACE,DEBUG</DefineConstants>
      </PropertyGroup>
    </When>
    <When Condition="'$(Configuration)' == 'Release'">
      <PropertyGroup>
        <DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
        <Optimize Condition="'$(Optimize)' == ''">true</Optimize>
        <DebugType Condition="'$(DebugType)' == ''">pdbonly</DebugType>
        <DefineConstants>$(DefineConstants),TRACE</DefineConstants>
      </PropertyGroup>
    </When>
  </Choose>

  <!-- Disable some standard properties for building our projects -->
  <PropertyGroup>
    <NoStdLib>true</NoStdLib>
    <NoExplicitReferenceToStdLib>true</NoExplicitReferenceToStdLib>
    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
    <CopyNuGetImplementations>false</CopyNuGetImplementations>
    <DisableImplicitConfigurationDefines>true</DisableImplicitConfigurationDefines>
    <!-- Don't reference implicit framework packages, all projects in this repo must be explicit -->
    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
    <!-- We can't generate an apphost without restoring the targeting pack. -->
    <UseAppHost>false</UseAppHost>
  </PropertyGroup>

  <!-- Language configuration -->
  <PropertyGroup>
    <Features>strict;nullablePublicOnly</Features>
    <WarningLevel>4</WarningLevel>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <!-- We decided to keep this disabled by default: https://github.com/dotnet/runtime/issues/15152 -->
    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
    <GenFacadesIgnoreBuildAndRevisionMismatch>true</GenFacadesIgnoreBuildAndRevisionMismatch>
    <EnableAnalyzers Condition="'$(EnableAnalyzers)' == '' and '$(IsSourceProject)' == 'true' and '$(MSBuildProjectExtension)' != '.ilproj'">true</EnableAnalyzers>
  </PropertyGroup>

  <!-- Set up some common paths -->
  <PropertyGroup>
    <CommonPathRoot>$([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'Common'))</CommonPathRoot>
    <CommonPath>$([MSBuild]::NormalizeDirectory('$(CommonPathRoot)', 'src'))</CommonPath>
    <CommonTestPath>$([MSBuild]::NormalizeDirectory('$(CommonPathRoot)', 'tests'))</CommonTestPath>
  </PropertyGroup>

  <!-- Set up the default output and intermediate paths -->
  <PropertyGroup>
    <!--
      Microsoft.NET.TargetFrameworkInference.targets appends the TargetFramework.
      We do this manually and use the Configuration instead.
    -->
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>

    <RuntimePath Condition="'$(RuntimePath)' == ''">$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'runtime', '$(BuildSettings)'))</RuntimePath>
    <BuildTargetFrameworkRefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', '$(BuildTargetFramework)'))</BuildTargetFrameworkRefPath>
    <NetStandard20RefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', 'netstandard2.0'))</NetStandard20RefPath>
    <NetStandard21RefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', 'netstandard2.1'))</NetStandard21RefPath>
    <NetFxRefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', '$(NetFrameworkCurrent)'))</NetFxRefPath>

    <!-- Helix properties -->
    <OSPlatformConfig>$(TargetOS).$(Platform).$(Configuration)</OSPlatformConfig>
    <AnyOSPlatformConfig>AnyOS.AnyCPU.$(Configuration)</AnyOSPlatformConfig>
    <UnixPlatformConfig>Unix.$(Platform).$(Configuration)</UnixPlatformConfig>
    <TestArchiveRoot>$(ArtifactsDir)helix/</TestArchiveRoot>
    <TestArchiveTestsRoot>$(TestArchiveRoot)tests/</TestArchiveTestsRoot>
    <TestArchiveTestsDir>$(TestArchiveTestsRoot)$(OSPlatformConfig)/</TestArchiveTestsDir>
    <TestArchiveRuntimeRoot>$(TestArchiveRoot)runtime/</TestArchiveRuntimeRoot>

    <!-- Paths to binplace package content -->
    <NETCoreAppPackageRefPath>$(ArtifactsBinDir)pkg\$(NetCoreAppCurrent)\ref</NETCoreAppPackageRefPath>
    <NETCoreAppPackageRuntimePath>$(ArtifactsBinDir)pkg\$(NetCoreAppCurrent)\lib</NETCoreAppPackageRuntimePath>
    
    <ASPNETCoreAppPackageRefPath>$(ArtifactsBinDir)pkg\aspnetcoreapp\ref</ASPNETCoreAppPackageRefPath>
    <ASPNETCoreAppPackageRuntimePath>$(ArtifactsBinDir)pkg\aspnetcoreapp\lib</ASPNETCoreAppPackageRuntimePath>

    <TestHostRootPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'testhost', '$(BuildSettings)'))</TestHostRootPath>


    <VersionFileForPackages Condition="'$(VersionFileForPackages)' == ''">$(ArtifactsObjDir)version.txt</VersionFileForPackages>

    <AdditionalBuildTargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true' and '$(BuildAllProjects)' == 'true'">$(AdditionalBuildTargetFrameworks);netstandard2.0</AdditionalBuildTargetFrameworks>
  </PropertyGroup>

  <!-- Import it at the end of the props file to override the OutputPath for reference assemblies and use common directory props -->
  <Import Project="$(RepositoryEngineeringDir)referenceAssemblies.props" Condition="'$(IsReferenceAssembly)' == 'true'" />

  <PropertyGroup>
    <DisableProjectRestore Condition="'$(MSBuildProjectExtension)' == '.depproj' or '$(MSBuildProjectExtension)' == '.pkgproj'">true</DisableProjectRestore>
  </PropertyGroup>

  <Import Project="$(RepositoryEngineeringDir)restore\repoRestore.props" Condition="'$(DisableProjectRestore)' == 'true'" />

  <PropertyGroup>
    <EnableDefaultItems>false</EnableDefaultItems>

    <!-- Workaround for https://github.com/microsoft/msbuild/issues/4474 -->
    <GenerateResourceUsePreserializedResources>false</GenerateResourceUsePreserializedResources>

    <!-- Clear the init locals flag on all src projects, except those in VB, where we can't use spans. -->
    <ILLinkClearInitLocals Condition="'$(IsSourceProject)' == 'true' and '$(Language)' != 'VB'">true</ILLinkClearInitLocals>
  </PropertyGroup>

  <PropertyGroup>
    <MonoRspFileName>mono.issues.rsp</MonoRspFileName>
  </PropertyGroup>

  <PropertyGroup Condition="'$(BuildAllConfigurations)' != 'true'">
    <!-- We add extra binplacing for the test shared framework until we can get hardlinking with the runtime directory working on all platforms -->
    <BinPlaceTestSharedFramework Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'">true</BinPlaceTestSharedFramework>
    <BinPlaceNETFXRuntime Condition="'$(BuildTargetFramework)' == '$(NetFrameworkCurrent)'">true</BinPlaceNETFXRuntime>

    <NETCoreAppTestSharedFrameworkPath>$([MSBuild]::NormalizeDirectory('$(TestHostRootPath)', 'shared', 'Microsoft.NETCore.App', '$(ProductVersion)'))</NETCoreAppTestSharedFrameworkPath>

    <TestHostRuntimePath Condition="'$(BinPlaceTestSharedFramework)' == 'true'">$(NETCoreAppTestSharedFrameworkPath)</TestHostRuntimePath>
    <TestHostRuntimePath Condition="'$(BinPlaceNETFXRuntime)' == 'true'">$(TestHostRootPath)</TestHostRuntimePath>

    <PlatformManifestFile Condition="'$(BinPlaceTestSharedFramework)' == 'true'">$(TestHostRuntimePath)PlatformManifest.txt</PlatformManifestFile>
  </PropertyGroup>

  <ItemGroup Condition="'$(PlatformManifestFile)' != '' and '$(IsTestProject)' == 'true'">
    <PackageConflictPlatformManifests Include="$(PlatformManifestFile)" />
  </ItemGroup>

  <ItemGroup Condition="'$(IsTestProject)' == 'true' and '$(IsTestSupportProject)' != 'true'">
    <ProjectReference Include="$(CommonTestPath)TestUtilities\TestUtilities.csproj" />
  </ItemGroup>

  <PropertyGroup Condition="'$(IsTestProject)' == 'true' and '$(IsTestSupportProject)' != 'true'">
    <EnableTestSupport>true</EnableTestSupport>
    <EnableCoverageSupport Condition="'$(Coverage)' == 'true' and '$(CoverageSupported)' != 'false'">true</EnableCoverageSupport>
    <EnableLaunchSettings Condition="'$(DotNetBuildFromSource)' != 'true' and '$(BuildAllConfigurations)' != 'true'">true</EnableLaunchSettings>
  </PropertyGroup>

  <Import Project="$(RepositoryEngineeringDir)testing\tests.props" Condition="'$(EnableTestSupport)' == 'true'" />
  <Import Project="$(RepositoryEngineeringDir)testing\coverage.props" Condition="'$(EnableCoverageSupport)' == 'true'" />

  <!-- Use msbuild path functions as that property is used in bash scripts. -->
  <ItemGroup>
    <CoverageExcludeFile Include="$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Common', 'src', 'System', 'SR.*'))" />
    <CoverageExcludeFile Include="$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Common', 'src', 'System', 'NotImplemented.cs'))" />
  </ItemGroup>

  <ItemGroup>
    <!-- Link to the testhost folder to probe additional assemblies. -->
    <CoverageProbePath Include="shared\Microsoft.NETCore.App\$(ProductVersion)" />
  </ItemGroup>

  <ItemDefinitionGroup Condition="'$(IsTestProject)' != 'true'">
    <!-- Project references for non-test assemblies should never be copied to the output. -->
    <ProjectReference>
      <Private>false</Private>
    </ProjectReference>
  </ItemDefinitionGroup>

  <!--
    The Utf8String package is experimental. We don't want tests to inadvertently take a dependency on this
    feature unless they explicitly opt in to it. (Source projects explicitly reference their dependencies,
    so they can't inadvertently take a dependency on it.)
  -->
  <ItemGroup Condition="'$(IsTestProject)' == 'true' and '$(IncludeUtf8StringAsmRef)' != 'true'">
    <DefaultReferenceExclusions Include="System.Utf8String.Experimental" />
  </ItemGroup>

  <PropertyGroup>
    <CLSCompliant Condition="'$(CLSCompliant)' == '' and '$(IsTestProject)' == 'true'">false</CLSCompliant>
    <CLSCompliant Condition="'$(CLSCompliant)' == ''">true</CLSCompliant>
  </PropertyGroup>
</Project>