Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/Localisation.Automation.cs
Andrew Grant f25badee7f Copying //UE4/Orion-Staging to //UE4/Main (Origin: //Orion/Dev-General @2826496)
#lockdown Nick.Penwarden

==========================
MAJOR FEATURES + CHANGES
==========================

Change 2826201 on 2016/01/13 by Zabir.Hoque

	Add more verbose logging to try to understand #OR-11297

	#lockdown Andrew.Grant
	#CodeReview Marcus.Wassmer
	#RB none
	#TESTS compiled Win64 debug editor, ran agora_p

Change 2826170 on 2016/01/13 by Marcus.Wassmer

	Flush unloaded resource properly in LoadMap
	#codereview Gil.Gribb
	#rb none
	#test cycling game.  memory is freed properly now.
	#lockdown Andrew.Grant

Change 2826135 on 2016/01/12 by Michael.Noland

	Orion: Improve login screen on PC to reduce the potential impact of framerate on data center ping calculation
	- Disabled async streaming for the duration of the QOS ping measurement to avoid hitches
	- Added a circular throbber in the top left corner of the login screen indicating that something is async streaming (as a diagnostic tool for users affected by the datacenter ping, can be removed in the future)
	- Added logging of the current average frame time when the datacenter ping is finalized
	- Added a 'Pick Ideal Settings' button to the login screen (note: on the actual screen, not the login widget, so it will not appear on PS4)
	#jira OR-12453
	#rb paul.moore
	#tests Ran a QOS server and client and verified that the new logging is occurring, tried out the new benchmark button, etc...

	Merging CL# 2826128 using //Orion/Main_to_//Orion/Dev-General

Change 2826131 on 2016/01/12 by Michael.Noland

	#UE4 - added print out of MS/FPS during Qos ping evaluation
	#rb michael.noland
	#tests loaded up through login screen to see output

	Merging CL# 2825678 using //Orion/Main_to_//Orion/Dev-General

Change 2826128 on 2016/01/12 by Michael.Noland

	Orion: Improve login screen on PC to reduce the potential impact of framerate on data center ping calculation
	- Disabled async streaming for the duration of the QOS ping measurement to avoid hitches
	- Added a circular throbber in the top left corner of the login screen indicating that something is async streaming (as a diagnostic tool for users affected by the datacenter ping, can be removed in the future)
	- Added logging of the current average frame time when the datacenter ping is finalized
	- Added a 'Pick Ideal Settings' button to the login screen (note: on the actual screen, not the login widget, so it will not appear on PS4)
	#jira OR-12453
	#rb paul.moore
	#tests Ran a QOS server and client and verified that the new logging is occurring, tried out the new benchmark button, etc...

	Merging CL# 2826116 using //Orion/Release-Next->//Orion/Main

Change 2826116 on 2016/01/12 by Michael.Noland

	Orion: Improve login screen on PC to reduce the potential impact of framerate on data center ping calculation
	- Disabled async streaming for the duration of the QOS ping measurement to avoid hitches
	- Added a circular throbber in the top left corner of the login screen indicating that something is async streaming (as a diagnostic tool for users affected by the datacenter ping, can be removed in the future)
	- Added logging of the current average frame time when the datacenter ping is finalized
	- Added a 'Pick Ideal Settings' button to the login screen (note: on the actual screen, not the login widget, so it will not appear on PS4)
	#jira OR-12453
	#rb paul.moore
	#tests Ran a QOS server and client and verified that the new logging is occurring, tried out the new benchmark button, etc...
	#lockdown andrew.grant
	#codereview josh.markiewicz

Change 2825772 on 2016/01/12 by Dmitry.Rekman

	Linux signal handling improvements.

	- Switch crash handlers to use "crash malloc" (preallocated memory) on crash.
	- Remove unnecessary memory allocations from graceful termination handler.

	#rb none
	#tests Run the Linux server and crashed it a few times.
	#codereview David.Vossel, Michael.Trepka

Change 2825768 on 2016/01/12 by Josh.Markiewicz

	#UE4 - added print out of MS/FPS during Qos ping evaluation
	#rb michael.noland
	#tests loaded up through login screen to see output

Change 2825703 on 2016/01/12 by Brian.Karis

	Switched on new motion blur. Set temporal AA sharpness to 1.

	#rb none
	#TESTS editor

Change 2825689 on 2016/01/12 by Lina.Halper

	Fix for get animation notify crash

	https://jira.ol.epicgames.net/browse/OR-12248
	https://jira.ol.epicgames.net/browse/OR-12348

	- Also fixed the crash in preview of persona due to blend sample cache contains previous animation data
	- Also fixed blend space player to reinitialize cache data
	- The main issue is marker doesn't clamp the length, causing notifies ensure to trigger.

	#rb : Laurent.Delayen
	#tests: 10 Sparrows bot match for long time
	#code review: Martin.Wilson
	#lockdown: Andrew.Grant

Change 2825680 on 2016/01/12 by Martin.Mittring

	fixed all cases with r.Tonemapper.ScreenPercentage, ScreenPercentage, Fringe, Vignette, ViewRect, flickering with transluceny (View members have been modified while other thread was reading)
	#rb:Olaf.Piesche, David.Hill
	#test: PC, many cases

Change 2825579 on 2016/01/12 by Chris.Bunner

	Force shadow shape bone indices on the required update list.
	#rb Lina.Halper, Rolando.Caloca
	#tests Editor
	#codereview Daniel.Wright
	#jira OR-12339

Change 2825443 on 2016/01/12 by Martin.Mittring
2016-01-14 08:11:47 -05:00

233 lines
9.2 KiB
C#

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.IO;
using AutomationTool;
using UnrealBuildTool;
using EpicGames.Localization;
[Help("Updates the OneSky localization data using the arguments provided.")]
[Help("UEProjectDirectory", "Sub-path to the project we're gathering for (relative to CmdEnv.LocalRoot).")]
[Help("UEProjectName", "Optional name of the project we're gathering for (should match its .uproject file, eg QAGame).")]
[Help("LocalizationProjectNames", "Comma separated list of the projects to gather text from.")]
[Help("LocalizationBranch", "Optional suffix to use when uploading the new data to the localization provider.")]
[Help("LocalizationProvider", "Optional localization provide override (default is OneSky).")]
class Localise : BuildCommand
{
public override void ExecuteBuild()
{
var EditorExe = CombinePaths(CmdEnv.LocalRoot, @"Engine/Binaries/Win64/UE4Editor-Cmd.exe");
// Parse out the required command line arguments
var UEProjectDirectory = ParseParamValue("UEProjectDirectory");
if (UEProjectDirectory == null)
{
throw new AutomationException("Missing required command line argument: 'UEProjectDirectory'");
}
var UEProjectName = ParseParamValue("UEProjectName");
if (UEProjectName == null)
{
UEProjectName = "";
}
var LocalizationProjectNames = new List<string>();
{
var LocalizationProjectNamesStr = ParseParamValue("LocalizationProjectNames");
if (LocalizationProjectNamesStr == null)
{
throw new AutomationException("Missing required command line argument: 'LocalizationProjectNames'");
}
foreach (var ProjectName in LocalizationProjectNamesStr.Split(','))
{
LocalizationProjectNames.Add(ProjectName.Trim());
}
}
var LocalizationProviderName = ParseParamValue("LocalizationProvider");
if (LocalizationProviderName == null)
{
LocalizationProviderName = "OneSky";
}
var RootWorkingDirectory = CombinePaths(CmdEnv.LocalRoot, UEProjectDirectory);
// Try and find our localization provider
LocalizationProvider LocProvider = null;
{
LocalizationProvider.LocalizationProviderArgs LocProviderArgs;
LocProviderArgs.RootWorkingDirectory = RootWorkingDirectory;
LocProviderArgs.CommandUtils = this;
LocProvider = LocalizationProvider.GetLocalizationProvider(LocalizationProviderName, LocProviderArgs);
}
// Make sure the Localization configs and content is up-to-date to ensure we don't get errors later on
if (P4Enabled)
{
Log("Sync necessary content to head revision");
P4.Sync(P4Env.BuildRootP4 + "/" + UEProjectDirectory + "/Config/Localization/...");
P4.Sync(P4Env.BuildRootP4 + "/" + UEProjectDirectory + "/Content/Localization/...");
}
// Generate the info we need to gather for each project
var ProjectInfos = new List<ProjectInfo>();
foreach (var ProjectName in LocalizationProjectNames)
{
ProjectInfos.Add(GenerateProjectInfo(RootWorkingDirectory, ProjectName));
}
// Export all text from OneSky
foreach (var ProjectInfo in ProjectInfos)
{
LocProvider.DownloadProjectFromLocalizationProvider(ProjectInfo.ProjectName, ProjectInfo.ImportInfo);
}
// Setup editor arguments for SCC.
string EditorArguments = String.Empty;
if (P4Enabled)
{
EditorArguments = String.Format("-SCCProvider={0} -P4Port={1} -P4User={2} -P4Client={3} -P4Passwd={4}", "Perforce", P4Env.P4Port, P4Env.User, P4Env.Client, P4.GetAuthenticationToken());
}
else
{
EditorArguments = String.Format("-SCCProvider={0}", "None");
}
// Setup commandlet arguments for SCC.
string CommandletSCCArguments = String.Empty;
if (P4Enabled) { CommandletSCCArguments += (String.IsNullOrEmpty(CommandletSCCArguments) ? "" : " ") + "-EnableSCC"; }
if (!AllowSubmit) { CommandletSCCArguments += (String.IsNullOrEmpty(CommandletSCCArguments) ? "" : " ") + "-DisableSCCSubmit"; }
// Execute commandlet for each config in each project.
foreach (var ProjectInfo in ProjectInfos)
{
foreach (var LocalizationConfigFile in ProjectInfo.LocalizationConfigFiles)
{
var CommandletArguments = String.Format("-config={0}", LocalizationConfigFile) + (String.IsNullOrEmpty(CommandletSCCArguments) ? "" : " " + CommandletSCCArguments);
Log("Localization for {0} {1}", EditorArguments, CommandletArguments);
Log("Running UE4Editor to generate localization data");
string Arguments = String.Format("{0} -run=GatherText {1} {2}", UEProjectName, EditorArguments, CommandletArguments);
var RunResult = Run(EditorExe, Arguments);
if (RunResult.ExitCode != 0)
{
Console.WriteLine("[ERROR] Error while executing localization commandlet '{0}'", Arguments);
}
}
}
// Upload all text to OneSky
foreach (var ProjectInfo in ProjectInfos)
{
LocProvider.UploadProjectToLocalizationProvider(ProjectInfo.ProjectName, ProjectInfo.ExportInfo);
}
}
private ProjectInfo GenerateProjectInfo(string RootWorkingDirectory, string ProjectName)
{
var ProjectInfo = new ProjectInfo();
ProjectInfo.ProjectName = ProjectName;
ProjectInfo.LocalizationConfigFiles = new List<string>();
// Projects generated by the localization dashboard will use multiple config files that must be run in a specific order
// Older projects (such as the Engine) would use a single config file containing all the steps
// Work out which kind of project we're dealing with...
var MonolithicConfigFile = String.Format(@"Config/Localization/{0}.ini", ProjectName);
var IsMonolithicConfig = File.Exists(CombinePaths(RootWorkingDirectory, MonolithicConfigFile));
if (IsMonolithicConfig)
{
ProjectInfo.LocalizationConfigFiles.Add(MonolithicConfigFile);
ProjectInfo.ImportInfo = GenerateProjectImportExportInfo(RootWorkingDirectory, MonolithicConfigFile);
ProjectInfo.ExportInfo = ProjectInfo.ImportInfo;
}
else
{
var FileSuffixes = new[] {
new { Suffix = "Gather", Required = true },
new { Suffix = "Import", Required = true },
new { Suffix = "Export", Required = true },
new { Suffix = "Compile", Required = true },
new { Suffix = "GenerateReports", Required = false }
};
foreach (var FileSuffix in FileSuffixes)
{
var ModularConfigFile = String.Format(@"Config/Localization/{0}_{1}.ini", ProjectName, FileSuffix.Suffix);
if (File.Exists(CombinePaths(RootWorkingDirectory, ModularConfigFile)))
{
ProjectInfo.LocalizationConfigFiles.Add(ModularConfigFile);
if (FileSuffix.Suffix == "Import")
{
ProjectInfo.ImportInfo = GenerateProjectImportExportInfo(RootWorkingDirectory, ModularConfigFile);
}
else if (FileSuffix.Suffix == "Export")
{
ProjectInfo.ExportInfo = GenerateProjectImportExportInfo(RootWorkingDirectory, ModularConfigFile);
}
}
else if (FileSuffix.Required)
{
throw new AutomationException("Failed to find a required config file! '{0}'", ModularConfigFile);
}
}
}
return ProjectInfo;
}
private ProjectImportExportInfo GenerateProjectImportExportInfo(string RootWorkingDirectory, string LocalizationConfigFile)
{
var ProjectImportExportInfo = new ProjectImportExportInfo();
var LocalizationConfig = new ConfigCacheIni(new FileReference(CombinePaths(RootWorkingDirectory, LocalizationConfigFile)));
if (!LocalizationConfig.GetString("CommonSettings", "DestinationPath", out ProjectImportExportInfo.DestinationPath))
{
throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'DestinationPath', File: '{0}'", LocalizationConfigFile);
}
if (!LocalizationConfig.GetString("CommonSettings", "ManifestName", out ProjectImportExportInfo.ManifestName))
{
throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'ManifestName', File: '{0}'", LocalizationConfigFile);
}
if (!LocalizationConfig.GetString("CommonSettings", "ArchiveName", out ProjectImportExportInfo.ArchiveName))
{
throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'ArchiveName', File: '{0}'", LocalizationConfigFile);
}
if (!LocalizationConfig.GetString("CommonSettings", "PortableObjectName", out ProjectImportExportInfo.PortableObjectName))
{
throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'PortableObjectName', File: '{0}'", LocalizationConfigFile);
}
if (!LocalizationConfig.GetString("CommonSettings", "NativeCulture", out ProjectImportExportInfo.NativeCulture))
{
throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'NativeCulture', File: '{0}'", LocalizationConfigFile);
}
if (!LocalizationConfig.GetArray("CommonSettings", "CulturesToGenerate", out ProjectImportExportInfo.CulturesToGenerate))
{
throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'CulturesToGenerate', File: '{0}'", LocalizationConfigFile);
}
if (!LocalizationConfig.GetBool("CommonSettings", "bUseCultureDirectory", out ProjectImportExportInfo.bUseCultureDirectory))
{
// bUseCultureDirectory is optional, default is true
ProjectImportExportInfo.bUseCultureDirectory = true;
}
return ProjectImportExportInfo;
}
}