Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/ToolChain/UEToolChain.cs
Matthew Griffin d9f2a9fd85 Copying //UE4/Dev-Build to //UE4/Main
==========================
MAJOR FEATURES + CHANGES
==========================

Change 2864843 on 2016/02/12 by Ben.Marsh

	Add individual 'status', 'outcome', and 'error_code' fields to parsed jobsteps. Should fix grid view not being able to display 'pending' icons.

Change 2865161 on 2016/02/12 by Ben.Marsh

	Stop storing a reference to UEBuildTarget from UEBuildModule. It creates an awkward cyclic data dependency, and makes it easy for people to write lazy code that just reaches into the internal state of the build.

Change 2865643 on 2016/02/12 by Ben.Marsh

	Rename UEBuildModuleType to UHTModuleType, and move implementation into ExternalExecution.

Change 2874408 on 2016/02/19 by Ben.Marsh

	Automatically sort nodes in the dashboard grid view by a weight derived from the node's order in the build graph, summed across all the jobs in which it was present.

Change 2879572 on 2016/02/24 by Ben.Marsh

	Allow spoofing a Git merge from a given commit, using a changelist description containing the tag "git merge <branch> <changelist>", where <branch> is the name of a branch on Git (eg. master, 4.11, etc..), and <changelist> is the changelist being merged in.

Change 2883216 on 2016/02/26 by Ben.Marsh

	Prevent Jira tickets being incorrectly updated with 'Main CL' fields which are after the 'Fix CL' fields.

Change 2883755 on 2016/02/26 by Ben.Marsh

	Fix solution files having a Shipping configuration, even when -NoShippingConfigs is passed on the command line.

Change 2886223 on 2016/02/29 by Ben.Marsh

	Ignore SignTool errors - we can recover from them.

Change 2887414 on 2016/03/01 by Ben.Marsh

	Dump all the *.crash files produced while running commandlets, to make it easier to diagnose build system crashes cooking on Mac.

Change 2888235 on 2016/03/01 by Ben.Marsh

	Add overloads for methods in FileFilter which take FileReference and DirectoryReference objects.

Change 2889602 on 2016/03/02 by Ben.Marsh

	Treat shaders as code in UGS. Don't sync them as part of content-only syncs, and don't allow syncing past them without updated binaries.

Change 2889610 on 2016/03/02 by Ben.Marsh

	Fix setting for using incremental builds not being saved. Also hide command to do incremental builds if the 'use incremental builds' option is not checked.

Change 2891866 on 2016/03/03 by Matthew.Griffin

	Removed Rocket specific batch files and made sure installed build won't try to include them
	Removed last use of RocketGenerateProjectFiles.sh by using UBT directly instead

Change 2893349 on 2016/03/03 by Ben.Marsh

	Add derived ReplicatedBranch to support mirroring the VR editor branch to GitHub.

Change 2894703 on 2016/03/04 by Ben.Marsh

	Include *.usf when looking for the last code changelist. Also update version to 1.68.

Change 2897991 on 2016/03/07 by Ben.Marsh

	Copy the changelist number to the clipboard when the user presses Ctrl-C. Update version number to 1.69.

Change 2898005 on 2016/03/07 by Ben.Marsh

	Minor changes to support BuildGraph:

	* UE4Build now has a static function that can update version files.
	* Adding FileReference/DirectoryReference methods to FileFilter and CommandUtils.
	* FileFilter treats any pattern containing a slash as implictly starting from the root directory, unless it begins with "...".

Change 2898095 on 2016/03/07 by Ben.Marsh

	UAT - Don't retry builds if we're using local executor; we don't encounter failures due to timeouts.

Change 2898248 on 2016/03/07 by Ben.Marsh

	UBT - Add the standard game include paths back in to plugin modules. Existing game code relies on this.

Change 2898615 on 2016/03/08 by Matthew.Griffin

	Removed last uses of RunningRocket function
	All seemed to be overly cautious about people using an Installed build to do non standard things, don't see any ill effects in the most common circumstances.

Change 2898681 on 2016/03/08 by Matthew.Griffin

	Removed Automation.RunningRocket function as there are no more uses
	Changed the majority of comments referencing Rocket mode that are now either about the engine being installed or from the Launcher etc.

#lockdown Nick.Penwarden

[CL 2898813 by Matthew Griffin in Main branch]
2016-03-08 09:00:48 -05:00

159 lines
5.5 KiB
C#

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.IO;
using Microsoft.Win32;
namespace UnrealBuildTool
{
public abstract class UEToolChain
{
public readonly CPPTargetPlatform CppPlatform;
public UEToolChain(CPPTargetPlatform InCppPlatform)
{
CppPlatform = InCppPlatform;
}
public abstract CPPOutput CompileCPPFiles(UEBuildTarget Target, CPPEnvironment CompileEnvironment, List<FileItem> SourceFiles, string ModuleName);
public virtual CPPOutput CompileRCFiles(UEBuildTarget Target, CPPEnvironment Environment, List<FileItem> RCFiles)
{
CPPOutput Result = new CPPOutput();
return Result;
}
public abstract FileItem LinkFiles(LinkEnvironment LinkEnvironment, bool bBuildImportLibraryOnly);
public virtual FileItem[] LinkAllFiles(LinkEnvironment LinkEnvironment, bool bBuildImportLibraryOnly)
{
return new FileItem[] { LinkFiles(LinkEnvironment, bBuildImportLibraryOnly) };
}
public virtual void CompileCSharpProject(CSharpEnvironment CompileEnvironment, FileReference ProjectFileName, FileReference DestinationFile)
{
}
/// <summary>
/// Get the name of the response file for the current linker environment and output file
/// </summary>
/// <param name="LinkEnvironment"></param>
/// <param name="OutputFile"></param>
/// <returns></returns>
public static FileReference GetResponseFileName(LinkEnvironment LinkEnvironment, FileItem OutputFile)
{
// Construct a relative path for the intermediate response file
return FileReference.Combine(LinkEnvironment.Config.IntermediateDirectory, OutputFile.Reference.GetFileName() + ".response");
}
/// <summary>
/// Converts the passed in path from UBT host to compiler native format.
/// </summary>
public virtual String ConvertPath(String OriginalPath)
{
return OriginalPath;
}
/// <summary>
/// Called immediately after UnrealHeaderTool is executed to generated code for all UObjects modules. Only is called if UnrealHeaderTool was actually run in this session.
/// </summary>
/// <param name="Manifest">List of UObject modules we generated code for.</param>
public virtual void PostCodeGeneration(UHTManifest Manifest)
{
}
public virtual void PreBuildSync()
{
}
public virtual void PostBuildSync(UEBuildTarget Target)
{
}
public virtual ICollection<FileItem> PostBuild(FileItem Executable, LinkEnvironment ExecutableLinkEnvironment)
{
return new List<FileItem>();
}
public virtual void SetUpGlobalEnvironment()
{
ParseProjectSettings();
}
public virtual void ParseProjectSettings()
{
}
protected void RunUnrealHeaderToolIfNeeded()
{
}
public virtual void ModifyBuildProducts(UEBuildBinary Binary, Dictionary<FileReference, BuildProductType> BuildProducts)
{
}
/// <summary>
/// Adds a build product and its associated debug file to a receipt.
/// </summary>
/// <param name="OutputFile">Build product to add</param>
/// <param name="DebugExtension">Extension for the matching debug file (may be null).</param>
public virtual bool ShouldAddDebugFileToReceipt(FileReference OutputFile, BuildProductType OutputType)
{
return true;
}
protected void AddPrerequisiteSourceFile(UEBuildTarget Target, UEBuildPlatform BuildPlatform, CPPEnvironment CompileEnvironment, FileItem SourceFile, List<FileItem> PrerequisiteItems)
{
PrerequisiteItems.Add(SourceFile);
RemoteToolChain RemoteThis = this as RemoteToolChain;
bool bAllowUploading = RemoteThis != null && BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac; // Don't use remote features when compiling from a Mac
if (bAllowUploading)
{
RemoteThis.QueueFileForBatchUpload(SourceFile);
}
if (!BuildConfiguration.bUseUBTMakefiles) // In fast build iteration mode, we'll gather includes later on
{
// @todo ubtmake: What if one of the prerequisite files has become missing since it was updated in our cache? (usually, because a coder eliminated the source file)
// -> Two CASES:
// 1) NOT WORKING: Non-unity file went away (SourceFile in this context). That seems like an existing old use case. Compile params or Response file should have changed?
// 2) WORKING: Indirect file went away (unity'd original source file or include). This would return a file that no longer exists and adds to the prerequiteitems list
List<FileItem> IncludedFileList = CPPEnvironment.FindAndCacheAllIncludedFiles(Target, SourceFile, BuildPlatform, CompileEnvironment.Config.CPPIncludeInfo, bOnlyCachedDependencies: BuildConfiguration.bUseUBTMakefiles);
if (IncludedFileList != null)
{
foreach (FileItem IncludedFile in IncludedFileList)
{
PrerequisiteItems.Add(IncludedFile);
if (bAllowUploading &&
!BuildConfiguration.bUseUBTMakefiles) // With fast dependency scanning, we will not have an exhaustive list of dependencies here. We rely on PostCodeGeneration() to upload these files.
{
RemoteThis.QueueFileForBatchUpload(IncludedFile);
}
}
}
}
}
public virtual void SetupBundleDependencies(List<UEBuildBinary> Binaries, string GameName)
{
}
public virtual void FixBundleBinariesPaths(UEBuildTarget Target, List<UEBuildBinary> Binaries)
{
}
public virtual void StripSymbols(string SourceFileName, string TargetFileName)
{
Log.TraceWarning("StripSymbols() has not been implemented for {0}; copying files", CppPlatform.ToString());
File.Copy(SourceFileName, TargetFileName, true);
}
};
}