echo off
set projectPath="Z:\Abv_land\AboveLand.uproject"
set enginepath=Z:\Abv_Land_Engine
set /P check="Do you want to build binaries from Engine : %enginepath% [Y/N]"
if /I "%check%" EQU "Y" goto :continue
if /I "%check%" EQU "N" goto :End
:continue
del *.sln
rmdir /s /q .vs
rmdir /s /q Binaries
set /P choice="Do you want CleanBuild :[Y/N]"
if /I "%choice%" EQU "Y" goto :cleanbuild
if /I "%choice%" EQU "N" goto :regularbuild
:cleanbuild
rmdir /s /q Intermediate
rmdir /s /q DerivedDataCache
goto :regularbuild
:regularbuild
set UVS="%enginepath%\Engine\Binaries\Win64\UnrealVersionSelector-Win64-Shipping.exe"
set UBT="%enginepath%\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.exe"
attrib -r %projectPath%
echo Swicthing project to %enginepath%
%UVS% /switchversionsilent %projectPath% %enginepath%
echo Generating project files
%UVS% /projectfiles %projectPath%
echo Compiling project
%UBT% Development Win64 -Project=%projectPath% -TargetType=Editor -Progress -NoHotReloadFromIDE
attrib +r %projectPath%
goto :End
:End
pause