@@ -669,11 +669,11 @@ function Fetch-Dependencies {
669
669
Write-Output " Extracting '$ToolchainName ' ..."
670
670
671
671
# 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
673
673
Invoke-Program $BinaryCache \WiX- $WiXVersion \tools\net6.0 \any\wix.exe -- burn extract $BinaryCache \$ToolchainName.exe - out $BinaryCache \toolchains\ - outba $BinaryCache \toolchains\
674
674
Get-ChildItem " $BinaryCache \toolchains\WixAttachedContainer" - Filter " *.msi" | % {
675
675
$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 " }
677
677
Invoke-Program - OutNull msiexec.exe / lvx! $BinaryCache \toolchains\$LogFile / qn / a $BinaryCache \toolchains\WixAttachedContainer\$_ ALLUSERS= 0 TARGETDIR= $TARGETDIR
678
678
}
679
679
}
@@ -750,22 +750,22 @@ function Fetch-Dependencies {
750
750
}
751
751
752
752
function 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"
755
755
}
756
756
return " $BinaryCache \toolchains\${PinnedToolchain} \Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin"
757
757
}
758
758
759
759
function 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"
762
762
}
763
763
return " $BinaryCache \toolchains\${PinnedToolchain} \Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk"
764
764
}
765
765
766
766
function 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"
769
769
}
770
770
return " $BinaryCache \toolchains\${PinnedToolchain} \PFiles64\Swift\runtime-development\usr\bin"
771
771
}
@@ -774,7 +774,7 @@ function Get-PinnedToolchainVersion() {
774
774
if (Test-Path variable:PinnedVersion) {
775
775
return $PinnedVersion
776
776
}
777
- return " 5.10.1 "
777
+ throw " PinnedVersion must be set "
778
778
}
779
779
780
780
function TryAdd-KeyValue ([hashtable ]$Hashtable , [string ]$Key , [string ]$Value ) {
0 commit comments