[release/8.0.1xx] Update scripts to set distro RID and properties to use it as TargetRid (#17203)

This commit is contained in:
Elinor Fung 2023-08-17 09:48:16 -07:00 committed by GitHub
parent 4f47f33ea4
commit 70afe0c29b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 4 deletions

View file

@ -63,4 +63,8 @@ while [[ $# > 0 ]]; do
shift
done
source $REPOROOT/eng/common/native/init-os-and-arch.sh
source $REPOROOT/eng/common/native/init-distro-rid.sh
initDistroRidGlobal "$os" "$arch" ""
. "$REPOROOT/eng/common/build.sh" --build --restore "${args[@]}"

View file

@ -158,6 +158,8 @@
</PropertyGroup>
<PropertyGroup>
<!-- Use current machine distro RID if set. Otherwise, fall back to RuntimeInformation.RuntimeIdentifier -->
<TargetRid Condition="'$(TargetRid)' == ''">$(__DistroRid)</TargetRid>
<TargetRid Condition="'$(TargetRid)' == ''">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</TargetRid>
<TargetOS Condition="'$(TargetOS)' == '' AND $([MSBuild]::IsOSPlatform('WINDOWS'))">Windows_NT</TargetOS>
@ -165,10 +167,11 @@
<TargetOS Condition="'$(TargetOS)' == '' AND $([MSBuild]::IsOSPlatform('LINUX'))">Linux</TargetOS>
<TargetOS Condition="'$(TargetOS)' == '' AND $([MSBuild]::IsOSPlatform('FREEBSD'))">FreeBSD</TargetOS>
<PortableRid Condition="'$(TargetOS)' == 'FreeBSD'">freebsd-$(Platform)</PortableRid>
<PortableRid Condition="'$(TargetOS)' == 'OSX'">osx-$(Platform)</PortableRid>
<PortableRid Condition="'$(TargetOS)' == 'Linux'">linux-$(Platform)</PortableRid>
<PortableRid Condition="'$(TargetOS)' == 'Windows_NT'">win-$(Platform)</PortableRid>
<PortableRid Condition="'$(__PortableTargetOS)' != ''">$(__PortableTargetOS)-$(Platform)</PortableRid>
<PortableRid Condition="'$(PortableRid)' == '' AND '$(TargetOS)' == 'FreeBSD'">freebsd-$(Platform)</PortableRid>
<PortableRid Condition="'$(PortableRid)' == '' AND '$(TargetOS)' == 'OSX'">osx-$(Platform)</PortableRid>
<PortableRid Condition="'$(PortableRid)' == '' AND '$(TargetOS)' == 'Linux'">linux-$(Platform)</PortableRid>
<PortableRid Condition="'$(PortableRid)' == '' AND '$(TargetOS)' == 'Windows_NT'">win-$(Platform)</PortableRid>
<TargetRid Condition="'$(PortableBuild)' == 'true' AND '$(PortableRid)' != ''">$(PortableRid)</TargetRid>
</PropertyGroup>

View file

@ -247,6 +247,10 @@ echo "Found bootstrap SDK $SDK_VERSION, bootstrap Arcade $ARCADE_BOOTSTRAP_VERSI
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export NUGET_PACKAGES=$packagesRestoredDir/
source $SCRIPT_ROOT/eng/common/native/init-os-and-arch.sh
source $SCRIPT_ROOT/eng/common/native/init-distro-rid.sh
initDistroRidGlobal "$os" "$arch" ""
LogDateStamp=$(date +"%m%d%H%M%S")
"$CLI_ROOT/dotnet" build-server shutdown

View file

@ -1,6 +1,8 @@
<Project>
<Target Name="GetCurrentRuntimeInformation">
<PropertyGroup>
<!-- Use current machine distro RID if set. Otherwise, fall back to RuntimeInformation.RuntimeIdentifier -->
<HostRid Condition="'$(HostRid)' == '' and '$(MSBuildRuntimeType)' == 'core'">$(__DistroRid)</HostRid>
<HostRid Condition="'$(HostRid)' == '' and '$(MSBuildRuntimeType)' == 'core'">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</HostRid>
<HostRid Condition="'$(HostRid)' == '' and '$(MSBuildRuntimeType)' != 'core'">win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant)</HostRid>