/// <summary> /// Execute the task. /// </summary> /// <param name="Job">Information about the current job</param> /// <param name="BuildProducts">Set of build products produced by this node.</param> /// <param name="TagNameToFileSet">Mapping from tag names to the set of files they include</param> public override void Execute(JobContext Job, HashSet <FileReference> BuildProducts, Dictionary <string, HashSet <FileReference> > TagNameToFileSet) { // If we're merging telemetry from the child process, get a temp filename for it FileReference TelemetryFile = null; if (Parameters.MergeTelemetryWithPrefix != null) { TelemetryFile = FileReference.Combine(CommandUtils.RootDirectory, "Engine", "Intermediate", "UAT", "Telemetry.json"); DirectoryReference.CreateDirectory(TelemetryFile.Directory); } // Run the command StringBuilder CommandLine = new StringBuilder(); if (Parameters.Arguments == null || (!Parameters.Arguments.CaseInsensitiveContains("-p4") && !Parameters.Arguments.CaseInsensitiveContains("-nop4"))) { CommandLine.AppendFormat("{0} ", CommandUtils.P4Enabled ? "-p4" : "-nop4"); } if (Parameters.Arguments == null || (!Parameters.Arguments.CaseInsensitiveContains("-submit") && !Parameters.Arguments.CaseInsensitiveContains("-nosubmit"))) { if (GlobalCommandLine.Submit.IsSet) { CommandLine.Append("-submit "); } if (GlobalCommandLine.NoSubmit.IsSet) { CommandLine.Append("-nosubmit "); } } CommandLine.Append(Parameters.Name); if (!String.IsNullOrEmpty(Parameters.Arguments)) { CommandLine.AppendFormat(" {0}", Parameters.Arguments); } if (TelemetryFile != null) { CommandLine.AppendFormat(" -Telemetry={0}", CommandUtils.MakePathSafeToUseWithCommandLine(TelemetryFile.FullName)); } CommandUtils.RunUAT(CommandUtils.CmdEnv, CommandLine.ToString(), Identifier: Parameters.Name); // Merge in any new telemetry data that was produced if (TelemetryFile != null && FileReference.Exists(TelemetryFile)) { Log.TraceLog("Merging telemetry from {0}", TelemetryFile); TelemetryData NewTelemetry; if (TelemetryData.TryRead(TelemetryFile, out NewTelemetry)) { CommandUtils.Telemetry.Merge(Parameters.MergeTelemetryWithPrefix, NewTelemetry); } else { Log.TraceWarning("Unable to read UAT telemetry file from {0}", TelemetryFile); } } }
/// <summary> /// Execute the task. /// </summary> /// <param name="Job">Information about the current job</param> /// <param name="BuildProducts">Set of build products produced by this node.</param> /// <param name="TagNameToFileSet">Mapping from tag names to the set of files they include</param> /// <returns>True if the task succeeded</returns> public override bool Execute(JobContext Job, HashSet <FileReference> BuildProducts, Dictionary <string, HashSet <FileReference> > TagNameToFileSet) { // If we're merging telemetry from the child process, get a temp filename for it FileReference TelemetryFile = null; if (Parameters.MergeTelemetryWithPrefix != null) { TelemetryFile = FileReference.Combine(CommandUtils.RootDirectory, "Engine", "Intermediate", "UAT", "Telemetry.json"); DirectoryReference.CreateDirectory(TelemetryFile.Directory); } // Run the command StringBuilder CommandLine = new StringBuilder(); if (Parameters.Arguments == null || (!Parameters.Arguments.CaseInsensitiveContains("-p4") && !Parameters.Arguments.CaseInsensitiveContains("-nop4"))) { CommandLine.AppendFormat("{0} ", CommandUtils.P4Enabled ? "-p4" : "-nop4"); } if (Parameters.Arguments == null || (!Parameters.Arguments.CaseInsensitiveContains("-submit") && !Parameters.Arguments.CaseInsensitiveContains("-nosubmit"))) { CommandLine.AppendFormat("{0} ", CommandUtils.AllowSubmit ? "-submit" : "-nosubmit"); } CommandLine.Append(Parameters.Name); if (!String.IsNullOrEmpty(Parameters.Arguments)) { CommandLine.AppendFormat(" {0}", Parameters.Arguments); } if (TelemetryFile != null) { CommandLine.AppendFormat(" -Telemetry={0}", CommandUtils.MakePathSafeToUseWithCommandLine(TelemetryFile.FullName)); } try { CommandUtils.RunUAT(CommandUtils.CmdEnv, CommandLine.ToString()); } catch (CommandUtils.CommandFailedException) { return(false); } // Merge in any new telemetry data that was produced if (Parameters.MergeTelemetryWithPrefix != null) { TelemetryData NewTelemetry; if (TelemetryData.TryRead(TelemetryFile.FullName, out NewTelemetry)) { CommandUtils.Telemetry.Merge(Parameters.MergeTelemetryWithPrefix, NewTelemetry); } } return(true); }
/// <summary> /// Execute the task. /// </summary> /// <param name="Job">Information about the current job</param> /// <param name="BuildProducts">Set of build products produced by this node.</param> /// <param name="TagNameToFileSet">Mapping from tag names to the set of files they include</param> /// <returns>True if the task succeeded</returns> public override bool Execute(JobContext Job, HashSet <FileReference> BuildProducts, Dictionary <string, HashSet <FileReference> > TagNameToFileSet) { // If we're merging telemetry from the child process, get a temp filename for it FileReference TelemetryFile = null; if (Parameters.MergeTelemetryWithPrefix != null) { TelemetryFile = FileReference.Combine(CommandUtils.RootDirectory, "Engine", "Intermediate", "UAT", "Telemetry.json"); TelemetryFile.Directory.CreateDirectory(); } // Run the command string CommandLine = Parameters.Name; if (!String.IsNullOrEmpty(Parameters.Arguments)) { CommandLine += String.Format(" {0}", Parameters.Arguments); } if (TelemetryFile != null) { CommandLine += String.Format(" -Telemetry={0}", CommandUtils.MakePathSafeToUseWithCommandLine(TelemetryFile.FullName)); } try { CommandUtils.RunUAT(CommandUtils.CmdEnv, CommandLine); } catch (CommandUtils.CommandFailedException) { return(false); } // Merge in any new telemetry data that was produced if (Parameters.MergeTelemetryWithPrefix != null) { TelemetryData NewTelemetry; if (TelemetryData.TryRead(TelemetryFile.FullName, out NewTelemetry)) { CommandUtils.Telemetry.Merge(Parameters.MergeTelemetryWithPrefix, NewTelemetry); } } return(true); }