|
55 | 55 | <TargetGroup Condition="'$(TargetGroup)' == ''">netcoreapp</TargetGroup> |
56 | 56 | <OSGroup Condition="'$(OSGroup)' == ''">$(DefaultOSGroup)</OSGroup> |
57 | 57 | <ConfigurationGroup Condition="'$(ConfigurationGroup)' == ''">Debug</ConfigurationGroup> |
| 58 | + <HostArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture)</HostArch> |
| 59 | + <ArchGroup Condition="'$(ArchGroup)' == '' AND '$(HostArch)' == 'Arm'">arm</ArchGroup> |
| 60 | + <ArchGroup Condition="'$(ArchGroup)' == '' AND '$(HostArch)' == 'Arm64'">arm64</ArchGroup> |
58 | 61 | <ArchGroup Condition="'$(ArchGroup)' == ''">x64</ArchGroup> |
59 | 62 |
|
60 | 63 | <!-- Initialize BuildConfiguration from the individual properties if it wasn't already explicitly set --> |
|
99 | 102 | <!-- Properties to remove with buildtools removal --> |
100 | 103 | <ProjectDir>$(RepoRoot)</ProjectDir> |
101 | 104 | <BinDir>$(ProjectDir)artifacts\bin\</BinDir> |
| 105 | + <ToolsDir Condition="'$(ToolsDir)'==''">$(ProjectDir)Tools/</ToolsDir> |
| 106 | + <BuildToolsTaskDir Condition="'$(MSBuildRuntimeType)' != 'core'">$(ToolsDir)net46/</BuildToolsTaskDir> |
| 107 | + <BuildToolsTaskDir Condition="'$(MSBuildRuntimeType)' == 'core'">$(ToolsDir)</BuildToolsTaskDir> |
| 108 | + |
102 | 109 | <!-- Need to try and keep the same logic as the native builds as we need this for packaging --> |
103 | 110 | <NativeBinDir>$(BinDir)native/$(BuildConfiguration)</NativeBinDir> |
104 | 111 |
|
|
109 | 116 | <PackagesDir>$(DotNetRestorePackagesPath)</PackagesDir> |
110 | 117 | <PackagesDir Condition="'$(PackagesDir)'=='' AND '$(NuGetPackageRoot)' != ''">$([MSBuild]::EnsureTrailingSlash('$(NuGetPackageRoot)'))</PackagesDir> |
111 | 118 | <PackagesDir Condition="'$(PackagesDir)'==''">$(ProjectDir).packages/</PackagesDir> |
112 | | - <ToolsDir Condition="'$(ToolsDir)'==''">$(ProjectDir)Tools/</ToolsDir> |
113 | | - <IlasmToolPath>$(ToolsDir)ilasm/ilasm</IlasmToolPath> |
114 | 119 | <CodeAnalysisRuleset>$(MSBuildThisFileDirectory)CodeAnalysis.ruleset</CodeAnalysisRuleset> |
115 | 120 | <!-- Respect environment variable for the .NET install directory if set; otherwise, use the current default location --> |
116 | 121 | <DotNetRoot Condition="'$(DotNetRoot)' == ''">$(DOTNET_INSTALL_DIR)</DotNetRoot> |
|
122 | 127 | <DotNetCmd Condition="'$(OS)' == 'Windows_NT'">$(DotNetCmd).exe</DotNetCmd> |
123 | 128 | </PropertyGroup> |
124 | 129 |
|
125 | | - <!-- Choose .targets files that come from Arcade rather than from buildtools --> |
126 | | - <!-- TODO: Remove when buildtools dependency removed. --> |
127 | | - <PropertyGroup> |
128 | | - <ExcludeNotSupportedImport>true</ExcludeNotSupportedImport> |
129 | | - <ExcludePartialFacadesImport>true</ExcludePartialFacadesImport> |
130 | | - <ExcludeApiCompatImport>true</ExcludeApiCompatImport> |
131 | | - <ExcludeReferenceAssembliesImport>true</ExcludeReferenceAssembliesImport> |
132 | | - <ExcludePackagingImport>true</ExcludePackagingImport> |
133 | | - <ExcludePackageLibsImport>true</ExcludePackageLibsImport> |
134 | | - <ExcludeCodeAnalysisImport>true</ExcludeCodeAnalysisImport> |
135 | | - <ExcludeResourcesImport>true</ExcludeResourcesImport> |
136 | | - <ExcludeVersioningImport>true</ExcludeVersioningImport> |
137 | | - <ExcludeSigningImport>true</ExcludeSigningImport> |
138 | | - <ExcludeDepProjImport>true</ExcludeDepProjImport> |
139 | | - <ExcludeResolveContractImport>true</ExcludeResolveContractImport> |
140 | | - <ExcludePackageResolveImport>true</ExcludePackageResolveImport> |
141 | | - <ExcludeTestsImport>true</ExcludeTestsImport> |
142 | | - <ExcludeBinPlaceImport>true</ExcludeBinPlaceImport> |
143 | | - </PropertyGroup> |
144 | | - |
145 | 130 | <!-- workaround https://github.com/dotnet/sdk/issues/2288 |
146 | 131 | remove once we have a new CLI --> |
147 | 132 | <PropertyGroup> |
148 | 133 | <LanguageTargets Condition="'$(LanguageTargets)' == '' AND '$(MSBuildProjectExtension)' != '.csproj' AND '$(MSBuildProjectExtension)' != '.vbproj' AND '$(MSBuildProjectExtension)' != '.fsproj'">$(MSBuildToolsPath)\Microsoft.Common.targets</LanguageTargets> |
149 | 134 | </PropertyGroup> |
150 | 135 |
|
151 | | - <!-- Import Build tools common props file where repo-independent properties are found --> |
152 | | - <Import Project="$(ToolsDir)Build.Common.props" Condition="Exists('$(ToolsDir)Build.Common.props')" /> |
153 | | - |
154 | 136 | <!-- Enable the analyzers for this repo --> |
155 | 137 | <PropertyGroup> |
156 | 138 | <EnableAnalyzers Condition="'$(EnableAnalyzers)' == '' AND '$(IsSourceProject)' == 'true'">true</EnableAnalyzers> |
|
160 | 142 | <PropertyGroup Condition="'$(IsTestProject)' == 'true' and '$(ContinuousIntegrationBuild)' == 'true' and '$(OfficialBuildId)' == ''"> |
161 | 143 | <WithoutCategories>IgnoreForCI</WithoutCategories> |
162 | 144 | <EnableDumpling>false</EnableDumpling> |
163 | | - <CrashDumpFolder Condition="'$(RunningOnUnix)' != 'true'">%TMP%\CoreRunCrashDumps</CrashDumpFolder> |
| 145 | + <CrashDumpFolder Condition="'$(OS)' == 'Windows_NT'">%TMP%\CoreRunCrashDumps</CrashDumpFolder> |
164 | 146 | </PropertyGroup> |
165 | | - <PropertyGroup Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(OfficialBuildId)' == ''"> |
166 | | - <!-- Disable F5 and test explorer support for CI builds. --> |
| 147 | + <!-- Disable VS support files on CI and official builds. --> |
| 148 | + <PropertyGroup Condition="'$(ContinuousIntegrationBuild)' == 'true' or '$(OfficialBuildId)' != ''"> |
167 | 149 | <EnableLaunchSettings>false</EnableLaunchSettings> |
168 | 150 | <EnableVSTestReferences>false</EnableVSTestReferences> |
169 | 151 | </PropertyGroup> |
|
175 | 157 | <PropertyGroup> |
176 | 158 | <RestoreSources Condition="'$(DotNetBuildOffline)' != 'true'"> |
177 | 159 | https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json; |
| 160 | + https://dotnetfeed.blob.core.windows.net/dotnet-coreclr/index.json; |
178 | 161 | https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json; |
179 | 162 | https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; |
180 | 163 | https://api.nuget.org/v3/index.json; |
|
211 | 194 | <_runtimeOSVersionIndex>$(RuntimeOS.IndexOfAny(".-0123456789"))</_runtimeOSVersionIndex> |
212 | 195 | <_runtimeOSFamily Condition="'$(_runtimeOSVersionIndex)' != '-1'">$(RuntimeOS.SubString(0, $(_runtimeOSVersionIndex)))</_runtimeOSFamily> |
213 | 196 | <_portableOS>linux</_portableOS> |
214 | | - <_portableOS Condition="'$(_runtimeOSFamily)' == 'win'">win</_portableOS> |
| 197 | + <_portableOS Condition="'$(RuntimeOS)' == 'linux-musl'">linux-musl</_portableOS> |
| 198 | + <_portableOS Condition="'$(_runtimeOSFamily)' == 'win' OR '$(OSGroup)' == 'Windows_NT'">win</_portableOS> |
215 | 199 | <_portableOS Condition="'$(_runtimeOSFamily)' == 'osx'">osx</_portableOS> |
216 | 200 | <_portableOS Condition="'$(_runtimeOSFamily)' == 'FreeBSD'">freebsd</_portableOS> |
217 | 201 | <_portableOS Condition="'$(RuntimeOS)' == 'WebAssembly'">webassembly</_portableOS> |
|
227 | 211 | <MicrosoftNetCoreIlasmPackageRuntimeId Condition="'$(MicrosoftNetCoreIlasmPackageRuntimeId)' == ''">$(ToolRuntimeRID)</MicrosoftNetCoreIlasmPackageRuntimeId> |
228 | 212 |
|
229 | 213 | <!-- support cross-targeting by choosing a RID to restore when running on a different machine that what we're build for --> |
230 | | - <_portableOS Condition="'$(OSGroup)' == 'Unix' AND '$(_runtimeOSFamily)' != 'osx' AND '$(_runtimeOSFamily)' != 'FreeBSD'">linux</_portableOS> |
231 | | - <_portableOS Condition="'$(OSGroup)' == 'Windows_NT'">win</_portableOS> |
| 214 | + <_portableOS Condition="'$(OSGroup)' == 'Unix' AND '$(_runtimeOSFamily)' != 'osx' AND '$(_runtimeOSFamily)' != 'FreeBSD' AND '$(_runtimeOS)' != 'linux-musl'">linux</_portableOS> |
232 | 215 |
|
233 | 216 | <_packageRID/> |
234 | 217 | <_packageRID Condition="'$(PortableBuild)' == 'true'">$(_portableOS)-$(ArchGroup)</_packageRID> |
|
281 | 264 | <DebugType>portable</DebugType> |
282 | 265 |
|
283 | 266 | <!-- Empty DebugType when building for netfx and in windows so that it is set to full or pdbonly later --> |
284 | | - <DebugType Condition="'$(TargetsNetFx)' == 'true' AND '$(RunningOnUnix)' != 'true'"></DebugType> |
| 267 | + <DebugType Condition="'$(TargetsNetFx)' == 'true' AND '$(OS)' == 'Windows_NT'"></DebugType> |
285 | 268 |
|
286 | 269 | <!-- Rhel 6 and FreeBSD doesn't support the source control git package so disable SourceLink --> |
287 | 270 | <EnableSourceLink Condition="$(RuntimeOS.StartsWith('rhel.6')) OR '$(_runtimeOSFamily)' == 'FreeBSD'">false</EnableSourceLink> |
| 271 | + <!-- is is not supported on ARM platforms either. --> |
| 272 | + <EnableSourceLink Condition="'$(HostArch)' == 'Arm' OR '$(HostArch)' == 'Arm64'">false</EnableSourceLink> |
| 273 | + <!-- Disable source link on local builds. --> |
| 274 | + <EnableSourceLink Condition="'$(ContinuousIntegrationBuild)' != 'true' and '$(OfficialBuildId)' == ''">false</EnableSourceLink> |
288 | 275 | </PropertyGroup> |
289 | 276 |
|
290 | 277 | <!-- Set up Default symbol and optimization for Configuration --> |
|
314 | 301 | <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences> |
315 | 302 | <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute> |
316 | 303 | <CopyNuGetImplementations>false</CopyNuGetImplementations> |
| 304 | + <!-- Don't reference implicit framework packages, all projects in this repo must be explicit --> |
| 305 | + <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> |
317 | 306 | </PropertyGroup> |
318 | 307 |
|
319 | 308 | <!-- Language configuration --> |
|
332 | 321 |
|
333 | 322 | <!-- Suppress preview message as we are usually using preview SDK versions. --> |
334 | 323 | <SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage> |
| 324 | + |
| 325 | + <CLSCompliant Condition="'$(CLSCompliant)'=='' and '$(IsTestProject)'=='true'">false</CLSCompliant> |
| 326 | + <CLSCompliant Condition="'$(CLSCompliant)'==''">true</CLSCompliant> |
| 327 | + <GenFacadesIgnoreBuildAndRevisionMismatch>true</GenFacadesIgnoreBuildAndRevisionMismatch> |
335 | 328 | </PropertyGroup> |
336 | 329 |
|
337 | 330 | <!-- Set up some common paths --> |
|
360 | 353 | <RefPath>$(RefRootPath)$(TargetGroup)/</RefPath> |
361 | 354 | <RefPath Condition="$(TargetGroup.EndsWith('aot'))">$(RefRootPath)$(TargetGroup.TrimEnd('aot'))/</RefPath> |
362 | 355 | <NetStandardRefPath>$(RefRootPath)netstandard/</NetStandardRefPath> |
| 356 | + <NetStandard21RefPath>$(RefRootPath)netstandard2.1/</NetStandard21RefPath> |
363 | 357 | <NetFxRefPath>$(RefRootPath)netfx/</NetFxRefPath> |
364 | 358 | <GlobalToolsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'tools'))</GlobalToolsDir> |
365 | 359 |
|
|
471 | 465 | </ItemDefinitionGroup> |
472 | 466 |
|
473 | 467 | <!-- Import it at the end of the props file to override the OutputPath for reference assemblies and use common directory props --> |
474 | | - <Import Project="$(MSBuildThisFileDirectory)eng\ReferenceAssemblies.props" /> |
| 468 | + <Import Project="$(RepositoryEngineeringDir)ReferenceAssemblies.props" /> |
475 | 469 |
|
476 | 470 | <PropertyGroup Condition="'$(IsSourceProject)' == 'true'"> |
477 | 471 | <!-- Set the documentation output file globally. --> |
478 | 472 | <DocumentationFile Condition="'$(DocumentationFile)' == ''">$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile> |
479 | 473 | </PropertyGroup> |
480 | 474 |
|
481 | | - <!-- Use Roslyn Compilers to build --> |
482 | | - <Import Project="$(RoslynPropsFile)" Condition="'$(RunningOnUnix)'!='true' and Exists('$(RoslynPropsFile)') and '$(UseRoslynCompilers)'!='false' and '$(RoslynIncompatibleMsbuildVersion)' != 'true'" /> |
483 | | - <Import Project="$(RoslynPropsFile)" Condition="'$(RunningOnUnix)'=='true' and Exists('$(RoslynPropsFile)') and '$(RoslynIncompatibleMsbuildVersion)' != 'true'" /> |
484 | | - |
485 | 475 | <!-- Additional optimizations --> |
486 | 476 | <PropertyGroup> |
487 | 477 | <!-- Clear the init locals flag on all src projects, except those in VB, where we can't use spans. --> |
|
0 commit comments