There was some additional info on ubtignore that I haven't written about yet as well.
2.6 KiB
Unreal Build Tool
Located in Engine\Source\Programs\UnrealBuildTool\
C# solution.
Main Loop
Located in UnrealBuildTool.cs
- Start peformance info capture
- Parse command line arguments
- Parse global options
- Logging & UBT assembly setup
- Set working directory to Engine/Source
- Setup build mode
- Setup tool mode options
- Get engine directory contents
- Read XML Configurataion
- Create UBT run file
- "Lock Branch"
- Register build platforms
- Create ToolMode which will handle the rest
- Close out
Global Options
Also located in same file.
Offical inline documentation:
Global options for UBT (any modes)
Commandline options are deffined using Epic's CommandLineAttribute
.
ToolMode
Offical inline documentation:
Base class for standalone UBT modes. Different modes can be invoked using the -Mode=[Name] argument on the command line, where [Name] is determined by the ToolModeAttribute on a ToolMode derived class. The log system will be initialized before calling the mode, but little else.
-Mode is defined in GlobalOptions definition.
Has a single function:
public abstract int Execute(CommandLineArguments Arguments, ILogger Logger);
BuildMode
Derived from ToolMode, used to build a target.
Execute
procedure Flow:
- Output arguments & setup the logger
- Read the xml configuration files
- Apply architecture configs (platform specific configs for a target)
- More logging setup
- Create build configuraiton object
- Parse and build targets
- Pase all target descriptors
- Clean all targets with
CleanMode
(a tool mode) that havebRebuild
flagged. - Handle remote builds (Seems to be excluisvely Mac)
- Handle local builds
- Get all project directories & build options
- For each project: create a
SourceFileWorkingSet
object andBuild
.
- Process the dumps to see if anything failed.
- Save Caches
BuildConfiguration
Contains target agonstic settings.
QueueProjectDirectory
Used when retreving all project directories.
Will Enqueue a FileMetadataPrefetch.ScanProjectDirectory
call for the directory with the prefecter.
ScanProjectDirectory
- Get all extension directoires for the target project directory
- For each directory
- Enqueue a scan of the plugin directory (
ScanPluginFolder
, thePlugins
folder) - Enqueue a scan of the project directory (
ScanDirectoryTree
, theSource
folder)
- Enqueue a scan of the plugin directory (
Unreal.GetExtensionDirs
will do an initial scan for Platform, Restricted, and BaseDirectories, and remove them from CachedDirectories based if any of options for doing so are set.