Last active
May 18, 2020 14:30
-
-
Save AaronTrotter/dc8cce655c6a61d77826290c40b7e313 to your computer and use it in GitHub Desktop.
Clear UE4 Binaries, Intermediate and Regenerate VS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
set dt=%DATE:~6,4%.%DATE:~3,2%.%DATE:~0,2%-%TIME:~0,2%.%TIME:~3,2%.%TIME:~6,2% | |
set dtstamp=%dt: =0% | |
set projectPath="" | |
set projectName="" | |
setlocal enableDelayedExpansion | |
set /a ID=0 | |
echo "removing cache" | |
echo "--searching root" | |
if EXIST Binaries ( | |
echo "----cleared Binaries" | |
RD /S /Q Binaries | |
) | |
if EXIST Intermediate ( | |
echo "----cleared Intermediate" | |
RD /S /Q Intermediate | |
) | |
for /D %%i in (Plugins\*) do ( | |
echo "--searching %%i" | |
if EXIST "%%i\Binaries" ( | |
echo "----cleared Binaries" | |
RD /S /Q "%%i\Binaries" | |
) | |
if EXIST "%%i\Intermediate" ( | |
echo "----cleared Intermediate" | |
RD /S /Q "%%i\Intermediate" | |
) | |
) | |
echo "Locating Engine" | |
if not EXIST "UE4ClearCacheEnginePath.txt" ( | |
set /p cacheEnginePath="Engine Path: " | |
) | |
if defined cacheEnginePath ( | |
echo "Creating Cache Engine Path" | |
echo %cacheEnginePath%> UE4ClearCacheEnginePath.txt | |
) | |
for /f "delims=" %%i in ('type UE4ClearCacheEnginePath.txt') do set enginePath=!enginePath!%%i | |
if not EXIST "%enginePath%" ( | |
echo "%enginePath% is not a valid path" | |
pause | |
exit | |
) else ( | |
echo "Engine Found: %enginePath%" | |
) | |
set buildToolPath=%enginePath%/Engine/Binaries/DotNET/UnrealBuildTool.exe | |
echo "searching root for UProject" | |
for /f "delims=" %%G in ('dir *.uproject /b') do ( | |
set filename[!ID!]=%%~G | |
set /a ID+=1 | |
set projectName = %%~G | |
set projectPath=%CD%\%%~G | |
) | |
@echo "--%ID% UProject(s) Found" | |
set logPath=%CD%\Saved\Logs\UnrealVersionSelector-%dtstamp%.log | |
if %ID% GTR 0 ( | |
echo "--rebuilding projectName" | |
echo "buildToolPath: %buildToolPath%" | |
echo "logPath: %logPath%" | |
start "" "%buildToolPath%" -projectfiles -project="%projectPath%" -game -rocket -progress -log="%logPath%" | |
) | |
endlocal | |
TIMEOUT /T 10 | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Place this in root directory.
It will ask you for the engine path once. This is required to regenerate Visual Studio project. It will create a file called UE4ClearCacheEnginePath in the root directory. Exclude it from git.