本文整理汇总了C#中AutomationTool.ProjectParams.ValidateAndLog方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectParams.ValidateAndLog方法的具体用法?C# ProjectParams.ValidateAndLog怎么用?C# ProjectParams.ValidateAndLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AutomationTool.ProjectParams
的用法示例。
在下文中一共展示了ProjectParams.ValidateAndLog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyBuildToStagingDirectory
public static void CopyBuildToStagingDirectory(ProjectParams Params)
{
if (ShouldCreatePak(Params) || (Params.Stage && !Params.SkipStage))
{
Params.ValidateAndLog();
Log("********** STAGE COMMAND STARTED **********");
if (!Params.NoClient)
{
var DeployContextList = CreateDeploymentContext(Params, false, true);
foreach (var SC in DeployContextList)
{
// write out the commandline file now so it can go into the manifest
WriteStageCommandline(Params, SC);
CreateStagingManifest(Params, SC);
ApplyStagingManifest(Params, SC);
}
}
if (Params.DedicatedServer)
{
var DeployContextList = CreateDeploymentContext(Params, true, true);
foreach (var SC in DeployContextList)
{
CreateStagingManifest(Params, SC);
ApplyStagingManifest(Params, SC);
}
}
Log("********** STAGE COMMAND COMPLETED **********");
}
}
示例2: Package
public static void Package(ProjectParams Params, int WorkingCL=-1)
{
Params.ValidateAndLog();
List<DeploymentContext> DeployContextList = new List<DeploymentContext>();
if (!Params.NoClient)
{
DeployContextList.AddRange(CreateDeploymentContext(Params, false, false));
}
if (Params.DedicatedServer)
{
DeployContextList.AddRange(CreateDeploymentContext(Params, true, false));
}
if (DeployContextList.Count > 0 && !Params.SkipStage)
{
Log("********** PACKAGE COMMAND STARTED **********");
foreach (var SC in DeployContextList)
{
if (Params.Package || (SC.StageTargetPlatform.RequiresPackageToDeploy && Params.Deploy))
{
SC.StageTargetPlatform.Package(Params, SC, WorkingCL);
}
}
Log("********** PACKAGE COMMAND COMPLETED **********");
}
}
示例3: Run
public static void Run(ProjectParams Params)
{
Params.ValidateAndLog();
if (!Params.Run)
{
return;
}
Log("********** RUN COMMAND STARTED **********");
var LogFolderOutsideOfSandbox = GetLogFolderOutsideOfSandbox();
if (!GlobalCommandLine.Installed && ServerProcess == null)
{
// In the installed runs, this is the same folder as CmdEnv.LogFolder so delete only in not-installed
DeleteDirectory(LogFolderOutsideOfSandbox);
CreateDirectory(LogFolderOutsideOfSandbox);
}
var ServerLogFile = CombinePaths(LogFolderOutsideOfSandbox, "Server.log");
var ClientLogFile = CombinePaths(LogFolderOutsideOfSandbox, Params.EditorTest ? "Editor.log" : "Client.log");
try
{
RunInternal(Params, ServerLogFile, ClientLogFile);
}
catch
{
throw;
}
finally
{
CopyLogsBackToLogFolder();
}
Log("********** RUN COMMAND COMPLETED **********");
}
示例4: Archive
public static void Archive(ProjectParams Params)
{
Params.ValidateAndLog();
if (!Params.Archive)
{
return;
}
Log("********** ARCHIVE COMMAND STARTED **********");
if (!Params.NoClient)
{
var DeployContextList = CreateDeploymentContext(Params, false, false);
foreach ( var SC in DeployContextList )
{
CreateArchiveManifest(Params, SC);
ApplyArchiveManifest(Params, SC);
SC.StageTargetPlatform.ProcessArchivedProject(Params, SC);
}
}
if (Params.DedicatedServer)
{
ProjectParams ServerParams = new ProjectParams(Params);
ServerParams.Device = ServerParams.ServerDevice;
var DeployContextList = CreateDeploymentContext(ServerParams, true, false);
foreach ( var SC in DeployContextList )
{
CreateArchiveManifest(Params, SC);
ApplyArchiveManifest(Params, SC);
SC.StageTargetPlatform.ProcessArchivedProject(Params, SC);
}
}
Log("********** ARCHIVE COMMAND COMPLETED **********");
}
示例5: Archive
public static void Archive(ProjectParams Params)
{
Params.ValidateAndLog();
if (!Params.Archive)
{
return;
}
if (!Params.NoClient)
{
var DeployContextList = CreateDeploymentContext(Params, false, false);
foreach ( var SC in DeployContextList )
{
CreateArchiveManifest(Params, SC);
ApplyArchiveManifest(Params, SC);
}
}
if (Params.DedicatedServer)
{
ProjectParams ServerParams = new ProjectParams(Params);
ServerParams.Device = ServerParams.ServerDevice;
var DeployContextList = CreateDeploymentContext(ServerParams, true, false);
foreach ( var SC in DeployContextList )
{
CreateArchiveManifest(Params, SC);
ApplyArchiveManifest(Params, SC);
}
}
}
示例6: Deploy
public static void Deploy(ProjectParams Params)
{
Params.ValidateAndLog();
if (!Params.Deploy)
{
return;
}
Log("********** DEPLOY COMMAND STARTED **********");
if (!Params.NoClient)
{
var DeployContextList = CreateDeploymentContext(Params, false, false);
foreach ( var SC in DeployContextList )
{
if (SC.StageTargetPlatform.DeployViaUFE)
{
string ClientCmdLine = "-run=Deploy ";
ClientCmdLine += "-Device=" + string.Join("+", Params.Devices) + " ";
ClientCmdLine += "-Targetplatform=" + SC.StageTargetPlatform.PlatformType.ToString() + " ";
ClientCmdLine += "-SourceDir=\"" + CombinePaths(Params.BaseStageDirectory, SC.StageTargetPlatform.PlatformType.ToString()) + "\" ";
string ClientApp = CombinePaths(CmdEnv.LocalRoot, "Engine/Binaries/Win64/UnrealFrontend.exe");
Log("Deploying via UFE:");
Log("\tClientCmdLine: " + ClientCmdLine + "");
//@todo UAT: Consolidate running of external applications like UFE (See 'RunProjectCommand' for other instances)
PushDir(Path.GetDirectoryName(ClientApp));
// Always start client process and don't wait for exit.
IProcessResult ClientProcess = Run(ClientApp, ClientCmdLine, null, ERunOptions.NoWaitForExit);
PopDir();
if (ClientProcess != null)
{
do
{
Thread.Sleep(100);
}
while (ClientProcess.HasExited == false);
}
}
else
{
SC.StageTargetPlatform.Deploy(Params, SC);
}
}
}
if (Params.DedicatedServer)
{
ProjectParams ServerParams = new ProjectParams(Params);
ServerParams.Devices = new ParamList<string>(ServerParams.ServerDevice);
var DeployContextList = CreateDeploymentContext(ServerParams, true, false);
foreach ( var SC in DeployContextList )
{
SC.StageTargetPlatform.Deploy(ServerParams, SC);
}
}
Log("********** DEPLOY COMMAND COMPLETED **********");
}
示例7: Package
public static void Package(ProjectParams Params, int WorkingCL=-1)
{
Params.ValidateAndLog();
if (!Params.Package)
{
return;
}
if (!Params.NoClient)
{
var DeployContextList = CreateDeploymentContext(Params, false, false);
foreach ( var SC in DeployContextList )
{
if (SC.StageTargetPlatform.PackageViaUFE)
{
string ClientCmdLine = "-run=Package ";
ClientCmdLine += "-Targetplatform=" + SC.StageTargetPlatform.PlatformType.ToString() + " ";
ClientCmdLine += "-SourceDir=" + CombinePaths(Params.BaseStageDirectory, SC.StageTargetPlatform.PlatformType.ToString()) + " ";
string ClientApp = CombinePaths(CmdEnv.LocalRoot, "Engine/Binaries/Win64/UnrealFrontend.exe");
Log("Packaging via UFE:");
Log("\tClientCmdLine: " + ClientCmdLine + "");
//@todo UAT: Consolidate running of external applications like UFE (See 'RunProjectCommand' for other instances)
PushDir(Path.GetDirectoryName(ClientApp));
// Always start client process and don't wait for exit.
ProcessResult ClientProcess = Run(ClientApp, ClientCmdLine, null, ERunOptions.NoWaitForExit);
PopDir();
if (ClientProcess != null)
{
do
{
Thread.Sleep(100);
}
while (ClientProcess.HasExited == false);
}
}
else
{
SC.StageTargetPlatform.Package(Params, SC, WorkingCL);
}
}
}
if (Params.DedicatedServer)
{
var DeployContextList = CreateDeploymentContext(Params, true, false);
foreach (var SC in DeployContextList)
{
SC.StageTargetPlatform.Package(Params, SC, WorkingCL);
}
}
}
示例8: CopyBuildToStagingDirectory
public static void CopyBuildToStagingDirectory(ProjectParams Params)
{
if (ShouldCreatePak(Params) || (Params.Stage && !Params.SkipStage))
{
Params.ValidateAndLog();
LogConsole("********** STAGE COMMAND STARTED **********");
if (!Params.NoClient)
{
var DeployContextList = CreateDeploymentContext(Params, false, true);
foreach (var SC in DeployContextList)
{
// write out the commandline file now so it can go into the manifest
WriteStageCommandline(Params, SC);
CreateStagingManifest(Params, SC);
ApplyStagingManifest(Params, SC);
if (Params.Deploy)
{
// get the deployed file data
Dictionary<string, string> DeployedUFSFiles = new Dictionary<string, string>();
Dictionary<string, string> DeployedNonUFSFiles = new Dictionary<string, string>();
List<string> UFSManifests;
List<string> NonUFSManifests;
if (SC.StageTargetPlatform.RetrieveDeployedManifests(Params, SC, out UFSManifests, out NonUFSManifests))
{
DeployedUFSFiles = ReadDeployedManifest(Params, SC, UFSManifests);
DeployedNonUFSFiles = ReadDeployedManifest(Params, SC, NonUFSManifests);
}
// get the staged file data
Dictionary<string, string> StagedUFSFiles = ReadStagedManifest(Params, SC, DeploymentContext.UFSDeployedManifestFileName);
Dictionary<string, string> StagedNonUFSFiles = ReadStagedManifest(Params, SC, DeploymentContext.NonUFSDeployedManifestFileName);
WriteObsoleteManifest(Params, SC, DeployedUFSFiles, StagedUFSFiles, DeploymentContext.UFSDeployObsoleteFileName);
WriteObsoleteManifest(Params, SC, DeployedNonUFSFiles, StagedNonUFSFiles, DeploymentContext.NonUFSDeployObsoleteFileName);
if (Params.IterativeDeploy)
{
// write out the delta file data
WriteDeltaManifest(Params, SC, DeployedUFSFiles, StagedUFSFiles, DeploymentContext.UFSDeployDeltaFileName);
WriteDeltaManifest(Params, SC, DeployedNonUFSFiles, StagedNonUFSFiles, DeploymentContext.NonUFSDeployDeltaFileName);
}
}
if (Params.bCodeSign)
{
SC.StageTargetPlatform.SignExecutables(SC, Params);
}
}
}
if (Params.DedicatedServer)
{
var DeployContextList = CreateDeploymentContext(Params, true, true);
foreach (var SC in DeployContextList)
{
CreateStagingManifest(Params, SC);
ApplyStagingManifest(Params, SC);
}
}
LogConsole("********** STAGE COMMAND COMPLETED **********");
}
}
示例9: Build
public static void Build(BuildCommand Command, ProjectParams Params, int WorkingCL = -1)
{
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)
{
// @todo Mac: proper platform detection
UnrealTargetPlatform EditorPlatform = HostPlatform.Current.HostEditorPlatform;
const UnrealTargetConfiguration EditorConfiguration = UnrealTargetConfiguration.Development;
CrashReportPlatforms.Add(EditorPlatform);
Agenda.AddTargets(Params.EditorTargets.ToArray(), EditorPlatform, EditorConfiguration, Params.CodeBasedUprojectPath);
if (Params.EditorTargets.Contains("UnrealHeaderTool") == false)
{
Agenda.AddTargets(new string[] { "UnrealHeaderTool" }, EditorPlatform, EditorConfiguration);
}
if (Params.EditorTargets.Contains("ShaderCompileWorker") == false)
{
Agenda.AddTargets(new string[] { "ShaderCompileWorker" }, EditorPlatform, EditorConfiguration);
}
if (Params.Pak && Params.EditorTargets.Contains("UnrealPak") == false)
{
Agenda.AddTargets(new string[] { "UnrealPak" }, EditorPlatform, EditorConfiguration);
}
if (Params.FileServer && Params.EditorTargets.Contains("UnrealFileServer") == false)
{
Agenda.AddTargets(new string[] { "UnrealFileServer" }, EditorPlatform, EditorConfiguration);
}
}
// Setup cooked targets
if (Params.HasClientCookedTargets)
{
foreach (var BuildConfig in Params.ClientConfigsToBuild)
{
foreach (var ClientPlatform in Params.ClientTargetPlatforms)
{
CrashReportPlatforms.Add(ClientPlatform);
Agenda.AddTargets(Params.ClientCookedTargets.ToArray(), ClientPlatform, BuildConfig, Params.CodeBasedUprojectPath, InAddArgs: " -remoteini=\""+Path.GetDirectoryName(Params.RawProjectPath)+"\"");
}
}
}
if (Params.HasServerCookedTargets)
{
foreach (var BuildConfig in Params.ServerConfigsToBuild)
{
foreach (var ServerPlatform in Params.ServerTargetPlatforms)
{
CrashReportPlatforms.Add(ServerPlatform);
Agenda.AddTargets(Params.ServerCookedTargets.ToArray(), ServerPlatform, BuildConfig, Params.CodeBasedUprojectPath, InAddArgs: " -remoteini=\""+Path.GetDirectoryName(Params.RawProjectPath)+"\"");
}
}
}
if (Params.CrashReporter && !Params.Rocket)
{
var CrashReportClientTarget = new[] { "CrashReportClient" };
foreach (var CrashReportPlatform in CrashReportPlatforms)
{
if (UnrealBuildTool.UnrealBuildTool.PlatformSupportsCrashReporter(CrashReportPlatform))
{
Agenda.AddTargets(CrashReportClientTarget, CrashReportPlatform, UnrealTargetConfiguration.Development);
}
}
}
if (Params.HasProgramTargets && !Params.Rocket)
{
foreach (var BuildConfig in Params.ClientConfigsToBuild)
{
foreach (var ClientPlatform in Params.ClientTargetPlatforms)
{
Agenda.AddTargets(Params.ProgramTargets.ToArray(), ClientPlatform, BuildConfig, Params.CodeBasedUprojectPath);
}
}
}
UE4Build.Build(Agenda, InDeleteBuildProducts: Params.Clean, InUpdateVersionFiles: WorkingCL > 0);
if (WorkingCL > 0) // only move UAT files if we intend to check in some build products
{
UE4Build.AddUATFilesToBuildProducts();
}
UE4Build.CheckBuildProducts(UE4Build.BuildProductFiles);
if (WorkingCL > 0)
{
// Sign everything we built
CodeSign.SignMultipleIfEXEOrDLL(Command, UE4Build.BuildProductFiles);
//.........这里部分代码省略.........
示例10: Cook
public static void Cook(ProjectParams Params)
{
if ((!Params.Cook && !(Params.CookOnTheFly && !Params.SkipServer)) || Params.SkipCook)
{
return;
}
Params.ValidateAndLog();
Log("********** COOK COMMAND STARTED **********");
string UE4EditorExe = HostPlatform.Current.GetUE4ExePath(Params.UE4Exe);
if (!FileExists(UE4EditorExe))
{
throw new AutomationException("Missing " + UE4EditorExe + " executable. Needs to be built first.");
}
if (Params.CookOnTheFly && !Params.SkipServer)
{
if (Params.ClientTargetPlatforms.Count > 0)
{
var LogFolderOutsideOfSandbox = GetLogFolderOutsideOfSandbox();
if (!GlobalCommandLine.Installed)
{
// In the installed runs, this is the same folder as CmdEnv.LogFolder so delete only in not-installed
DeleteDirectory(LogFolderOutsideOfSandbox);
CreateDirectory(LogFolderOutsideOfSandbox);
}
var ServerLogFile = CombinePaths(LogFolderOutsideOfSandbox, "Server.log");
Platform ClientPlatformInst = Params.ClientTargetPlatformInstances[0];
string TargetCook = ClientPlatformInst.GetCookPlatform(false, Params.HasDedicatedServerAndClient, Params.CookFlavor);
ServerProcess = RunCookOnTheFlyServer(Params.RawProjectPath, Params.NoClient ? "" : ServerLogFile, TargetCook, Params.RunCommandline);
if (ServerProcess != null)
{
Log("Waiting a few seconds for the server to start...");
Thread.Sleep(5000);
}
}
else
{
throw new AutomationException("Failed to run, client target platform not specified");
}
}
else
{
var PlatformsToCook = new HashSet<string>();
if (!Params.NoClient)
{
foreach (var ClientPlatform in Params.ClientTargetPlatforms)
{
// Use the data platform, sometimes we will copy another platform's data
var DataPlatform = Params.GetCookedDataPlatformForClientTarget(ClientPlatform);
PlatformsToCook.Add(Params.GetTargetPlatformInstance(DataPlatform).GetCookPlatform(false, Params.HasDedicatedServerAndClient, Params.CookFlavor));
}
}
if (Params.DedicatedServer)
{
foreach (var ServerPlatform in Params.ServerTargetPlatforms)
{
// Use the data platform, sometimes we will copy another platform's data
var DataPlatform = Params.GetCookedDataPlatformForServerTarget(ServerPlatform);
PlatformsToCook.Add(Params.GetTargetPlatformInstance(DataPlatform).GetCookPlatform(true, false, Params.CookFlavor));
}
}
if (Params.Clean.HasValue && Params.Clean.Value && !Params.IterativeCooking)
{
Log("Cleaning cooked data.");
CleanupCookedData(PlatformsToCook.ToList(), Params);
}
// cook the set of maps, or the run map, or nothing
string[] Maps = null;
if (Params.HasMapsToCook)
{
Maps = Params.MapsToCook.ToArray();
}
string[] Dirs = null;
if (Params.HasDirectoriesToCook)
{
Dirs = Params.DirectoriesToCook.ToArray();
}
string[] Cultures = null;
if (Params.HasCulturesToCook)
{
Cultures = Params.CulturesToCook.ToArray();
}
try
{
var CommandletParams = "-buildmachine -Unversioned -fileopenlog";
if (Params.UseDebugParamForEditorExe)
{
CommandletParams += " -debug";
}
if (Params.Manifests)
{
//.........这里部分代码省略.........
示例11: Cook
public static void Cook(ProjectParams Params)
{
if ((!Params.Cook && !(Params.CookOnTheFly && !Params.SkipServer)) || Params.SkipCook)
{
return;
}
Params.ValidateAndLog();
LogConsole("********** COOK COMMAND STARTED **********");
string UE4EditorExe = HostPlatform.Current.GetUE4ExePath(Params.UE4Exe);
if (!FileExists(UE4EditorExe))
{
throw new AutomationException("Missing " + UE4EditorExe + " executable. Needs to be built first.");
}
if (Params.CookOnTheFly && !Params.SkipServer)
{
if (Params.HasDLCName)
{
throw new AutomationException("Cook on the fly doesn't support cooking dlc");
}
if (Params.ClientTargetPlatforms.Count > 0)
{
var LogFolderOutsideOfSandbox = GetLogFolderOutsideOfSandbox();
if (!GlobalCommandLine.Installed)
{
// In the installed runs, this is the same folder as CmdEnv.LogFolder so delete only in not-installed
DeleteDirectory(LogFolderOutsideOfSandbox);
CreateDirectory(LogFolderOutsideOfSandbox);
}
String COTFCommandLine = Params.RunCommandline;
if (Params.IterativeCooking)
{
COTFCommandLine += " -iterate";
}
var ServerLogFile = CombinePaths(LogFolderOutsideOfSandbox, "Server.log");
Platform ClientPlatformInst = Params.ClientTargetPlatformInstances[0];
string TargetCook = ClientPlatformInst.GetCookPlatform(false, Params.HasDedicatedServerAndClient, Params.CookFlavor);
ServerProcess = RunCookOnTheFlyServer(Params.RawProjectPath, Params.NoClient ? "" : ServerLogFile, TargetCook, COTFCommandLine);
if (ServerProcess != null)
{
LogConsole("Waiting a few seconds for the server to start...");
Thread.Sleep(5000);
}
}
else
{
throw new AutomationException("Failed to run, client target platform not specified");
}
}
else
{
var PlatformsToCook = new HashSet<string>();
if (!Params.NoClient)
{
foreach (var ClientPlatform in Params.ClientTargetPlatforms)
{
// Use the data platform, sometimes we will copy another platform's data
var DataPlatform = Params.GetCookedDataPlatformForClientTarget(ClientPlatform);
PlatformsToCook.Add(Params.GetTargetPlatformInstance(DataPlatform).GetCookPlatform(false, Params.HasDedicatedServerAndClient, Params.CookFlavor));
}
}
if (Params.DedicatedServer)
{
foreach (var ServerPlatform in Params.ServerTargetPlatforms)
{
// Use the data platform, sometimes we will copy another platform's data
var DataPlatform = Params.GetCookedDataPlatformForServerTarget(ServerPlatform);
PlatformsToCook.Add(Params.GetTargetPlatformInstance(DataPlatform).GetCookPlatform(true, false, Params.CookFlavor));
}
}
if (Params.Clean.HasValue && Params.Clean.Value && !Params.IterativeCooking)
{
LogConsole("Cleaning cooked data.");
CleanupCookedData(PlatformsToCook.ToList(), Params);
}
// cook the set of maps, or the run map, or nothing
string[] Maps = null;
if (Params.HasMapsToCook)
{
Maps = Params.MapsToCook.ToArray();
foreach (var M in Maps)
{
LogConsole("HasMapsToCook " + M.ToString());
}
foreach (var M in Params.MapsToCook)
{
LogConsole("Params.HasMapsToCook " + M.ToString());
}
}
string[] Dirs = null;
if (Params.HasDirectoriesToCook)
//.........这里部分代码省略.........
示例12: SetupParams
protected ProjectParams SetupParams()
{
Log("Setting up ProjectParams for {0}", ProjectPath);
var Params = new ProjectParams
(
Command: this,
// Shared
RawProjectPath: ProjectPath
);
// Initialize map
var Map = ParseParamValue("map");
if (Map == null)
{
LogVerbose("-map command line param not found, trying to find DefaultMap in INI.");
Map = GetDefaultMap(Params);
}
if (!String.IsNullOrEmpty(Map))
{
if (ParseParam("allmaps"))
{
Log("Cooking all maps");
}
else
{
Params.MapsToCook = new ParamList<string>(Map);
}
Params.MapToRun = GetFirstMap(Map);
}
// @rocket hack: non-code projects cannot run in Debug
if (Params.Rocket && !ProjectUtils.IsCodeBasedUProjectFile(ProjectPath))
{
if (Params.ClientConfigsToBuild.Contains(UnrealTargetConfiguration.Debug))
{
Log("Non-code projects cannot run in Debug game clients. Defaulting to Development.");
Params.ClientConfigsToBuild.Remove(UnrealTargetConfiguration.Debug);
Params.ClientConfigsToBuild.Add(UnrealTargetConfiguration.Development);
}
if (Params.ClientConfigsToBuild.Contains(UnrealTargetConfiguration.Debug))
{
Log("Non-code projects cannot run in Debug game servers. Defaulting to Development.");
Params.ServerConfigsToBuild.Remove(UnrealTargetConfiguration.Debug);
Params.ServerConfigsToBuild.Add(UnrealTargetConfiguration.Development);
}
}
var DirectoriesToCook = ParseParamValue("cookdir");
if (!String.IsNullOrEmpty(DirectoriesToCook))
{
Params.DirectoriesToCook = new ParamList<string>(DirectoriesToCook.Split('+'));
}
var InternationalizationPreset = ParseParamValue("i18npreset");
if (!String.IsNullOrEmpty(InternationalizationPreset))
{
Params.InternationalizationPreset = InternationalizationPreset;
}
var CulturesToCook = ParseParamValue("cookcultures");
if (!String.IsNullOrEmpty(CulturesToCook))
{
Params.CulturesToCook = new ParamList<string>(CulturesToCook.Split('+'));
}
if (Params.DedicatedServer)
{
foreach (var ServerPlatformInstance in Params.ServerTargetPlatformInstances)
{
ServerPlatformInstance.PlatformSetupParams(ref Params);
}
}
else
{
foreach (var ClientPlatformInstance in Params.ClientTargetPlatformInstances)
{
ClientPlatformInstance.PlatformSetupParams(ref Params);
}
}
Params.ValidateAndLog();
return Params;
}
示例13: SetupParams
protected ProjectParams SetupParams()
{
Log("Setting up ProjectParams for {0}", ProjectPath);
var Params = new ProjectParams
(
Command: this,
// Shared
RawProjectPath: ProjectPath
);
var DirectoriesToCook = ParseParamValue("cookdir");
if (!String.IsNullOrEmpty(DirectoriesToCook))
{
Params.DirectoriesToCook = new ParamList<string>(DirectoriesToCook.Split('+'));
}
var InternationalizationPreset = ParseParamValue("i18npreset");
if (!String.IsNullOrEmpty(InternationalizationPreset))
{
Params.InternationalizationPreset = InternationalizationPreset;
}
var CulturesToCook = ParseParamValue("cookcultures");
if (!String.IsNullOrEmpty(CulturesToCook))
{
Params.CulturesToCook = new ParamList<string>(CulturesToCook.Split('+'));
}
if (Params.DedicatedServer)
{
foreach (var ServerPlatformInstance in Params.ServerTargetPlatformInstances)
{
ServerPlatformInstance.PlatformSetupParams(ref Params);
}
}
else
{
foreach (var ClientPlatformInstance in Params.ClientTargetPlatformInstances)
{
ClientPlatformInstance.PlatformSetupParams(ref Params);
}
}
Params.ValidateAndLog();
return Params;
}
示例14: Build
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 && !Automation.IsEngineInstalled() && (TargetMask & ProjectBuildTargets.Editor) == ProjectBuildTargets.Editor)
{
// @todo Mac: proper platform detection
UnrealTargetPlatform EditorPlatform = HostPlatform.Current.HostEditorPlatform;
const UnrealTargetConfiguration EditorConfiguration = UnrealTargetConfiguration.Development;
CrashReportPlatforms.Add(EditorPlatform);
Agenda.AddTargets(Params.EditorTargets.ToArray(), EditorPlatform, EditorConfiguration, Params.CodeBasedUprojectPath);
if (Params.EditorTargets.Contains("UnrealHeaderTool") == false)
{
Agenda.AddTargets(new string[] { "UnrealHeaderTool" }, EditorPlatform, EditorConfiguration);
}
if (Params.EditorTargets.Contains("ShaderCompileWorker") == false)
{
Agenda.AddTargets(new string[] { "ShaderCompileWorker" }, EditorPlatform, EditorConfiguration);
}
if (Params.Pak && Params.EditorTargets.Contains("UnrealPak") == false)
{
Agenda.AddTargets(new string[] { "UnrealPak" }, EditorPlatform, EditorConfiguration);
}
if (Params.FileServer && Params.EditorTargets.Contains("UnrealFileServer") == false)
{
Agenda.AddTargets(new string[] { "UnrealFileServer" }, EditorPlatform, EditorConfiguration);
}
}
// Setup cooked targets
if (Params.HasClientCookedTargets && (TargetMask & ProjectBuildTargets.ClientCooked) == ProjectBuildTargets.ClientCooked)
{
List<UnrealTargetPlatform> UniquePlatformTypes = Params.ClientTargetPlatforms.ConvertAll(x => x.Type).Distinct().ToList();
foreach (var BuildConfig in Params.ClientConfigsToBuild)
{
foreach (var ClientPlatformType in UniquePlatformTypes)
{
string ScriptPluginArgs = GetBlueprintPluginPathArgument(Params, true, ClientPlatformType);
CrashReportPlatforms.Add(ClientPlatformType);
Agenda.AddTargets(Params.ClientCookedTargets.ToArray(), ClientPlatformType, BuildConfig, Params.CodeBasedUprojectPath, InAddArgs: ScriptPluginArgs + " -remoteini=\"" + Params.RawProjectPath.Directory.FullName + "\"");
}
}
}
if (Params.HasServerCookedTargets && (TargetMask & ProjectBuildTargets.ServerCooked) == ProjectBuildTargets.ServerCooked)
{
List<UnrealTargetPlatform> UniquePlatformTypes = Params.ServerTargetPlatforms.ConvertAll(x => x.Type).Distinct().ToList();
foreach (var BuildConfig in Params.ServerConfigsToBuild)
{
foreach (var ServerPlatformType in UniquePlatformTypes)
{
string ScriptPluginArgs = GetBlueprintPluginPathArgument(Params, false, ServerPlatformType);
CrashReportPlatforms.Add(ServerPlatformType);
Agenda.AddTargets(Params.ServerCookedTargets.ToArray(), ServerPlatformType, BuildConfig, Params.CodeBasedUprojectPath, InAddArgs: ScriptPluginArgs + " -remoteini=\"" + Params.RawProjectPath.Directory.FullName + "\"");
}
}
}
if (!Params.NoBootstrapExe && !Automation.IsEngineInstalled() && (TargetMask & ProjectBuildTargets.Bootstrap) == ProjectBuildTargets.Bootstrap)
{
UnrealBuildTool.UnrealTargetPlatform[] BootstrapPackagedGamePlatforms = { UnrealBuildTool.UnrealTargetPlatform.Win32, UnrealBuildTool.UnrealTargetPlatform.Win64 };
foreach(UnrealBuildTool.UnrealTargetPlatform BootstrapPackagedGamePlatformType in BootstrapPackagedGamePlatforms)
{
if(Params.ClientTargetPlatforms.Contains(new TargetPlatformDescriptor(BootstrapPackagedGamePlatformType)))
{
Agenda.AddTarget("BootstrapPackagedGame", BootstrapPackagedGamePlatformType, UnrealBuildTool.UnrealTargetConfiguration.Shipping);
}
}
}
if (Params.CrashReporter && !Automation.IsEngineInstalled() && (TargetMask & ProjectBuildTargets.CrashReporter) == ProjectBuildTargets.CrashReporter)
{
foreach (var CrashReportPlatform in CrashReportPlatforms)
{
if (UnrealBuildTool.UnrealBuildTool.PlatformSupportsCrashReporter(CrashReportPlatform))
{
Agenda.AddTarget("CrashReportClient", CrashReportPlatform, UnrealTargetConfiguration.Shipping);
}
}
}
if (Params.HasProgramTargets && (TargetMask & ProjectBuildTargets.Programs) == ProjectBuildTargets.Programs)
{
List<UnrealTargetPlatform> UniquePlatformTypes = Params.ClientTargetPlatforms.ConvertAll(x => x.Type).Distinct().ToList();
foreach (var BuildConfig in Params.ClientConfigsToBuild)
{
foreach (var ClientPlatformType in UniquePlatformTypes)
{
//.........这里部分代码省略.........
示例15: Cook
public static void Cook(ProjectParams Params)
{
if (!Params.Cook || Params.SkipCook)
{
return;
}
Params.ValidateAndLog();
string UE4EditorExe = HostPlatform.Current.GetUE4ExePath(Params.UE4Exe);
if (!FileExists(UE4EditorExe))
{
throw new AutomationException("Missing " + Params.UE4Exe + " executable. Needs to be built first.");
}
var PlatformsToCook = new List<string>();
if (!Params.NoClient)
{
foreach ( var ClientPlatformInstance in Params.ClientTargetPlatformInstances )
{
PlatformsToCook.Add(ClientPlatformInstance.GetCookPlatform(false, Params.HasDedicatedServerAndClient, Params.CookFlavor));
}
}
if (Params.DedicatedServer)
{
foreach ( var ServerPlatformInstance in Params.ServerTargetPlatformInstances )
{
PlatformsToCook.Add(ServerPlatformInstance.GetCookPlatform(true, false, Params.CookFlavor));
}
}
if (Params.Clean.HasValue && Params.Clean.Value && !Params.IterativeCooking)
{
Log("Cleaning cooked data.");
CleanupCookedData(PlatformsToCook, Params);
}
// cook the set of maps, or the run map, or nothing
string[] Maps = null;
if (Params.HasMapsToCook)
{
Maps = Params.MapsToCook.ToArray();
}
string[] Dirs = null;
if (Params.HasDirectoriesToCook)
{
Dirs = Params.DirectoriesToCook.ToArray();
}
try
{
var CommandletParams = "-unattended -buildmachine -forcelogflush -AllowStdOutTraceEventType -Unversioned";
if (Params.Compressed)
{
CommandletParams += " -Compressed";
}
if (Params.UseDebugParamForEditorExe)
{
CommandletParams += " -debug";
}
if (Params.Manifests)
{
CommandletParams += " -manifests";
}
if (Params.IterativeCooking)
{
CommandletParams += " -iterate";
}
CookCommandlet(Params.RawProjectPath, Params.UE4Exe, Maps, Dirs, CombineCommandletParams(PlatformsToCook.ToArray()), CommandletParams);
}
catch (Exception Ex)
{
// Delete cooked data (if any) as it may be incomplete / corrupted.
Log("Cook failed. Deleting cooked data.");
CleanupCookedData(PlatformsToCook, Params);
throw Ex;
}
}