-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Example Input:
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NetFx>net461</NetFx>
<NetStandard>netstandard2.0</NetStandard>
<NetCoreApp>netcoreapp3.0</NetCoreApp>
<NetCore>net5.0</NetCore>
</PropertyGroup>
<Target Name="MyTarget">
<Message Importance="high" Text="$(NetFx) = $([MSBuild]::GetTargetFrameworkIdentifier($(NetFx)))" />
<Message Importance="high" Text="$(NetStandard) = $([MSBuild]::GetTargetFrameworkIdentifier($(NetStandard)))" />
<Message Importance="high" Text="$(NetCoreApp) = $([MSBuild]::GetTargetFrameworkIdentifier($(NetCoreApp)))" />
<Message Importance="high" Text="$(NetCore) = $([MSBuild]::GetTargetFrameworkIdentifier($(NetCore)))" />
</Target>
</Project>Example Output:
net461 = .NETFramework
netstandard2.0 = .NETStandard
netcoreapp3.0 = .NETCoreApp
net5.0 = .NETCoreApp
API Proposal:
<PropertyGroup>
<RemoraFrameworkIdentifier>$([MSBuild]::GetTargetFrameworkIdentifier($TargetFramework))</RemoraFrameworkIdentifier>
<IsNET>$(RemoraFrameworkIdentifier) == '.NETCoreApp'</IsNET>
<IsNETCore>$(RemoraFrameworkIdentifier) == '.NETCoreApp'</IsNETCore>
<IsNETStandard>$(RemoraFrameworkIdentifier) == '.NETStandard'</IsNETStandard>
<IsNETFramework>$(RemoraFrameworkIdentifier) == '.NETFramework'</IsNETFramework>
<IsRunnableTarget>$(RemoraFrameworkIdentifier) != '.NETStandard'</IsRunnableTarget>
</PropertyGroup>Drawbacks:
We lose differentiation between IsNET and IsNETCore. I'm not too entirely sure what IsNET is used for though - MSBuild doesn't appear to differentiate between netcoreapp3.0 and net5. Additionally, it doesn't appear to be used within the SDK at all. Is this intended for use by consumers of the SDK?
Metadata
Metadata
Assignees
Labels
No labels