From e407545d19d6e21502c624abb434aa8f00cec36e Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Mon, 11 May 2020 16:55:01 +0100 Subject: [PATCH] Clean up Hot Reload DLLs --- ue4-build.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ue4-build.ps1 b/ue4-build.ps1 index 0965b7a..f87367d 100644 --- a/ue4-build.ps1 +++ b/ue4-build.ps1 @@ -120,6 +120,23 @@ try { Write-Verbose "UE4 project is not open in editor" } Remove-Variable ue4proc + + # Because we know editor is closed, Hot Reload DLLs are OK to clean up + # Build will only occur to the main DLL + # Pattern is .\Binaries\Win64\UE4Editor--9999.dll|pdb + Write-Output "Cleaning up old Hot Reload DLLs/PDBs" + $cleanupdir = ".\Binaries\Win64" + $cleanupfiles = @(Get-ChildItem "$cleanupdir\UE4Editor-$uprojname-????.dll" | Select-Object -Expand Name) + $cleanupfiles += @(Get-ChildItem "$cleanupdir\UE4Editor-$uprojname-????.pdb" | Select-Object -Expand Name) + foreach ($cf in $cleanupfiles) { + if ($dryrun) { + Write-Output "Would have deleted $cleanupdir\$cf" + } else { + Write-Verbose "Deleting $cleanupdir\$cf" + Remove-Item "$cleanupdir\$cf" -Force + } + } + } $buildargs = ""