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:
```csharp
public abstract int Execute(CommandLineArguments Arguments, ILogger Logger);
```
## BuildMode
Derived from ToolMode, used to build a *target*.
`Execute` procedure Flow:
1. Output arguments & setup the logger
2. Read the xml configuration files
3. Apply architecture configs (platform specific configs for a target)
4. More logging setup
5. Create build configuraiton object
6. Parse and build targets
- Pase all target descriptors
- Clean all targets with `CleanMode` (a tool mode) that have `bRebuild` 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 and `Build`.
Will Enqueue a `FileMetadataPrefetch.ScanProjectDirectory` call for the directory with the prefecter.
### ScanProjectDirectory
1. Get all extension directoires for the target project directory
2. For each directory
- Enqueue a scan of the plugin directory (`ScanPluginFolder`, the `Plugins` folder)
- Enqueue a scan of the project directory (`ScanDirectoryTree`, the `Source` folder)
`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.