private void CheckOutMaps(ProjectParams Params) { Log("Running Step:- RebuildLightMaps::CheckOutMaps"); // Setup a P4 Cl we will use to submit the new lightmaps WorkingCL = P4.CreateChange(P4Env.Client, String.Format("{0} rebuilding lightmaps from changelist {1}", Params.ShortProjectName, P4Env.Changelist)); Log("Working in {0}", WorkingCL); string AllMapsWildcardCmdline = String.Format("{0}\\...\\*.umap", Params.RawProjectPath.Directory); string Output = ""; P4.P4Output(out Output, String.Format("edit -c {0} {1}", WorkingCL, AllMapsWildcardCmdline)); // We need to ensure that any error in the output log is observed. // P4 is still successful if it manages to run the operation. if (FoundCheckOutErrorInP4Output(Output) == true) { LogError("Failed to check out every one of the project maps."); throw new AutomationException("Failed to check out every one of the project maps."); } }
public override void ExecuteBuild() { string TemplateClient = "ue4_licensee_workspace"; var Clients = P4.GetClientsForUser("UE4_Licensee"); string TestClient = "UAT_Test_Client"; P4ClientInfo NewClient = null; foreach (var Client in Clients) { if (Client.Name == TemplateClient) { NewClient = Client; break; } } if (NewClient == null) { throw new AutomationException("Could not find template"); } NewClient.Owner = P4Env.User; // this is not right, we need the actual licensee user! NewClient.Host = Environment.MachineName.ToLower(); NewClient.RootPath = @"C:\TestClient"; NewClient.Name = TestClient; if (P4.DoesClientExist(TestClient)) { P4.DeleteClient(TestClient); } P4.CreateClient(NewClient); //P4CLIENT Name of client workspace p4 help client //P4PASSWD User password passed to server p4 help passwd string[] VarsToSave = { "P4CLIENT", //"P4PASSWD", }; var KeyValues = new Dictionary <string, string>(); foreach (var ToSave in VarsToSave) { KeyValues.Add(ToSave, GetEnvVar(ToSave)); } SetEnvVar("P4CLIENT", NewClient.Name); //SetEnv("P4PASSWD", ParseParamValue("LicenseePassword"); //Sync(CombinePaths(PathSeparator.Slash, P4Env.BuildRootP4, "UE4Games.uprojectdirs")); string Output; P4.P4Output(out Output, "files -m 10 " + CombinePaths(PathSeparator.Slash, P4Env.Branch, "...")); var Lines = Output.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); string SlashRoot = CombinePaths(PathSeparator.Slash, P4Env.Branch, "/"); string LocalRoot = CombinePaths(CmdEnv.LocalRoot, @"\"); foreach (string Line in Lines) { if (Line.Contains(" - ") && Line.Contains("#")) { string depot = Line.Substring(0, Line.IndexOf("#")); if (!depot.Contains(SlashRoot)) { throw new AutomationException("{0} does not contain {1} and it is supposed to.", depot, P4Env.Branch); } string local = CombinePaths(depot.Replace(SlashRoot, LocalRoot)); LogInformation("{0}", depot); LogInformation(" {0}", local); } } // should be used as a sanity check! make sure there are no files! P4.LogP4Output(out Output, "files -m 10 " + CombinePaths(PathSeparator.Slash, P4Env.Branch, "...", "NoRedist", "...")); // caution this doesn't actually use the client _view_ from the template at all! // if you want that sync -f -k /... // then use client syntax in the files command instead // don't think we care, we don't rely on licensee _views_ foreach (var ToLoad in VarsToSave) { SetEnvVar(ToLoad, KeyValues[ToLoad]); } P4.DeleteClient(TestClient); }