Skip to content

Commit

Permalink
BundledVersions: update portable rid logic (backport #14647)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayakael committed Jan 13, 2023
1 parent 3008f7e commit 5ee269e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/SourceBuild/tarball/content/repos/installer.proj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<OverrideTargetRid Condition="'$(TargetOS)' == 'OSX'">osx-x64</OverrideTargetRid>
<OSNameOverride>$(OverrideTargetRid.Substring(0, $(OverrideTargetRid.IndexOf("-"))))</OSNameOverride>

<!-- Determine target portable rid based on bootstrap SDK's portable rid -->
<_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-'))</_platformIndex>
<PortableOS Condition="'$(PortableOS)' == ''">$(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex)))</PortableOS>

<RuntimeArg>--runtime-id $(OverrideTargetRid)</RuntimeArg>
<RuntimeArg Condition="'$(TargetOS)' == 'Linux'">--runtime-id $(TargetRid)</RuntimeArg>

Expand All @@ -22,6 +26,7 @@
-->
<BuildCommandArgs>$(BuildCommandArgs) /p:NETCoreAppMaximumVersion=99.9</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:OSName=$(OSNameOverride)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:PortableOSName=$(PortableOS)</BuildCommandArgs>
<BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:Rid=$(TargetRid)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:DOTNET_INSTALL_DIR=$(DotNetCliToolDir)</BuildCommandArgs>

Expand Down
16 changes: 10 additions & 6 deletions src/redist/targets/GetRuntimeInformation.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('OSX')) ">osx</HostOSName>
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('FREEBSD')) ">freebsd</HostOSName>
<HostOSName Condition=" '$(HostOSName)' == '' AND '$(IsLinux)' == 'True' ">linux</HostOSName>


<OSName Condition=" '$(OSName)' == '' AND $(Rid) != '' ">$(Rid.Substring(0, $(Rid.LastIndexOf('-'))))</OSName>
<OSName Condition=" '$(OSName)' == '' ">$(HostOSName)</OSName>

<Rid Condition=" '$(Rid)' == '' ">$(OSName)-$(Architecture)</Rid>
<PortableOSName Condition=" '$(PortableOSName)' == '' ">$(OSName)</PortableOSName>

<Rid>$(OSName)-$(Architecture)</Rid>

<PortableRid>$(PortableOSName)-$(Architecture)</PortableRid>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -23,10 +28,9 @@
</PropertyGroup>

<PropertyGroup>
<ProductMonikerRid Condition=" '$(Rid)' == 'ubuntu.16.04-x64' OR
'$(Rid)' == 'rhel.6-x64' OR
'$(Rid)' == 'linux-musl-x64' ">$(Rid)</ProductMonikerRid>
<ProductMonikerRid Condition=" '$(ProductMonikerRid)' == '' ">$(OSName)-$(Architecture)</ProductMonikerRid>
<ProductMonikerRid Condition=" '$(ProductMonikerRid)' == '' ">$(Rid)</ProductMonikerRid>

<PortableProductMonikerRid Condition=" '$(PortableProductMonikerRid)' == '' ">$(PortableRid)</PortableProductMonikerRid>

<PortableProductMonikerRid Condition=" '$(PortableProductMonikerRid)' == '' ">$(HostOSName)-$(Architecture)</PortableProductMonikerRid>

Expand Down

0 comments on commit 5ee269e

Please sign in to comment.