@@ -669,11 +669,11 @@ function Fetch-Dependencies {
669669 Write-Output " Extracting '$ToolchainName ' ..."
670670
671671 # The new runtime MSI is built to expand files into the immediate directory. So, setup the installation location.
672- New-Item - ItemType Directory - ErrorAction Ignore $BinaryCache \toolchains\$PinnedToolchain \LocalApp\Programs\Swift\Runtimes\0.0 . 0 \usr\bin | Out-Null
672+ New-Item - ItemType Directory - ErrorAction Ignore $BinaryCache \toolchains\$PinnedToolchain \LocalApp\Programs\Swift\Runtimes\$ ( Get-PinnedToolchainVersion ) \usr\bin | Out-Null
673673 Invoke-Program $BinaryCache \WiX- $WiXVersion \tools\net6.0 \any\wix.exe -- burn extract $BinaryCache \$ToolchainName.exe - out $BinaryCache \toolchains\ - outba $BinaryCache \toolchains\
674674 Get-ChildItem " $BinaryCache \toolchains\WixAttachedContainer" - Filter " *.msi" | % {
675675 $LogFile = [System.IO.Path ]::ChangeExtension($_.Name , " log" )
676- $TARGETDIR = if ($_.Name -eq " rtl.msi" ) { " $BinaryCache \toolchains\$ToolchainName \LocalApp\Programs\Swift\Runtimes\5.10.1 \usr\bin" } else { " $BinaryCache \toolchains\$ToolchainName " }
676+ $TARGETDIR = if ($_.Name -eq " rtl.msi" ) { " $BinaryCache \toolchains\$ToolchainName \LocalApp\Programs\Swift\Runtimes\$ ( Get-PinnedToolchainVersion ) \usr\bin" } else { " $BinaryCache \toolchains\$ToolchainName " }
677677 Invoke-Program - OutNull msiexec.exe / lvx! $BinaryCache \toolchains\$LogFile / qn / a $BinaryCache \toolchains\WixAttachedContainer\$_ ALLUSERS= 0 TARGETDIR= $TARGETDIR
678678 }
679679 }
@@ -750,22 +750,22 @@ function Fetch-Dependencies {
750750}
751751
752752function Get-PinnedToolchainTool () {
753- if (Test-Path " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Toolchains\5.10.1 +Asserts\usr\bin" ) {
754- return " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Toolchains\5.10.1 +Asserts\usr\bin"
753+ if (Test-Path " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Toolchains\$ ( Get-PinnedToolchainVersion ) +Asserts\usr\bin" ) {
754+ return " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Toolchains\$ ( Get-PinnedToolchainVersion ) +Asserts\usr\bin"
755755 }
756756 return " $BinaryCache \toolchains\${PinnedToolchain} \Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin"
757757}
758758
759759function Get-PinnedToolchainSDK () {
760- if (Test-Path " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Platforms\5.10.1 \Windows.platform\Developer\SDKs\Windows.sdk" ) {
761- return " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Platforms\5.10.1 \Windows.platform\Developer\SDKs\Windows.sdk"
760+ if (Test-Path " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Platforms\$ ( Get-PinnedToolchainVersion ) \Windows.platform\Developer\SDKs\Windows.sdk" ) {
761+ return " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Platforms\$ ( Get-PinnedToolchainVersion ) \Windows.platform\Developer\SDKs\Windows.sdk"
762762 }
763763 return " $BinaryCache \toolchains\${PinnedToolchain} \Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk"
764764}
765765
766766function Get-PinnedToolchainRuntime () {
767- if (Test-Path " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Runtimes\5.10.1 \usr\bin\swiftCore.dll" ) {
768- return " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Runtimes\5.10.1 \usr\bin"
767+ if (Test-Path " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Runtimes\$ ( Get-PinnedToolchainVersion ) \usr\bin\swiftCore.dll" ) {
768+ return " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Runtimes\$ ( Get-PinnedToolchainVersion ) \usr\bin"
769769 }
770770 return " $BinaryCache \toolchains\${PinnedToolchain} \PFiles64\Swift\runtime-development\usr\bin"
771771}
@@ -774,7 +774,7 @@ function Get-PinnedToolchainVersion() {
774774 if (Test-Path variable:PinnedVersion) {
775775 return $PinnedVersion
776776 }
777- return " 5.10.1 "
777+ throw " PinnedVersion must be set "
778778}
779779
780780function TryAdd-KeyValue ([hashtable ]$Hashtable , [string ]$Key , [string ]$Value ) {
0 commit comments