diff --git a/utils/build.ps1 b/utils/build.ps1 index fbc3abad9b4b4..07129f64dd741 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -794,7 +794,9 @@ function Copy-File($Src, $Dst) { Write-Output "copy /Y `"$Src`" `"$Dst`"" } else { New-Item -ItemType Directory -ErrorAction Ignore $DstDir | Out-Null - Copy-Item -Force $Src $Dst + Copy-Item -Force ` + -Path $Src ` + -Destination $Dst } } @@ -804,7 +806,9 @@ function Copy-Directory($Src, $Dst) { Write-Output "copy /Y `"$Src`" `"$Dst`"" } else { New-Item -ItemType Directory -ErrorAction Ignore $Dst | Out-Null - Copy-Item -Force -Recurse $Src $Dst + Copy-Item -Force -Recurse ` + -Path $Src ` + -Destination $Dst } } @@ -2032,14 +2036,20 @@ function Test-Compilers([Hashtable] $Platform, [string] $Variant, [switch] $Test # Transitive dependency of _lldb.pyd $RuntimeBinaryCache = Get-ProjectBinaryCache $BuildPlatform Runtime - Copy-Item $RuntimeBinaryCache\bin\swiftCore.dll "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\lib\site-packages\lldb" + Copy-Item ` + -Path $RuntimeBinaryCache\bin\swiftCore.dll ` + -Destination "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\lib\site-packages\lldb" # Runtime dependencies of repl_swift.exe $SwiftRTSubdir = "lib\swift\windows" Write-Host "Copying '$RuntimeBinaryCache\$SwiftRTSubdir\$($Platform.Architecture.LLVMName)\swiftrt.obj' to '$(Get-ProjectBinaryCache $BuildPlatform Compilers)\$SwiftRTSubdir'" - Copy-Item "$RuntimeBinaryCache\$SwiftRTSubdir\$($Platform.Architecture.LLVMName)\swiftrt.obj" "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\$SwiftRTSubdir" + Copy-Item ` + -Path "$RuntimeBinaryCache\$SwiftRTSubdir\$($Platform.Architecture.LLVMName)\swiftrt.obj" ` + -Destination "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\$SwiftRTSubdir" Write-Host "Copying '$RuntimeBinaryCache\bin\swiftCore.dll' to '$(Get-ProjectBinaryCache $BuildPlatform Compilers)\bin'" - Copy-Item "$RuntimeBinaryCache\bin\swiftCore.dll" "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\bin" + Copy-Item ` + -Path "$RuntimeBinaryCache\bin\swiftCore.dll" ` + -Destination "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\bin" $TestingDefines += @{ LLDB_INCLUDE_TESTS = "YES"; @@ -2115,7 +2125,9 @@ function Build-mimalloc() { $BuildSuffix = if ($BuildPlatform -eq $KnownPlatforms["WindowsX64"]) { "" } else { "-arm64" } foreach ($item in "mimalloc.dll", "mimalloc-redirect$HostSuffix.dll") { - Copy-Item -Path "$BinaryCache\$($Platform.Triple)\mimalloc\bin\$item" -Destination "$($Platform.ToolchainInstallRoot)\usr\bin\" + Copy-Item ` + -Path "$BinaryCache\$($Platform.Triple)\mimalloc\bin\$item" ` + -Destination "$($Platform.ToolchainInstallRoot)\usr\bin\" } # TODO: should we split this out into its own function? @@ -3449,16 +3461,20 @@ function Install-HostToolchain() { # Restructure _InternalSwiftScan (keep the original one for the installer) Copy-Item -Force ` - "$($HostPlatform.ToolchainInstallRoot)\usr\lib\swift\_InternalSwiftScan" ` - "$($HostPlatform.ToolchainInstallRoot)\usr\include" + -Path "$($HostPlatform.ToolchainInstallRoot)\usr\lib\swift\_InternalSwiftScan" ` + -Destination "$($HostPlatform.ToolchainInstallRoot)\usr\include" Copy-Item -Force ` - "$($HostPlatform.ToolchainInstallRoot)\usr\lib\swift\windows\_InternalSwiftScan.lib" ` - "$($HostPlatform.ToolchainInstallRoot)\usr\lib" + -Path "$($HostPlatform.ToolchainInstallRoot)\usr\lib\swift\windows\_InternalSwiftScan.lib" ` + -Destination "$($HostPlatform.ToolchainInstallRoot)\usr\lib" # Switch to swift-driver $SwiftDriver = ([IO.Path]::Combine((Get-ProjectBinaryCache $HostPlatform Driver), "bin", "swift-driver.exe")) - Copy-Item -Force $SwiftDriver "$($HostPlatform.ToolchainInstallRoot)\usr\bin\swift.exe" - Copy-Item -Force $SwiftDriver "$($HostPlatform.ToolchainInstallRoot)\usr\bin\swiftc.exe" + Copy-Item -Force ` + -Path $SwiftDriver ` + -Destination "$($HostPlatform.ToolchainInstallRoot)\usr\bin\swift.exe" + Copy-Item -Force ` + -Path $SwiftDriver ` + -Destination "$($HostPlatform.ToolchainInstallRoot)\usr\bin\swiftc.exe" } function Build-Inspect([Hashtable] $Platform) {