Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/CopyUAT.Automation.cs
Joakim Lindqvist e7039d3d35 UBT and UAT now use .NET Core instead of Framework and Mono. This means that we use the same runtime on Windows, Linux and Mac. Further benefits including newer C# features and a lot of intresting features for the future around AOT and Tiered compilation.
Some behavior changes:
Output paths - Both tools are now output to a subdirectory of Binaries/Dotnet, I believe most hardcoded paths have been fixed up but there may be tools that will fail because of this.
UAT Plugin Building - As .NET Core does not support AppDomain unloading, how we build the plugins has changed quite a bit, these are now built before UAT is started rather then by UAT itself. If you just start UAT via RunUAT.bat/sh this should just continue to work.

#rb ben.marsh

[CL 14834347 by Joakim Lindqvist in ue5-main branch]
2020-12-02 06:57:13 -04:00

64 lines
2.0 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using AutomationTool;
using UnrealBuildTool;
using Tools.DotNETCommon;
/// <summary>
/// Copies all UAT and UBT build products to a directory
/// </summary>
public class CopyUAT : BuildCommand
{
public override void ExecuteBuild()
{
// Get the output directory
string TargetDirParam = ParseParamValue("TargetDir");
if(TargetDirParam == null)
{
throw new AutomationException("Missing -TargetDir=... argument to CopyUAT");
}
// Construct a dummy UE4Build object to get a list of the UAT and UBT build products
UE4Build Build = new UE4Build(this);
Build.AddUATFilesToBuildProducts();
Build.AddUBTFilesToBuildProducts();
// Get a list of all the input files
List<FileReference> SourceFiles = new List<FileReference>();
foreach(string BuildProductFile in Build.BuildProductFiles)
{
FileReference SourceFile = new FileReference(BuildProductFile);
SourceFiles.Add(SourceFile);
FileReference SourceSymbolFile = SourceFile.ChangeExtension(".pdb");
if(FileReference.Exists(SourceSymbolFile))
{
SourceFiles.Add(SourceSymbolFile);
}
FileReference DocumentationFile = SourceFile.ChangeExtension(".xml");
if(FileReference.Exists(DocumentationFile))
{
SourceFiles.Add(DocumentationFile);
}
}
// Copy all the files over
DirectoryReference TargetDir = new DirectoryReference(TargetDirParam);
foreach(FileReference SourceFile in SourceFiles)
{
FileReference TargetFile = FileReference.Combine(TargetDir, SourceFile.MakeRelativeTo(CommandUtils.RootDirectory));
DirectoryReference.CreateDirectory(TargetFile.Directory);
CommandUtils.CopyFile(SourceFile.FullName, TargetFile.FullName);
}
LogInformation("Copied {0} files to {1}", SourceFiles.Count, TargetDir);
File.WriteAllLines(Path.Combine(TargetDirParam, "CopiedFiles.txt"), SourceFiles.Select(F => F.FullName));
}
}