工程檔案
\Engine\Source\Programs\AutomationTool\AutomationTool_Mono.sln
public static void Build(BuildCommand Command, ProjectParams Params, int WorkingCL = -1, ProjectBuildTargets TargetMask = ProjectBuildTargets.All)
{
Params.ValidateAndLog();
if (!Params.Build)
{
return;
}
Log("********** BUILD COMMAND STARTED **********");
var UE4Build = new UE4Build(Command);
var Agenda = new UE4Build.BuildAgenda();
var CrashReportPlatforms = new HashSet<UnrealTargetPlatform>();
// Setup editor targets
if (Params.HasEditorTargets && !Params.Rocket && (TargetMask & ProjectBuildTargets.Editor) == ProjectBuildTargets.Editor)
{
編譯工程運作的是這個腳本,看到了開始時候的那個BUILD COMMAND STARTED。
編譯時候可以打開那個工程檔案,附加到程序,就可以斷點看傳入的參數了。
CMD 到
UnrealEngine\Engine\Binaries\DotNET>
目錄下,運作
AutomationTool.exe -help
linux mac應該是運作 mono AutomationTools.exe -help
會看到幫助資訊,
AutomationTool.exe -list
可以列出所有可以用的功能。
AnalyzeThirdPartyLibs
BlameKeyword
BuildCommonTools
ZipProjectUp
BuildCookRun
BuildPlugin
BuildThirdPartyLibs
CodeSurgery
UpdateCopyright
FixupRedirects
GenerateDSYM
RebuildLightMaps
IPhonePackager
LauncherLocalization
ListMobileDevices
Localise
MegaXGE
TestP4_Info
GitPullRequest
TestFail
TestSuccess
TestMessage
TestRecursion
TestRecursionAuto
TestMacZip
TestP4_CreateChangelist
TestP4_StrandCheckout
TestP4_LabelDescription
TestP4_ClientOps
CleanDDC
TestTestFarm
TestArguments
TestCombinePaths
TestFileUtility
TestLog
TestChangeFileType
TestGamePerf
TestUATBuildProducts
TestWatchdogTimer
TestOSSCommands
UBT
ZeroEngineVersions
SyncSource
GenerateAutomationProject
DumpBranch
DebugSleep
TestMcpConfigs
TestBlame
TestChanges
TestKillAll
TestCleanFormalBuilds
TestStopProcess
LookForOverlappingBuildProducts
TestThreadedCopyFiles
UE4BuildUtilDummyBuildCommand
UnrealSyncList
UnrealSync
UpdateLocalVersion
TestECJobErrorParse
GUBP
TestTempStorage
運作
AutomationTool.exe -help BuildCookRun
可以看到特定指令的幫助資訊。可以自己寫腳本去buid 或者cook,不用開編輯器了。
檔案位置:
\Engine\Source\Editor\MainFrame\Private\Frame\MainFrameActions.cpp
void FMainFrameActionCallbacks::CreateUatTask( const FString& CommandLine, const FText& PlatformDisplayName, const FText& TaskName, const FText &TaskShortName, const FSlateBrush* TaskIcon )
{
// make sure that the UAT batch file is in place
#if PLATFORM_WINDOWS
FString RunUATScriptName = TEXT("RunUAT.bat");
FString CmdExe = TEXT("cmd.exe");
#elif PLATFORM_LINUX
FString RunUATScriptName = TEXT("RunUAT.sh");
FString CmdExe = TEXT("/bin/bash");
#else
FString RunUATScriptName = TEXT("RunUAT.command");
FString CmdExe = TEXT("/bin/sh");
#endif
FString UatPath = FPaths::ConvertRelativePathToFull(FPaths::EngineDir() / TEXT("Build/BatchFiles") / RunUATScriptName);
FGameProjectGenerationModule& GameProjectModule = FModuleManager::LoadModuleChecked<FGameProjectGenerationModule>(TEXT("GameProjectGeneration"));
這個代碼就是調用runuat的腳本,然後那個腳本再調用automationtool執行編譯操作,可以在這裡打斷點看看到底打包特定平台時候調用了什麼。