Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use targetPlatformMoniker for net5.0 and newer tfms #43965

Merged
merged 6 commits into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/resolveContract.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<ContractAssemblyPath Condition="'$(ContractAssemblyPath)' == '' and
'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
$([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '$(NETCoreAppCurrentVersion)'))">$(NetCoreAppCurrentRefPath)$(TargetFileName)</ContractAssemblyPath>
<ContractAssemblyPath Condition="'$(ContractAssemblyPath)' == '' and !$(TargetFramework.Contains('-'))">$([MSBuild]::NormalizePath('$(BaseOutputPath)', 'ref', '$(TargetFramework)-$(Configuration)', '$(TargetFileName)'))</ContractAssemblyPath>

<TargetFrameworkWithoutPlatform>$([System.Text.RegularExpressions.Regex]::Replace('$(TargetFramework)', '(-[^;]+)', ''))</TargetFrameworkWithoutPlatform>
Anipik marked this conversation as resolved.
Show resolved Hide resolved
<ContractAssemblyPath Condition="'$(ContractAssemblyPath)' == ''">$([MSBuild]::NormalizePath('$(BaseOutputPath)', 'ref', '$(TargetFrameworkWithoutPlatform)-$(Configuration)', '$(TargetFileName)'))</ContractAssemblyPath>
<!-- Disable API compat if the project doesn't have reference assembly -->
<RunApiCompat Condition="'$(HasMatchingContract)' != 'true'">false</RunApiCompat>
</PropertyGroup>
Expand Down
5 changes: 5 additions & 0 deletions eng/targetframeworksuffix.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<Project>

<PropertyGroup>
<TargetPlatformSupported>true</TargetPlatformSupported>
<TargetPlatformVersionSupported>true</TargetPlatformVersionSupported>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFrameworkSuffix)' != '' and '$(TargetFrameworkSuffix)' != 'windows'">
<TargetPlatformIdentifier>$(TargetFrameworkSuffix)</TargetPlatformIdentifier>
<TargetPlatformVersion>0.0</TargetPlatformVersion>
Expand Down
6 changes: 1 addition & 5 deletions eng/versioning.targets
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,9 @@

</Target>

<PropertyGroup>
<PrepareForBuildDependsOn>$(PrepareForBuildDependsOn);RemoveSupportedPlatformAssemblyLevelAttribute</PrepareForBuildDependsOn>
</PropertyGroup>

<!-- Removes specified assembly level attributes. https://github.com/dotnet/runtime/issues/44257-->
<Target Name="RemoveSupportedPlatformAssemblyLevelAttribute"
DependsOnTargets="GetAssemblyAttributes">
AfterTargets="GetAssemblyAttributes">
<ItemGroup>
<AssemblyAttribute Remove="System.Runtime.Versioning.SupportedOSPlatformAttribute" />
buyaa-n marked this conversation as resolved.
Show resolved Hide resolved
<AssemblyAttribute Remove="System.Runtime.Versioning.TargetPlatformAttribute" />
Expand Down
4 changes: 1 addition & 3 deletions src/libraries/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
<Import Sdk="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Project="Sdk.props" />

<PropertyGroup>
<TargetPlatformSupported>true</TargetPlatformSupported>
<TargetPlatformVersionSupported>true</TargetPlatformVersionSupported>
<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>
Expand All @@ -41,7 +39,7 @@

<!-- Initialize BuildSettings from the individual properties. -->
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<BuildTargetFramework Condition="'$(BuildTargetFramework)' == '' and '$(TargetFramework)' != ''">$(TargetFramework)</BuildTargetFramework>
<BuildTargetFramework Condition="'$(BuildTargetFramework)' == '' and '$(TargetFramework)' != ''">$([System.Text.RegularExpressions.Regex]::Replace('$(TargetFramework)', '(-[^;]+)', ''))</BuildTargetFramework>
<!-- Build all .NET Framework configurations when net48 is passed in. This is for convenience. -->
<AdditionalBuildTargetFrameworks Condition="'$(BuildTargetFramework)' == 'net48'">net45;net451;net452;net46;net461;net462;net47;net471;net472</AdditionalBuildTargetFrameworks>
<AdditionalBuildTargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true' and '$(BuildAllProjects)' == 'true'">$(AdditionalBuildTargetFrameworks);netstandard2.0</AdditionalBuildTargetFrameworks>
Expand Down