You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035 [CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
61 lines
1.9 KiB
C#
61 lines
1.9 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 EpicGames.Core;
|
|
using UnrealBuildBase;
|
|
|
|
/// <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 UnrealBuild object to get a list of the UAT and UBT build products
|
|
UnrealBuild Build = new UnrealBuild(this);
|
|
Build.AddUATFilesToBuildProducts();
|
|
Build.AddUBTFilesToBuildProducts();
|
|
|
|
// Get a list of all the input files
|
|
HashSet<FileReference> SourceFilesSet = new HashSet<FileReference>();
|
|
foreach(string BuildProductFile in Build.BuildProductFiles)
|
|
{
|
|
FileReference SourceFile = new FileReference(BuildProductFile);
|
|
SourceFilesSet.Add(SourceFile);
|
|
|
|
FileReference SourceSymbolFile = SourceFile.ChangeExtension(".pdb");
|
|
if(FileReference.Exists(SourceSymbolFile))
|
|
{
|
|
SourceFilesSet.Add(SourceSymbolFile);
|
|
}
|
|
|
|
FileReference DocumentationFile = SourceFile.ChangeExtension(".xml");
|
|
if(FileReference.Exists(DocumentationFile))
|
|
{
|
|
SourceFilesSet.Add(DocumentationFile);
|
|
}
|
|
}
|
|
|
|
// Copy all the files over
|
|
DirectoryReference TargetDir = new DirectoryReference(TargetDirParam);
|
|
List<FileReference> SourceFiles = SourceFilesSet.OrderBy(x => x.FullName).ToList();
|
|
CommandUtils.ThreadedCopyFiles(SourceFiles, Unreal.RootDirectory, TargetDir);
|
|
|
|
LogInformation("Copied {0} files to {1}", SourceFiles.Count, TargetDir);
|
|
File.WriteAllLines(Path.Combine(TargetDirParam, "CopiedFiles.txt"), SourceFiles.Select(F => F.FullName));
|
|
}
|
|
}
|