Files
UnrealEngineUWP/Engine/Build/BatchFiles/Clean.bat
Joakim Lindqvist e7039d3d35 UBT and UAT now use .NET Core instead of Framework and Mono. This means that we use the same runtime on Windows, Linux and Mac. Further benefits including newer C# features and a lot of intresting features for the future around AOT and Tiered compilation.
Some behavior changes:
Output paths - Both tools are now output to a subdirectory of Binaries/Dotnet, I believe most hardcoded paths have been fixed up but there may be tools that will fail because of this.
UAT Plugin Building - As .NET Core does not support AppDomain unloading, how we build the plugins has changed quite a bit, these are now built before UAT is started rather then by UAT itself. If you just start UAT via RunUAT.bat/sh this should just continue to work.

#rb ben.marsh

[CL 14834347 by Joakim Lindqvist in ue5-main branch]
2020-12-02 06:57:13 -04:00

76 lines
2.2 KiB
Batchfile
Executable File

@echo off
rem ## Unreal Engine 4 cleanup script
rem ## Copyright Epic Games, Inc. All Rights Reserved.
rem ##
rem ## This script is expecting to exist in the UE4 root directory. It will not work correctly
rem ## if you copy it to a different location and run it.
rem ##
rem ## %1 is the game name
rem ## %2 is the platform name
rem ## %3 is the configuration name
setlocal
rem ## First, make sure the batch file exists in the folder we expect it to. This is necessary in order to
rem ## verify that our relative path to the /Engine/Source directory is correct
if not exist "%~dp0..\..\Source" goto Error_BatchFileInWrongLocation
rem ## Change the CWD to /Engine/Source. We always need to run UnrealBuildTool from /Engine/Source!
pushd "%~dp0..\..\Source"
if not exist ..\Build\BatchFiles\Clean.bat goto Error_BatchFileInWrongLocation
rem ## If this is an installed build, we don't need to rebuild UBT. Go straight to cleaning.
if exist ..\Build\InstalledBuild.txt goto ReadyToClean
rem ## Get the path to MSBuild
call "%~dp0GetMSBuildPath.bat"
if errorlevel 1 goto Error_NoVisualStudioEnvironment
rem ## Compile UBT if the project file exists
set ProjectFile="Programs\UnrealBuildTool\UnrealBuildTool.csproj"
set UBTPath="..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.exe"
if not exist %ProjectFile% goto NoProjectFile
dotnet build Programs\UnrealBuildTool\UnrealBuildTool.csproj -c Development -v quiet
if errorlevel 1 goto Error_UBTCompileFailed
:NoProjectFile
rem ## Execute UBT
:ReadyToClean
if not exist %UBTPath% goto Error_UBTMissing
%UBTPath% %* -clean
goto Exit
:Error_BatchFileInWrongLocation
echo Clean ERROR: The batch file does not appear to be located in the UE4/Engine/Build/BatchFiles directory. This script must be run from within that directory.
pause
goto Exit
:Error_NoVisualStudioEnvironment
echo GenerateProjectFiles ERROR: A valid version of Visual Studio does not appear to be installed.
pause
goto Exit
:Error_UBTCompileFailed
echo Clean ERROR: Failed to build UnrealBuildTool.
pause
goto Exit
:Error_UBTMissing
echo Clean ERROR: UnrealBuildTool.exe not found in ..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.exe
pause
goto Exit
:Error_CleanFailed
echo Clean ERROR: Clean failed.
pause
goto Exit
:Exit