Update scripts to set distro RID and properties to use it as TargetRid if set

This commit is contained in:
Elinor Fung 2023-08-10 10:13:53 -07:00
parent 2029cca492
commit 262a84c9be
4 changed files with 12 additions and 0 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

@ -159,6 +159,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>

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>