Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/OpenEditor.Automation.cs
Andrew Grant fae8c0e5e0 Merging using AndrewG_Temp
Quality of life improvements for Mac / Linux that missed the initial 4.23 branch.

- UAT scripts now in project root
- SyncProject script moved out of NotForLicensees
- SyncProject script deals with writable build version files
- SyncProject script now treats -cl as optional argument (if omitted sync is to #head)
- Helper scripts for Building, opening the editor, and creating a p4config file.

#jira UE-37807
#rb na

[CL 7633933 by Andrew Grant in 4.23 branch]
2019-07-26 11:01:15 -04:00

51 lines
1.2 KiB
C#

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Tools.DotNETCommon;
using UnrealBuildTool;
namespace AutomationTool
{
[Help("Opens the specified project.")]
[Help("project=<QAGame>", "Project to open. Will search current path and paths in ueprojectdirs. If omitted will open vanilla UE4Editor")]
class OpenEditor: BuildCommand
{
// exposed as a property so projects can derive and set this directly
public string ProjectName { get; set; }
public OpenEditor()
{
}
public override ExitCode Execute()
{
string EditorPath = HostPlatform.Current.GetUE4ExePath("UE4Editor");
string EditorArgs = "";
ProjectName = ParseParamValue("project", ProjectName);
if (!String.IsNullOrEmpty(ProjectName))
{
FileReference ProjectFile = ProjectUtils.FindProjectFileFromName(ProjectName);
if (ProjectFile == null)
{
throw new AutomationException("Unable to find uproject file for {0}", ProjectName);
}
EditorArgs = ProjectFile.FullName;
}
Run(EditorPath, EditorArgs, null, ERunOptions.NoWaitForExit);
return ExitCode.Success;
}
}
}