* Allows us to use built-in Trace providers (console, file, etc) directly and still use our custom formatting.
* Fat comments explaining why Trace.WriteXXX functions should not be used directly in our system.
* Fixes thread safety by using Trace.WriteXXX under the hood after formatting, which uses a global lock (except on Mono, where a bug appears to be preventing this. Simulating the call on that platform).
* No need for TraceEvent overloads, which saves us the extra parameter cruft.
* Removed non-varargs overloads of Log functions (technically a bit slower, but these are already small messages).
* No longer needed VerbosityFilter and ConsoleListener classes.
* Avoid calling GetSource() if we aren't outputting the source.
* Avoid formatting the string if it won't pass the verbosity level.
* Consolidated all of UAT and UBT options into this class, so they could fully share the implementation.
UBT BuildConfiguration.cs
* Added LogFilename (and --log=<file> arg) that enables logging to a file.
* Added static ctor guard that asserts if someone tries to read a config before we have loaded config files and parsed config-override commandlines. It's a poor man's hack, but better than nothing!
UBT UEBuildConfiguration.cs
* Same static ctor guard as above.
UBT UnrealBuildTools.cs (initialization refactoring)
* In general I tried to de-mystify some of the rationale behind our startup code via fat comments.
* Broke main into 3 stages:
1. "early code" that should not try to read a config value.
* Very little code here. Mostly setting the current directory.
* Does an early init of logging to ensure logging is around, but config values won't be ready.
2. "Init Configuration code" that loads config files and parses command lines that may override them.
* I isolated two locations in startup that parsed long sets of switches and moved ones that trivially affected BuildConfiguration and UEBuildConfiguration in here. Those two locations seemed to have mostly copies of the same switches, indicating serious param parsing issues at some point in time.
* This allows switches to override config files more easily than the patchwork of re-parsing that was currently used (particularly for -verbose).
* I did a cursory examination of later code that indicated this double (actually, triple) parsing was no longer necessary with the refactors above. Any insight into why things may have ended up this way would be helpful.
3. "Post Init code" that is actually the meat of UBT.
* I left this code largely untouched.
* Removed 2 of 3 different command line logging statements.
* Removed two redundant parses of config overrides (ParseBuildConfigurationFlags).
* Guarded all of main in a try/catch block to ensure no exceptions can leak from UBT without returning a valid error code. It ALMOST already did this, but only covered the part surrounded by the Mutex.
* There was a perplexing bit that redundantly called XmlConfigLoader.Reset<> (line 683) that I struggled to understand. It turns out UEBuildConfiguration was sensitive to the current directory being set before files were loaded, and the old code called XmlConfigLoader.Init() super early, which required it to be called again after the current directory was set (see UEBuldConfiguration.UEThirdPartySourceDirectory for the cause). After my changes, I verified as best I could that these calls are no longer needed and removed them.
XmlConfigLoader.cs
* Add support for Properties in XmlConfigLoader.
AutomationTool Program.cs
* Guard logging shutdown code in try/finally so it can't be missed.
AutomationTool Log.cs
* Uses new logging system from UBT
* Removed unnecessary classes (VerbosityFilter, AutomationConsoleTraceListener, and AutomationFileTraceListener)
* Console trace logic is handled by UBT code now, moved UTF8Output handling to InitLogging.
* A custom TraceListener for file logging was unnecessary.
* Logic to handle creating the log file and retry loops was move into InitLogging, and the result passed to a regular TextFileTraceListener.
* Logic to handle copying the log on shutdown was moved to a ShutdownLogging function.
#codereview:robert.manuszewski,michael.trepka,kellan.carr
[CL 2526245 by Wes Hunt in Main branch]
Added an error code for missing ue4game binaries when packaging a non code project.
Added a check in main frame actions to determine whether we display a dialog with the error message in it.
Fix for incorrect IOS stub path being logged
Fix for incorrect Android apk path being generated for non ue4game renames in ::GetFinalApkName
[CL 2427458 by Terence Burns in Main branch]
- Integrated IPhonePackager code directly into IOS Automation (this is not 100% working yet, it's a work-in-progress). Original IPP still in same place untouched
- Added a return code to RunLocalProcess
- Added IPhonePackager UAT script that will pass along params to the internal IPP code (RunUAT IPhonePackager -cmd="<ipp commandline here>" [-nocompile])
#codereview Robert.Manuszewski,peter.sauerbrei
[CL 2123325 by Josh Adams in Main branch]