2016-12-08 08:52:44 -05:00
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
2014-04-23 18:32:52 -04:00
# include "DesktopPlatformBase.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
# include "HAL/FileManager.h"
# include "Misc/FileHelper.h"
# include "Misc/Paths.h"
# include "Misc/Guid.h"
# include "Misc/ConfigCacheIni.h"
# include "Misc/FeedbackContext.h"
# include "Misc/App.h"
# include "Misc/EngineVersion.h"
# include "Serialization/JsonTypes.h"
# include "Serialization/JsonReader.h"
# include "Serialization/JsonSerializer.h"
# include "Modules/ModuleManager.h"
2014-09-25 18:48:22 -04:00
2014-05-13 18:23:53 -04:00
# define LOCTEXT_NAMESPACE "DesktopPlatform"
2014-04-23 18:32:52 -04:00
2014-09-25 18:48:22 -04:00
2014-05-14 15:20:39 -04:00
FDesktopPlatformBase : : FDesktopPlatformBase ( )
{
LauncherInstallationTimestamp = FDateTime : : MinValue ( ) ;
}
2014-06-04 19:07:11 -04:00
FString FDesktopPlatformBase : : GetEngineDescription ( const FString & Identifier )
{
// Official release versions just have a version number
if ( IsStockEngineRelease ( Identifier ) )
{
return Identifier ;
}
// Otherwise get the path
FString RootDir ;
if ( ! GetEngineRootDirFromIdentifier ( Identifier , RootDir ) )
{
return FString ( ) ;
}
// Convert it to a platform directory
FString PlatformRootDir = RootDir ;
FPaths : : MakePlatformFilename ( PlatformRootDir ) ;
// Perforce build
if ( IsSourceDistribution ( RootDir ) )
{
return FString : : Printf ( TEXT ( " Source build at %s " ) , * PlatformRootDir ) ;
}
else
{
return FString : : Printf ( TEXT ( " Binary build at %s " ) , * PlatformRootDir ) ;
}
}
2014-04-23 18:32:52 -04:00
FString FDesktopPlatformBase : : GetCurrentEngineIdentifier ( )
{
2014-05-13 18:23:53 -04:00
if ( CurrentEngineIdentifier . Len ( ) = = 0 & & ! GetEngineIdentifierFromRootDir ( FPlatformMisc : : RootDir ( ) , CurrentEngineIdentifier ) )
{
CurrentEngineIdentifier . Empty ( ) ;
}
return CurrentEngineIdentifier ;
2014-04-23 18:32:52 -04:00
}
2014-04-23 18:46:48 -04:00
void FDesktopPlatformBase : : EnumerateLauncherEngineInstallations ( TMap < FString , FString > & OutInstallations )
{
2014-05-14 15:20:39 -04:00
// Cache the launcher install list if necessary
ReadLauncherInstallationList ( ) ;
// We've got a list of launcher installations. Filter it by the engine installations.
for ( TMap < FString , FString > : : TConstIterator Iter ( LauncherInstallationList ) ; Iter ; + + Iter )
2014-05-08 08:20:34 -04:00
{
2014-05-14 15:20:39 -04:00
FString AppName = Iter . Key ( ) ;
if ( AppName . RemoveFromStart ( TEXT ( " UE_ " ) , ESearchCase : : CaseSensitive ) )
2014-05-08 08:20:34 -04:00
{
2014-05-14 15:20:39 -04:00
OutInstallations . Add ( AppName , Iter . Value ( ) ) ;
2014-05-08 08:20:34 -04:00
}
}
2014-04-23 18:46:48 -04:00
}
2014-05-13 19:34:00 -04:00
void FDesktopPlatformBase : : EnumerateLauncherSampleInstallations ( TArray < FString > & OutInstallations )
{
2014-05-14 15:20:39 -04:00
// Cache the launcher install list if necessary
ReadLauncherInstallationList ( ) ;
// We've got a list of launcher installations. Filter it by the engine installations.
for ( TMap < FString , FString > : : TConstIterator Iter ( LauncherInstallationList ) ; Iter ; + + Iter )
2014-05-13 19:34:00 -04:00
{
2014-05-14 15:20:39 -04:00
FString AppName = Iter . Key ( ) ;
if ( ! AppName . StartsWith ( TEXT ( " UE_ " ) , ESearchCase : : CaseSensitive ) )
2014-05-13 19:34:00 -04:00
{
2014-05-14 15:20:39 -04:00
OutInstallations . Add ( Iter . Value ( ) ) ;
2014-05-13 19:34:00 -04:00
}
}
}
2014-06-04 18:06:57 -04:00
void FDesktopPlatformBase : : EnumerateLauncherSampleProjects ( TArray < FString > & OutFileNames )
{
// Enumerate all the sample installation directories
TArray < FString > LauncherSampleDirectories ;
EnumerateLauncherSampleInstallations ( LauncherSampleDirectories ) ;
// Find all the project files within them
for ( int32 Idx = 0 ; Idx < LauncherSampleDirectories . Num ( ) ; Idx + + )
{
TArray < FString > FileNames ;
IFileManager : : Get ( ) . FindFiles ( FileNames , * ( LauncherSampleDirectories [ Idx ] / TEXT ( " *.uproject " ) ) , true , false ) ;
OutFileNames . Append ( FileNames ) ;
}
}
2014-04-23 18:32:52 -04:00
bool FDesktopPlatformBase : : GetEngineRootDirFromIdentifier ( const FString & Identifier , FString & OutRootDir )
{
// Get all the installations
TMap < FString , FString > Installations ;
EnumerateEngineInstallations ( Installations ) ;
// Find the one with the right identifier
for ( TMap < FString , FString > : : TConstIterator Iter ( Installations ) ; Iter ; + + Iter )
{
if ( Iter - > Key = = Identifier )
{
OutRootDir = Iter - > Value ;
return true ;
}
}
return false ;
}
bool FDesktopPlatformBase : : GetEngineIdentifierFromRootDir ( const FString & RootDir , FString & OutIdentifier )
{
// Get all the installations
TMap < FString , FString > Installations ;
EnumerateEngineInstallations ( Installations ) ;
// Normalize the root directory
FString NormalizedRootDir = RootDir ;
2015-01-09 08:11:29 -05:00
FPaths : : CollapseRelativeDirectories ( NormalizedRootDir ) ;
2014-04-23 18:32:52 -04:00
FPaths : : NormalizeDirectoryName ( NormalizedRootDir ) ;
// Find the label for the given directory
for ( TMap < FString , FString > : : TConstIterator Iter ( Installations ) ; Iter ; + + Iter )
{
if ( Iter - > Value = = NormalizedRootDir )
{
OutIdentifier = Iter - > Key ;
return true ;
}
}
2014-05-06 10:27:35 -04:00
// Otherwise just try to add it
return RegisterEngineInstallation ( RootDir , OutIdentifier ) ;
2014-04-23 18:32:52 -04:00
}
2014-04-23 18:46:48 -04:00
bool FDesktopPlatformBase : : GetDefaultEngineIdentifier ( FString & OutId )
{
TMap < FString , FString > Installations ;
EnumerateEngineInstallations ( Installations ) ;
bool bRes = false ;
if ( Installations . Num ( ) > 0 )
{
// Default to the first install
TMap < FString , FString > : : TConstIterator Iter ( Installations ) ;
OutId = Iter . Key ( ) ;
+ + Iter ;
// Try to find the most preferred install
for ( ; Iter ; + + Iter )
{
if ( IsPreferredEngineIdentifier ( Iter . Key ( ) , OutId ) )
{
OutId = Iter . Key ( ) ;
}
}
}
return bRes ;
}
bool FDesktopPlatformBase : : GetDefaultEngineRootDir ( FString & OutDirName )
{
FString Identifier ;
return GetDefaultEngineIdentifier ( Identifier ) & & GetEngineRootDirFromIdentifier ( Identifier , OutDirName ) ;
}
bool FDesktopPlatformBase : : IsPreferredEngineIdentifier ( const FString & Identifier , const FString & OtherIdentifier )
{
int32 Version = ParseReleaseVersion ( Identifier ) ;
int32 OtherVersion = ParseReleaseVersion ( OtherIdentifier ) ;
if ( Version ! = OtherVersion )
{
return Version > OtherVersion ;
}
else
{
return Identifier > OtherIdentifier ;
}
}
2015-07-10 15:21:32 -04:00
bool FDesktopPlatformBase : : TryGetEngineVersion ( const FString & RootDir , FEngineVersion & OutVersion )
{
// Read the file to a string
FString VersionText ;
if ( FFileHelper : : LoadFileToString ( VersionText , * ( RootDir / TEXT ( " Engine/Build/Build.version " ) ) ) )
{
// Deserialize a JSON object from the string
TSharedPtr < FJsonObject > Object ;
TSharedRef < TJsonReader < > > Reader = TJsonReaderFactory < > : : Create ( VersionText ) ;
if ( FJsonSerializer : : Deserialize ( Reader , Object ) & & Object . IsValid ( ) )
{
int32 MajorVersion = 0 ;
int32 MinorVersion = 0 ;
int32 PatchVersion = 0 ;
if ( Object - > TryGetNumberField ( TEXT ( " MajorVersion " ) , MajorVersion ) & & Object - > TryGetNumberField ( TEXT ( " MinorVersion " ) , MinorVersion ) & & Object - > TryGetNumberField ( TEXT ( " PatchVersion " ) , PatchVersion ) )
{
int32 Changelist = 0 ;
if ( ! Object - > TryGetNumberField ( TEXT ( " Changelist " ) , Changelist ) )
{
Changelist = 0 ;
}
int32 IsLicenseeVersion = 0 ;
if ( ! Object - > TryGetNumberField ( TEXT ( " IsLicenseeVersion " ) , IsLicenseeVersion ) )
{
IsLicenseeVersion = 0 ;
}
FString BranchName ;
if ( ! Object - > TryGetStringField ( TEXT ( " BranchName " ) , BranchName ) )
{
BranchName = FString ( ) ;
}
int EncodedChangelist = ( IsLicenseeVersion = = 0 ) ? Changelist : FEngineVersionBase : : EncodeLicenseeChangelist ( Changelist ) ;
OutVersion = FEngineVersion ( MajorVersion , MinorVersion , PatchVersion , EncodedChangelist , BranchName ) ;
return true ;
}
}
}
// Try to read the version file
FString VersionHeader ;
if ( FFileHelper : : LoadFileToString ( VersionHeader , * ( RootDir / TEXT ( " Engine/Source/Runtime/Launch/Resources/Version.h " ) ) ) )
{
int32 MajorVersion = - 1 ;
int32 MinorVersion = - 1 ;
int32 PatchVersion = - 1 ;
int32 Changelist = 0 ;
int32 IsLicenseeVersion = 0 ;
FString BranchName ;
// Scan the file for version defines
const TCHAR * TextPos = * VersionHeader ;
while ( * TextPos )
{
// Skip over any newlines
while ( FChar : : IsWhitespace ( * TextPos ) )
{
TextPos + + ;
}
// Buffer up a line of tokens
TArray < FString > Tokens ;
while ( * TextPos ! = ' \n ' & & * TextPos ! = 0 )
{
if ( * TextPos = = ' ' | | * TextPos = = ' \t ' | | * TextPos = = ' \r ' )
{
// Skip over whitespace
TextPos + + ;
}
else if ( FChar : : IsIdentifier ( * TextPos ) )
{
// Parse an identifier. Exact C rules for an identifier don't really matter; we just need alphanumeric sequences.
const TCHAR * TokenStart = TextPos + + ;
while ( FChar : : IsIdentifier ( * TextPos ) ) TextPos + + ;
Tokens . Add ( FString ( TextPos - TokenStart , TokenStart ) ) ;
}
else if ( * TextPos = = ' \" ' )
{
// Parse a string
const TCHAR * TokenStart = TextPos + + ;
while ( * TextPos ! = 0 & & ( TextPos = = TokenStart + 1 | | * ( TextPos - 1 ) ! = ' \" ' ) ) TextPos + + ;
Tokens . Add ( FString ( TextPos - TokenStart , TokenStart ) ) ;
}
else if ( * TextPos = = ' / ' & & * ( TextPos + 1 ) = = ' / ' )
{
// Skip a C++ style comment
TextPos + = 2 ;
while ( * TextPos ! = ' \n ' & & * TextPos ! = 0 ) TextPos + + ;
}
else if ( * TextPos = = ' / ' & & * ( TextPos + 1 ) = = ' * ' & & * ( TextPos + 2 ) ! = 0 & & * ( TextPos + 3 ) ! = 0 )
{
// Skip a C-style comment
TextPos + = 4 ;
while ( * TextPos ! = 0 & & ( * ( TextPos - 2 ) ! = ' * ' | | * ( TextPos - 1 ) ! = ' / ' ) ) TextPos + + ;
}
else
{
// Take a single symbol character
Tokens . Add ( FString ( 1 , TextPos ) ) ;
TextPos + + ;
}
}
// Check if it matches any version defines
if ( Tokens . Num ( ) > = 4 & & Tokens [ 0 ] = = " # " & & Tokens [ 1 ] = = " define " )
{
if ( FChar : : IsDigit ( Tokens [ 3 ] [ 0 ] ) )
{
if ( Tokens [ 2 ] = = " ENGINE_MAJOR_VERSION " )
{
MajorVersion = FCString : : Atoi ( * Tokens [ 3 ] ) ;
}
else if ( Tokens [ 2 ] = = " ENGINE_MINOR_VERSION " )
{
MinorVersion = FCString : : Atoi ( * Tokens [ 3 ] ) ;
}
else if ( Tokens [ 2 ] = = " ENGINE_PATCH_VERSION " )
{
PatchVersion = FCString : : Atoi ( * Tokens [ 3 ] ) ;
}
2015-07-18 16:57:53 -04:00
else if ( Tokens [ 2 ] = = " BUILT_FROM_CHANGELIST " )
2015-07-10 15:21:32 -04:00
{
Changelist = FCString : : Atoi ( * Tokens [ 3 ] ) ;
}
else if ( Tokens [ 2 ] = = " ENGINE_IS_LICENSEE_VERSION " )
{
IsLicenseeVersion = FCString : : Atoi ( * Tokens [ 3 ] ) ;
}
}
else if ( Tokens [ 3 ] . StartsWith ( " \" " ) & & Tokens [ 3 ] . EndsWith ( " \" " ) )
{
if ( Tokens [ 2 ] = = " BRANCH_NAME " )
{
BranchName = Tokens [ 3 ] . TrimQuotes ( ) ;
}
}
}
}
// If we have everything we need, fill in the version struct
if ( MajorVersion ! = - 1 & & MinorVersion ! = - 1 & & PatchVersion ! = - 1 )
{
int EncodedChangelist = ( IsLicenseeVersion = = 0 ) ? Changelist : FEngineVersionBase : : EncodeLicenseeChangelist ( Changelist ) ;
OutVersion = FEngineVersion ( MajorVersion , MinorVersion , PatchVersion , EncodedChangelist , BranchName ) ;
return true ;
}
}
return false ;
}
2014-05-13 18:23:53 -04:00
bool FDesktopPlatformBase : : IsStockEngineRelease ( const FString & Identifier )
{
2014-08-27 15:29:01 -04:00
FGuid Guid ;
return ! FGuid : : Parse ( Identifier , Guid ) ;
2014-05-13 18:23:53 -04:00
}
2015-04-17 06:35:39 -04:00
bool FDesktopPlatformBase : : TryParseStockEngineVersion ( const FString & Identifier , FEngineVersion & OutVersion )
{
TCHAR * End ;
uint64 Major = FCString : : Strtoui64 ( * Identifier , & End , 10 ) ;
if ( Major > MAX_uint16 | | * ( End + + ) ! = ' . ' )
{
return false ;
}
uint64 Minor = FCString : : Strtoui64 ( End , & End , 10 ) ;
if ( Minor > MAX_uint16 | | * End ! = 0 )
{
return false ;
}
OutVersion = FEngineVersion ( Major , Minor , 0 , 0 , TEXT ( " " ) ) ;
return true ;
}
2014-04-23 18:46:48 -04:00
bool FDesktopPlatformBase : : IsSourceDistribution ( const FString & EngineRootDir )
{
// Check for the existence of a SourceBuild.txt file
2014-04-23 18:59:02 -04:00
FString SourceBuildPath = EngineRootDir / TEXT ( " Engine/Build/SourceDistribution.txt " ) ;
2014-04-23 18:46:48 -04:00
return ( IFileManager : : Get ( ) . FileSize ( * SourceBuildPath ) > = 0 ) ;
}
bool FDesktopPlatformBase : : IsPerforceBuild ( const FString & EngineRootDir )
{
// Check for the existence of a SourceBuild.txt file
2014-04-23 18:59:02 -04:00
FString PerforceBuildPath = EngineRootDir / TEXT ( " Engine/Build/PerforceBuild.txt " ) ;
2014-04-23 18:46:48 -04:00
return ( IFileManager : : Get ( ) . FileSize ( * PerforceBuildPath ) > = 0 ) ;
}
bool FDesktopPlatformBase : : IsValidRootDirectory ( const FString & RootDir )
{
2014-08-01 11:32:55 -04:00
// Check that there's an Engine\Binaries directory underneath the root
2014-04-23 18:46:48 -04:00
FString EngineBinariesDirName = RootDir / TEXT ( " Engine/Binaries " ) ;
FPaths : : NormalizeDirectoryName ( EngineBinariesDirName ) ;
2014-08-01 11:32:55 -04:00
if ( ! IFileManager : : Get ( ) . DirectoryExists ( * EngineBinariesDirName ) )
{
return false ;
}
// Also check there's an Engine\Build directory. This will filter out anything that has an engine-like directory structure but doesn't allow building code projects - like the launcher.
FString EngineBuildDirName = RootDir / TEXT ( " Engine/Build " ) ;
FPaths : : NormalizeDirectoryName ( EngineBuildDirName ) ;
if ( ! IFileManager : : Get ( ) . DirectoryExists ( * EngineBuildDirName ) )
{
return false ;
}
// Otherwise it's valid
return true ;
2014-04-23 18:46:48 -04:00
}
2014-05-06 10:27:35 -04:00
bool FDesktopPlatformBase : : SetEngineIdentifierForProject ( const FString & ProjectFileName , const FString & InIdentifier )
2014-04-23 18:46:48 -04:00
{
2014-05-06 10:27:35 -04:00
// Load the project file
2014-04-23 18:46:48 -04:00
TSharedPtr < FJsonObject > ProjectFile = LoadProjectFile ( ProjectFileName ) ;
if ( ! ProjectFile . IsValid ( ) )
{
return false ;
}
2014-05-06 10:27:35 -04:00
// Check if the project is a non-foreign project of the given engine installation. If so, blank the identifier
// string to allow portability between source control databases. GetEngineIdentifierForProject will translate
// the association back into a local identifier on other machines or syncs.
FString Identifier = InIdentifier ;
if ( Identifier . Len ( ) > 0 )
{
FString RootDir ;
if ( GetEngineRootDirFromIdentifier ( Identifier , RootDir ) )
{
2014-05-13 18:23:53 -04:00
const FUProjectDictionary & Dictionary = GetCachedProjectDictionary ( RootDir ) ;
2014-05-06 10:27:35 -04:00
if ( ! Dictionary . IsForeignProject ( ProjectFileName ) )
{
Identifier . Empty ( ) ;
}
}
}
// Set the association on the project and save it
2014-04-23 18:46:48 -04:00
ProjectFile - > SetStringField ( TEXT ( " EngineAssociation " ) , Identifier ) ;
return SaveProjectFile ( ProjectFileName , ProjectFile ) ;
}
2015-01-09 08:11:29 -05:00
bool FDesktopPlatformBase : : GetEngineIdentifierForProject ( const FString & ProjectFileName , FString & OutIdentifier )
2014-04-23 18:46:48 -04:00
{
2014-06-10 10:27:47 -04:00
OutIdentifier . Empty ( ) ;
2014-05-06 10:27:35 -04:00
// Load the project file
2014-04-23 18:46:48 -04:00
TSharedPtr < FJsonObject > ProjectFile = LoadProjectFile ( ProjectFileName ) ;
if ( ! ProjectFile . IsValid ( ) )
{
return false ;
}
2014-06-10 10:27:47 -04:00
// Try to read the identifier from it
TSharedPtr < FJsonValue > Value = ProjectFile - > TryGetField ( TEXT ( " EngineAssociation " ) ) ;
if ( Value . IsValid ( ) & & Value - > Type = = EJson : : String )
2014-05-06 10:27:35 -04:00
{
2014-06-10 10:27:47 -04:00
OutIdentifier = Value - > AsString ( ) ;
if ( OutIdentifier . Len ( ) > 0 )
{
2015-01-09 08:11:29 -05:00
// If it's a path, convert it into an engine identifier
if ( OutIdentifier . Contains ( TEXT ( " / " ) ) | | OutIdentifier . Contains ( " \\ " ) )
{
FString EngineRootDir = FPaths : : ConvertRelativePathToFull ( FPaths : : GetPath ( ProjectFileName ) , OutIdentifier ) ;
if ( ! GetEngineIdentifierFromRootDir ( EngineRootDir , OutIdentifier ) )
{
return false ;
}
}
2014-06-10 10:27:47 -04:00
return true ;
}
2014-05-06 10:27:35 -04:00
}
2014-05-15 13:07:56 -04:00
// Otherwise scan up through the directory hierarchy to find an installation
2014-05-06 10:27:35 -04:00
FString ParentDir = FPaths : : GetPath ( ProjectFileName ) ;
FPaths : : NormalizeDirectoryName ( ParentDir ) ;
2014-05-15 13:07:56 -04:00
// Keep going until we reach the root
2014-05-06 10:27:35 -04:00
int32 SeparatorIdx ;
while ( ParentDir . FindLastChar ( TEXT ( ' / ' ) , SeparatorIdx ) )
{
ParentDir . RemoveAt ( SeparatorIdx , ParentDir . Len ( ) - SeparatorIdx ) ;
2014-05-15 13:07:56 -04:00
if ( IsValidRootDirectory ( ParentDir ) & & GetEngineIdentifierFromRootDir ( ParentDir , OutIdentifier ) )
2014-05-06 10:27:35 -04:00
{
return true ;
}
}
2014-05-13 18:23:53 -04:00
// Otherwise check the engine version string for 4.0, in case this project existed before the engine association stuff went in
FString EngineVersionString = ProjectFile - > GetStringField ( TEXT ( " EngineVersion " ) ) ;
if ( EngineVersionString . Len ( ) > 0 )
{
FEngineVersion EngineVersion ;
2015-06-26 09:25:56 -04:00
if ( FEngineVersion : : Parse ( EngineVersionString , EngineVersion ) & & EngineVersion . HasChangelist ( ) & & EngineVersion . ToString ( EVersionComponent : : Minor ) = = TEXT ( " 4.0 " ) )
2014-05-13 18:23:53 -04:00
{
OutIdentifier = TEXT ( " 4.0 " ) ;
return true ;
}
}
2014-05-06 10:27:35 -04:00
return false ;
2014-04-23 18:46:48 -04:00
}
2014-06-18 13:42:01 -04:00
bool FDesktopPlatformBase : : OpenProject ( const FString & ProjectFileName )
{
FPlatformProcess : : LaunchFileInDefaultExternalApplication ( * ProjectFileName ) ;
return true ;
}
2014-07-22 15:58:02 -04:00
bool FDesktopPlatformBase : : CleanGameProject ( const FString & ProjectDir , FString & OutFailPath , FFeedbackContext * Warn )
2014-05-14 19:11:30 -04:00
{
// Begin a task
Warn - > BeginSlowTask ( LOCTEXT ( " CleaningProject " , " Removing stale build products... " ) , true ) ;
// Enumerate all the files
TArray < FString > FileNames ;
2014-05-29 17:45:17 -04:00
TArray < FString > DirectoryNames ;
GetProjectBuildProducts ( ProjectDir , FileNames , DirectoryNames ) ;
2014-05-14 19:11:30 -04:00
// Remove all the files
for ( int32 Idx = 0 ; Idx < FileNames . Num ( ) ; Idx + + )
{
// Remove the file
if ( ! IFileManager : : Get ( ) . Delete ( * FileNames [ Idx ] ) )
{
2014-07-22 15:58:02 -04:00
OutFailPath = FileNames [ Idx ] ;
Warn - > EndSlowTask ( ) ;
2014-05-14 19:11:30 -04:00
return false ;
}
2014-05-29 17:45:17 -04:00
// Update the progress
Warn - > UpdateProgress ( Idx , FileNames . Num ( ) + DirectoryNames . Num ( ) ) ;
}
// Remove all the directories
for ( int32 Idx = 0 ; Idx < DirectoryNames . Num ( ) ; Idx + + )
{
// Remove the directory
if ( ! IFileManager : : Get ( ) . DeleteDirectory ( * DirectoryNames [ Idx ] , false , true ) )
2014-05-14 19:11:30 -04:00
{
2014-07-22 15:58:02 -04:00
OutFailPath = DirectoryNames [ Idx ] ;
Warn - > EndSlowTask ( ) ;
2014-05-29 17:45:17 -04:00
return false ;
2014-05-14 19:11:30 -04:00
}
// Update the progress
2014-05-29 17:45:17 -04:00
Warn - > UpdateProgress ( Idx + FileNames . Num ( ) , FileNames . Num ( ) + DirectoryNames . Num ( ) ) ;
2014-05-14 19:11:30 -04:00
}
// End the task
Warn - > EndSlowTask ( ) ;
return true ;
}
2014-05-13 18:23:53 -04:00
bool FDesktopPlatformBase : : CompileGameProject ( const FString & RootDir , const FString & ProjectFileName , FFeedbackContext * Warn )
{
2014-10-06 10:59:41 -04:00
// Get the project directory
FString ProjectDir = FPaths : : GetPath ( ProjectFileName ) ;
// Get the target name. By default it'll be the same as the project name, but that might not be the case if the project was renamed.
FString TargetName = FPaths : : GetBaseFilename ( ProjectFileName ) ;
if ( ! FPaths : : FileExists ( ProjectDir / FString : : Printf ( TEXT ( " Source/%sEditor.Target.cs " ) , * TargetName ) ) )
{
// Find all the target files
TArray < FString > TargetFiles ;
IFileManager : : Get ( ) . FindFilesRecursive ( TargetFiles , * ( ProjectDir / TEXT ( " Source " ) ) , TEXT ( " *.target.cs " ) , true , false , false ) ;
// Try to find a target that's clearly meant to be the editor. If there isn't one, let UBT fail with a sensible message without trying to do anything else smart.
for ( const FString TargetFile : TargetFiles )
{
if ( TargetFile . EndsWith ( " Editor.Target.cs " ) )
{
TargetName = FPaths : : GetBaseFilename ( FPaths : : GetBaseFilename ( TargetFile ) ) ;
break ;
}
}
}
// Build the argument list
FString Arguments = FString : : Printf ( TEXT ( " %s %s %s " ) , * TargetName , FModuleManager : : Get ( ) . GetUBTConfiguration ( ) , FPlatformMisc : : GetUBTPlatform ( ) ) ;
2014-05-13 18:23:53 -04:00
// Append the project name if it's a foreign project
if ( ! ProjectFileName . IsEmpty ( ) )
{
FUProjectDictionary ProjectDictionary ( RootDir ) ;
if ( ProjectDictionary . IsForeignProject ( ProjectFileName ) )
{
Arguments + = FString : : Printf ( TEXT ( " -project= \" %s \" " ) , * IFileManager : : Get ( ) . ConvertToAbsolutePathForExternalAppForRead ( * ProjectFileName ) ) ;
}
}
// Append any other options
Copying //UE4/Dev-Platform to //UE4/Dev-Main (Source: //UE4/Dev-Platform @ 3206916)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3175510 on 2016/10/26 by Josh.Adams
- New Wolf SDK support (11).
- Added new input plugin now that extra NDA is lifted
Change 3176629 on 2016/10/27 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
Change 3177232 on 2016/10/27 by Josh.Adams
- Minor comment change
Change 3177348 on 2016/10/27 by Dmitry.Rekman
Linux: default to GL4.
Change 3177523 on 2016/10/27 by Dmitry.Rekman
Linux: update libc++ to 3.9 and add AArch64.
Change 3178208 on 2016/10/28 by Daniel.Lamb
Enable multithreaded lightmap encoding.
Change 3178273 on 2016/10/28 by Luke.Thatcher
[PLATFORM] [PS4] [!] Fix crash in PS4 packaging step.
- Parallel-for accessing the same log files, causing IOException.
Change 3178573 on 2016/10/28 by Dmitry.Rekman
Linux: fix for projects not having proper version associations (UE-5954).
- Fixed by CengizT.
Change 3180487 on 2016/10/31 by Josh.Adams
Moved new file to peoper spot
Change 3180508 on 2016/10/31 by Josh.Adams
- Fixed crash on audio free for Wolf
Change 3181821 on 2016/11/01 by Josh.Adams
- Fixed ShooterGame cooking after sync from main
Change 3182469 on 2016/11/01 by Josh.Adams
- test/shipping build wolf fixes
Change 3183078 on 2016/11/02 by Josh.Adams
- Added AllDesktop back in for Windows (File | Package)
Change 3183229 on 2016/11/02 by Josh.Adams
- Fixed wrong path in JunkManifest.txt
Change 3184245 on 2016/11/02 by Dmitry.Rekman
Linux: add AArch64 (ARM64) libs.
Change 3184326 on 2016/11/02 by Dmitry.Rekman
Linux: add more files for AArch64.
Change 3184353 on 2016/11/02 by Dmitry.Rekman
Linux: Add missed AArch64 libpng.
Change 3184871 on 2016/11/03 by Luke.Thatcher
[PLATFORM] [PS4] [!] Fix broken DownloadImage blueprint node on PS4.
- Node should return a UTexture2DDynamic, otherwise the RHI assumes the data has been pre-formatted for the GPU, and we get pitch/layout issues.
#jira UE-36365
Change 3185407 on 2016/11/03 by Dmitry.Rekman
Linux: fix PhysX on AArch64.
(Edigrating 3184484 from Wombat to Dev-Platform).
Change 3187488 on 2016/11/04 by Josh.Adams
Copying //Tasks/UE4/Private-Platform-Switch to Dev-Platform-Minimal (//UE4/Dev-Platform-Minimal)
Change 3187740 on 2016/11/04 by Josh.Adams
- Re-copying the Switch files, now with proper case in the directory names
Change 3188304 on 2016/11/07 by Dan.Mahashin
- Removed deprecated functions in NVN window creation
Change 3188865 on 2016/11/07 by Luke.Thatcher
[PLATFORM] [PS4] [~] Move PS4 console input handler into engine classes from OrionGame.
- Enables console input from Sony's "Console Output" tool for all games, in debug/development builds.
#jira UE-37672
Change 3189517 on 2016/11/07 by Jeff.Campeau
Fix incorrect local platform identification in device manager.
#jira UE-38312
Change 3189897 on 2016/11/08 by Luke.Thatcher
[PLATFORM] [!] Fix width/height mismatch in DownloadImage blueprint node.
Change 3190042 on 2016/11/08 by Josh.Adams
- Fixed default and Shooter App Ids for Switch
Change 3190181 on 2016/11/08 by Joe.Barnes
[UE-37275] Split reflection capture error message into two UE_LOG()s. Line length causes truncation and line wrap on some platforms.
Change 3190185 on 2016/11/08 by Joe.Barnes
Fix another instance of UE_LOG() where the string was being truncated on Switch platform.
Change 3190272 on 2016/11/08 by Daniel.Lamb
Add file hashes to depependency tracking info.
Moved partial gc controlling code outside of the cooker.
Store cooked file hashes in cooked asset registry.
Cooked asset registry is now part of the cooker instead of chunking manifest.
#test cook paragon
Change 3190332 on 2016/11/08 by Omar.Rodriguez
Fixing issues with iOS remote notifications
* Update UPlatformGameInstance::FPlatformRegisteredForRemoteNotificationsDelegate signature so the parameter is const& which will work with BlueprintAssignable
* Fix misspelling when doing respondsToSelector check
* Update generated Xcode project to use the generated entitlements file
* Add remote-notification as a background mode
* Update the generated entitlements file contents to include APS environment for push notifications
* Added bEnableRemoteNotificationsSupport ini parameter to control whether iOS push notifications code is compiled
Change 3190391 on 2016/11/08 by Brent.Pease
UE-31739 - Crash when Deploying to iPad Air with BC4 Texture Compression Setting
(Josh's suggestion worked out of the box)
Change 3190786 on 2016/11/08 by Bart.Hawthorne
Fix some missing PLATFORM_WOLF changes to PLATFORM_SWITCH in ShooterGame
Change 3190902 on 2016/11/08 by Alicia.Cano
Allow RTTI and exceptions to be enabled for Android
#jira UE-37845
#android
Change 3190973 on 2016/11/08 by Chris.Babcock
Add ability to set element value field with new text parameter for UPL
#jira UE-37390
#PR #2869
#ue4
#upl
Change 3191411 on 2016/11/09 by Josh.Stoddard
Warn when user tries to use a shared pak reader on the wrong thread
#jira UE-38049
Change 3191635 on 2016/11/09 by Josh.Stoddard
More useful message during cook when AT9 assets fail to encode using SCE's tool
#jira UE-38053
Change 3191663 on 2016/11/09 by Peter.Sauerbrei
fix for ios build from PC
Change 3191701 on 2016/11/09 by Brent.Pease
implement iOS device logs on windows
Change 3191794 on 2016/11/09 by Daniel.Lamb
Fixed up compile error missing header file.
#test Compile editor
#jira UE-38414
Change 3191807 on 2016/11/09 by Josh.Adams
- Fixed one chage that was missed in the WolfPlat->Switch rename
Change 3191867 on 2016/11/09 by Josh.Adams
- Enabled Switch for ShooterGame project
Change 3191958 on 2016/11/09 by Jeff.Campeau
Add warning for anyone still using XP
Change 3192185 on 2016/11/09 by Josh.Adams
- Updated to SDK 0.11.12
- Added TrackLotCheckItem API to track guidelines with limits (nothing using it yet)
Change 3192241 on 2016/11/09 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
Change 3192324 on 2016/11/09 by Josh.Adams
- Worked around an issue with RunOnTarget stripping quotes around paths with spaces
#jira UE-38388
Change 3192387 on 2016/11/09 by Josh.Adams
- Updating editor icon for Switch
#jira UE-38295
Change 3192476 on 2016/11/09 by Dmitry.Rekman
Linux: put correct OpenAL lib per architecture.
(Edigrating CL 3185947 from Wombat to Dev-Platform)
Change 3192527 on 2016/11/09 by Josh.Adams
- Fixed a shadow variable warning
#jira UE-38408
Change 3192606 on 2016/11/09 by Jeff.Campeau
XP option removed
#jira UEPLAT-1542
Change 3192644 on 2016/11/09 by Josh.Adams
- Fixed a CIS error (not sure why I don't get it, but hey)
Change 3192659 on 2016/11/09 by Josh.Adams
- Fixed a crash in DeploymentServer
Change 3192672 on 2016/11/09 by Jeff.Campeau
Fix WinXP message spamming
Change 3193252 on 2016/11/10 by Josh.Adams
- Remove assertion in SwitchTextureFormat when the SDK can't be found (if you are sharing DLLs)
Change 3193756 on 2016/11/10 by Dmitry.Rekman
Linux: add support for touch events.
(Edigrating CL 3188159 from Wombat to Dev-Platform).
Change 3194297 on 2016/11/10 by Jeff.Campeau
HarfBuzz implementation for Xbox One
#jira UE-28590
Change 3194299 on 2016/11/10 by Jeff.Campeau
Pump Xbox One messaging during slow startup tasks
#jira UEPLAT-1276
Change 3194300 on 2016/11/10 by Jeff.Campeau
Use response files when building for Xbox One
#jira UEPLAT-1296
Change 3194313 on 2016/11/11 by Jeff.Campeau
Stop uploading symbols on the first error
Show a more detailed error message if symbol uploading fails
Add a command line option to disable upload of symbols
#1852
#jira UE-24425
Change 3194327 on 2016/11/11 by Jeff.Campeau
Deduplicate Xbox One build.cs setup for several modules
#jira UE-37540
Change 3194402 on 2016/11/11 by Dmitry.Rekman
Linux: do not apply mouse workaround unnecessarily.
- Only matters when there is more than one window.
(Edigrating 3194399 from Wombat to Dev-Platform).
Change 3194434 on 2016/11/11 by Dan.Mahashin
- Ported fix CL 3193690: Add workaround to file I/O error about ResultInvalidCurrentMemory when reloading levels - remove uncached attribute during memory pool finalization
Change 3194569 on 2016/11/11 by Daniel.Lamb
Fixed issue with CreateLinker failing to return LinkerLoad but creating a UPackage which can't be cleaned up.
Change 3194570 on 2016/11/11 by Daniel.Lamb
Fix for DiffSerializeArchive not using the correct archive when saving packages.
#test Cook paragon
Change 3194571 on 2016/11/11 by Daniel.Lamb
Make sure dependent packages are valid before using them.
Added FastBuildCookRun bat file for paragon testing.
#test Cook Paragon
Change 3194575 on 2016/11/11 by Daniel.Lamb
Reworked a warning for the cooker.
Change 3194698 on 2016/11/11 by Daniel.Lamb
Skip skin verify only runs on build machines now.
Saves paragon cook time.
Change 3194699 on 2016/11/11 by Daniel.Lamb
Changed the wording of skip editor content setting so it's more clear.
#test none
Change 3194702 on 2016/11/11 by Daniel.Lamb
Potential fix for default materials not being in chunk zero.
#test run ps4 cooked build paragon
Change 3194711 on 2016/11/11 by Alicia.Cano
Allow RTTI and exceptions to be enabled for Android
Allow RTTI to be enabled for IOS, Mac
#jira UE-37845, UE-20314
#android
#ios
#mac
Change 3194956 on 2016/11/11 by Josh.Adams
- Removed the crash with unknown socket error code, left in the warning
Change 3195028 on 2016/11/11 by Dmitry.Rekman
Linux: repair launch on.
(Edigrating 3194384 from //UE4/Private-Wombat/... to //UE4/Dev-Platform/...)
Change 3195041 on 2016/11/11 by Dmitry.Rekman
Linux: support selecting architectures per project.
(Edigrating 3192783 from Wombat to Dev-Platform).
Change 3195058 on 2016/11/11 by Dmitry.Rekman
Linux: fix code to determine number of cores.
- ARM topology seems not to be in line with the assumptions made by x86-centric code.
(Merging 3184632 from Wombat to Dev-Platform).
Change 3195082 on 2016/11/11 by Josh.Adams
- Fixed name of packaged Switch builds to have the config in it (Shipping, etc)
#jira UE-38394
Change 3195151 on 2016/11/11 by Bart.Hawthorne
- Add game server settings to project settings to connect to the actual game server, instead of the debug login
- Use the system software dialog box to show error codes for login failures
Change 3195153 on 2016/11/11 by Josh.Adams
- Fixed copy and paste logs errors
Change 3195156 on 2016/11/11 by Josh.Adams
- Fixed some default values, especially for save games (uses their default of 4MB size)
- Added some LotCheck write tracking
Change 3195285 on 2016/11/11 by Jeff.Campeau
Fix HarfBuzz warning on Xbox One
Change 3195477 on 2016/11/11 by Josh.Adams
- Fixed up some IsGameOnly calls
#jira UE-37575
Change 3195490 on 2016/11/11 by Dmitry.Rekman
UAT: fix CIS (removed old variables).
Change 3195724 on 2016/11/11 by Josh.Adams
- Final fix for name of .nsp (content only projects in Shipping config, etc)
#jira UE-38394
Change 3195755 on 2016/11/11 by Josh.Adams
- Made translucent Switch icons
Change 3195771 on 2016/11/11 by Josh.Adams
- Fixed some Switch "space in path" issues
#jira UE-38393
Change 3195801 on 2016/11/11 by Josh.Adams
- Handle making sure the save is completed before we shutdown
#jira UE-38215
Change 3196593 on 2016/11/14 by Michael.Trepka
Implemented Info string in AvfMedia for display in Media Player Editor
#jira UE-35386
Change 3196782 on 2016/11/14 by Josh.Adams
- Added a comment for a workaround
Change 3196784 on 2016/11/14 by Michael.Trepka
Alembic importer for Mac
#jira UE-37708
Change 3196901 on 2016/11/14 by Alicia.Cano
ADB over wifi fails to deploy on Launch on.
#jira UE-37957
#android
Change 3197055 on 2016/11/14 by Josh.Adams
- Fixed BinnedAllocator crash that happened with PoisonProxy and large allocations with large alignment
Change 3197059 on 2016/11/14 by Josh.Adams
- Removed some stat code with no STATS
Change 3197066 on 2016/11/14 by Josh.Adams
- Fixed the generic growableallocator to not free metadata before it's used for stats, and cleaned up a couple minor things
Change 3197176 on 2016/11/14 by Josh.Adams
- Added some helper scripts to switch in and out of debug mode on Switch
Change 3197183 on 2016/11/14 by Bart.Hawthorne
Error dialog fixes based on peer review feedback from JoshA
Change 3197339 on 2016/11/14 by Josh.Adams
Allow -htcs on the commandline now to override disabling Htcs in packaged builds
Change 3197401 on 2016/11/14 by Josh.Adams
- Fixed the Switch package installation script to remove the path of the package, since it causes problems with spaces, and also it makes the script less portable!
#jira UE-38556
Change 3197691 on 2016/11/14 by Dmitry.Rekman
Linux: save added devices.
(Edigrating 3196529 from Wombat to Dev-Platform).
Change 3197854 on 2016/11/15 by Dan.Mahashin
- MemoryProfiler2: fixed Switch parser file path in the csproj
Change 3197960 on 2016/11/15 by Dan.Mahashin
- NVN RHITransitionResources() directly uses a barrier instead of relying on CopyToResolveTarget() side effect (UE-33834)
Change 3198488 on 2016/11/15 by Bart.Hawthorne
Submit missing NoRedist/DefaultEngine.ini file
Change 3198970 on 2016/11/15 by Michael.Trepka
Don't try to use installed Mono 4.6 on Mac as it's known to have issues on macOS 10.12 (for example building the editor with UBT often fails with Mono running out of file desriptors)
Change 3199050 on 2016/11/15 by Daniel.Lamb
Some more output to help track down iterative cooking scenarios
#test Cook paragon
Change 3199097 on 2016/11/15 by Josh.Adams
- Fixed up Switch packaging to re-generate the meta data in case it changed since compile time (esp with content only projects
- Fixed default Program Id in code
- Fixed a problem with Run with a space in the path
#jira UE-38608
Change 3199181 on 2016/11/15 by Dmitry.Rekman
Fix CIS (compiling LinuxTargetDevice without engine).
Change 3199253 on 2016/11/15 by Dmitry.Rekman
Hopeful fix for a static analysis warning.
Change 3199325 on 2016/11/15 by Joe.Barnes
Start a new CommandBuffer immediately upon ending one. Prevents fetching when there's no CommandBuffer. Needed for Loading Screen movie playback.
Change 3199814 on 2016/11/15 by Dmitry.Rekman
Linux: remove forced -windowed when launching.
(Merging CL 3199789 from Wombat to Dev-Platform)
Change 3200580 on 2016/11/16 by Josh.Adams
Updasted DeploymentServer
Change 3200595 on 2016/11/16 by Joe.Barnes
Removed inadvertent SleepThread() when starting movie playback.
Change 3200604 on 2016/11/16 by Josh.Adams
- Added NN_MIDDLEWARE macros to tag ths apps as using UE4 middleware
Change 3200632 on 2016/11/16 by Brent.Pease
Update PlatformShowcase with latest tests
Change 3200704 on 2016/11/16 by Dmitry.Rekman
Linux: fix native compilation.
Change 3200711 on 2016/11/16 by Brent.Pease
- Support ios audio streaming from disk
- Flushed out ADPCMAudioInfo to be more flexible with buffer management in addition to support streaming from disk. This should make more code platform independent.
+ Other platforms should work fine but will need to be updated to use the new buffer flexability (and hence simplify their own code and buffer management)
- IOS audio implementation simplified to use new ADPCMAudioInfo functionality
- Fixed adpcm seamless looping
NOTE: While everything works with my testing (admittedly simple tests) a little more code cleanup needs to happen...
Change 3201015 on 2016/11/16 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
Change 3201023 on 2016/11/16 by Josh.Stoddard
Fix splash screen assignment for iPad
#jira UE-38623
Change 3201215 on 2016/11/16 by Brent.Pease
Hopefully final fix for build breakage
Change 3201259 on 2016/11/16 by Josh.Adams
- Removed the clock rate settings from the Project Settings, and the cvars - it was just confusing
- Further improved the metadata recreation during packaging (can get rid of the temp meta/desc files now I believe)
- Reduced audio pool alignment to not waste massive memory from it
Change 3202332 on 2016/11/17 by Daniel.Lamb
Changed build scripts to support iterative cooking
#test Ran new build scripts
Change 3202371 on 2016/11/17 by Michael.Trepka
Changed FAppleHttpResponse::GetContentLength to return expected content size instead of payload size so it's consistent with other implementations
#jira UE-38392
Change 3202421 on 2016/11/17 by Michael.Trepka
Decrease the number of max open files for a thread on Apple platforms from 256 to 192 to leave more file descriptors to Cocoa
#jira UE-18343
Change 3202462 on 2016/11/17 by Michael.Trepka
Fixed HTTP If-None-Match response code on Mac and iOS
Fixed by iktomi, https://answers.unrealengine.com/questions/492514/http-if-none-match-logic-isnt-working-on-mac-due-t.html
#jira UE-36317
Change 3202620 on 2016/11/17 by Daniel.Lamb
Fixed issue with some objects being garbage collected which shouldn't be because the collection handler didn't get registered.
Commandlets now do not always have GIsRequestingExit true.
Made crash handler check for commandlets running and exit appropriately.
#test Rebuild lighting QAGame
Change 3202955 on 2016/11/17 by Daniel.Lamb
Add support for clearing all the cached cooked platform data for a platform when requested.
#test cook QA game
#jira UE-38361
Change 3202983 on 2016/11/17 by Daniel.Lamb
Added support to rebuild lightmaps commandlet for building lightmaps in seperate files.
#test rebuild lighting Custom QAGame maps.
#jira OR-31907
Change 3203128 on 2016/11/17 by Josh.Adams
- Fixed split screen user selection in ShooterGame (brought over some changes from NickD for it as well)
Change 3203537 on 2016/11/18 by Dmitry.Rekman
Fix ProjectWorldToScreen node for letterboxed viewports.
(Merging CL 3201546 from Wombat to Dev-Platform).
Change 3203540 on 2016/11/18 by Dmitry.Rekman
Linux: be more verbose when setting vblank sync.
(Merging CL 3199633 from Private-Wombat to Dev-Platform).
Change 3203599 on 2016/11/18 by Dmitry.Rekman
Speedup bForceCompilationAtStartup=True when nothing changed (UE-37067).
- PR #2849: Contributed by slonopotamus.
Change 3203610 on 2016/11/18 by Dmitry.Rekman
Add CEF support for Linux (UE-6743).
Change 3203615 on 2016/11/18 by Dmitry.Rekman
Linux: fix bootstrap script so it is independent of working dir (UE-37016).
- PR #2842 contributed by slonopotamus
Change 3203645 on 2016/11/18 by Dmitry.Rekman
Linux: fix UnrealCEFSubProcess.
Change 3203658 on 2016/11/18 by Dmitry.Rekman
Remove hard-coded paths to mono binary (UE-35228).
- Another way to implement pull request #2741.
Change 3203770 on 2016/11/18 by Josh.Adams
- Brought over some changes from Dev-Core to not crash in AsyncLoading with debug code
Change 3204244 on 2016/11/18 by Dmitry.Rekman
Unsuppress mistakenly suppressed warnings and fix one more (UE-38788).
Change 3204277 on 2016/11/18 by Brent.Pease
+ Fix seamless looping bug found on Dan's QAGame test
+ Fix static analyzer warning (which was a real bug with uncompressed streaming)
+ Code review feedback from Aaron
+ Small addition from channel sync ios bug fix
Change 3204576 on 2016/11/18 by Omar.Rodriguez
Expose the bEnableRemoteNotificationsSupport ini setting in the iOS project settings.
Change 3204629 on 2016/11/18 by Chris.Babcock
Fix case of VulkanSwapChain.h #include
#jira UE-38843
#ue4
#vulkan
Change 3204708 on 2016/11/18 by Josh.Adams
- Set SwitchMoviePlayer to include the libs from the proper directory
Change 3204730 on 2016/11/18 by Josh.Adams
- Changed a check to a checkf to narrow down why FMaterialUniformExpressionType::GetTypeMap().FindRef(TypeName) is returning nullptr on tvOS
Change 3204865 on 2016/11/18 by Brent.Pease
+ Turn off ios console logs on Windows to help sort through ios packaging and launch-on issues - This is NOT a fix but it should make it easier to track down the problem with it off.
Change 3204883 on 2016/11/18 by Dmitry.Rekman
Linux: fix native LaunchOn (UE-38616).
Change 3204914 on 2016/11/18 by Brent.Pease
+ Turn off the device check to prevent it from conflicting with remote packaging/launch-on
Change 3204940 on 2016/11/18 by Josh.Adams
Backing out changes to the profiler for Switch. Shouldn't have checked it in today during smoke
Change 3204952 on 2016/11/18 by Dmitry.Rekman
Linux: fix bootstrap script (UE-38851).
- Caused by UE-37016.
Change 3205630 on 2016/11/21 by Brent.Pease
+ Fix audio sound queuing bug by ensuring audio buffers are not reused by different sound source objects.
+ Cleaned up the locking mechanism around stopping sound sources to make its intent and function are clear
+ Cleaned up memory tracking and freeing.
#jira ue-38846
Change 3205787 on 2016/11/21 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
[CL 3206922 by Josh Adams in Main branch]
2016-11-21 20:27:58 -05:00
Arguments + = " -editorrecompile -progress -NoHotReloadFromIDE " ;
2014-05-13 18:23:53 -04:00
// Run UBT
return RunUnrealBuildTool ( LOCTEXT ( " CompilingProject " , " Compiling project... " ) , RootDir , Arguments , Warn ) ;
}
bool FDesktopPlatformBase : : GenerateProjectFiles ( const FString & RootDir , const FString & ProjectFileName , FFeedbackContext * Warn )
{
# if PLATFORM_MAC
2015-02-16 07:53:59 -05:00
FString Arguments = TEXT ( " -xcodeprojectfile " ) ;
2014-07-30 23:26:47 -04:00
# elif PLATFORM_LINUX
2015-07-14 18:17:55 -04:00
FString Arguments = TEXT ( " -makefile -kdevelopfile -qmakefile -cmakefile -codelitefile " ) ;
2014-05-13 18:23:53 -04:00
# else
2015-02-16 07:53:59 -05:00
FString Arguments = TEXT ( " -projectfiles " ) ;
2014-05-13 18:23:53 -04:00
# endif
2015-04-30 13:15:34 -04:00
2014-12-10 11:58:11 -05:00
// Build the arguments to pass to UBT. If it's a non-foreign project, just build full project files.
if ( ! ProjectFileName . IsEmpty ( ) & & GetCachedProjectDictionary ( RootDir ) . IsForeignProject ( ProjectFileName ) )
2014-05-13 18:23:53 -04:00
{
// Figure out whether it's a foreign project
2014-05-14 14:53:19 -04:00
const FUProjectDictionary & ProjectDictionary = GetCachedProjectDictionary ( RootDir ) ;
2014-05-13 18:23:53 -04:00
if ( ProjectDictionary . IsForeignProject ( ProjectFileName ) )
{
Arguments + = FString : : Printf ( TEXT ( " -project= \" %s \" " ) , * IFileManager : : Get ( ) . ConvertToAbsolutePathForExternalAppForRead ( * ProjectFileName ) ) ;
2014-05-19 13:08:08 -04:00
// Always include game source
2015-02-16 07:53:59 -05:00
Arguments + = TEXT ( " -game " ) ;
2014-05-13 18:23:53 -04:00
2014-05-19 13:08:08 -04:00
// Determine whether or not to include engine source
2015-12-04 09:32:58 -05:00
if ( IsSourceDistribution ( RootDir ) )
2014-05-19 13:08:08 -04:00
{
2015-02-16 07:53:59 -05:00
Arguments + = TEXT ( " -engine " ) ;
2014-05-19 13:08:08 -04:00
}
2016-02-03 15:40:40 -05:00
else
{
// If this is used within UnrealVersionSelector then we still need to pass
// -rocket to deal with old versions that don't use Rocket.txt file
Arguments + = TEXT ( " -rocket " ) ;
}
2014-05-13 18:23:53 -04:00
}
}
2015-02-16 07:53:59 -05:00
Arguments + = TEXT ( " -progress " ) ;
2014-05-13 18:23:53 -04:00
2014-10-30 17:07:40 -04:00
// Compile UnrealBuildTool if it doesn't exist. This can happen if we're just copying source from somewhere.
bool bRes = true ;
2014-05-13 18:23:53 -04:00
Warn - > BeginSlowTask ( LOCTEXT ( " GeneratingProjectFiles " , " Generating project files... " ) , true , true ) ;
2015-01-29 16:15:16 -05:00
if ( ! FPaths : : FileExists ( GetUnrealBuildToolExecutableFilename ( RootDir ) ) )
2014-10-30 17:07:40 -04:00
{
Warn - > StatusUpdate ( 0 , 1 , LOCTEXT ( " BuildingUBT " , " Building UnrealBuildTool... " ) ) ;
2015-01-29 16:15:16 -05:00
bRes = BuildUnrealBuildTool ( RootDir , * Warn ) ;
2014-10-30 17:07:40 -04:00
}
if ( bRes )
{
2015-01-29 16:15:16 -05:00
Warn - > StatusUpdate ( 0 , 1 , LOCTEXT ( " GeneratingProjectFiles " , " Generating project files... " ) ) ;
2014-10-30 17:07:40 -04:00
bRes = RunUnrealBuildTool ( LOCTEXT ( " GeneratingProjectFiles " , " Generating project files... " ) , RootDir , Arguments , Warn ) ;
}
2014-05-13 18:23:53 -04:00
Warn - > EndSlowTask ( ) ;
return bRes ;
}
2015-03-17 09:34:18 -04:00
bool FDesktopPlatformBase : : InvalidateMakefiles ( const FString & RootDir , const FString & ProjectFileName , FFeedbackContext * Warn )
2015-02-16 07:53:59 -05:00
{
// Composes the target, platform, and config (eg, "QAGame Win64 Development")
FString Arguments = FString : : Printf ( TEXT ( " %s %s %s " ) , FApp : : GetGameName ( ) , FPlatformMisc : : GetUBTPlatform ( ) , FModuleManager : : GetUBTConfiguration ( ) ) ;
// -editorrecompile tells UBT to work out the editor target name from the game target name we provided (eg, converting "QAGame" to "QAGameEditor")
Arguments + = TEXT ( " -editorrecompile " ) ;
// Build the arguments to pass to UBT. If it's a non-foreign project, just build full project files.
if ( ! ProjectFileName . IsEmpty ( ) & & GetCachedProjectDictionary ( RootDir ) . IsForeignProject ( ProjectFileName ) )
{
// Figure out whether it's a foreign project
const FUProjectDictionary & ProjectDictionary = GetCachedProjectDictionary ( RootDir ) ;
if ( ProjectDictionary . IsForeignProject ( ProjectFileName ) )
{
Arguments + = FString : : Printf ( TEXT ( " \" %s \" " ) , * IFileManager : : Get ( ) . ConvertToAbsolutePathForExternalAppForRead ( * ProjectFileName ) ) ;
}
}
2015-03-17 09:34:18 -04:00
// -invalidatemakefilesonly tells UBT to invalidate its UBT makefiles without building
Arguments + = TEXT ( " -invalidatemakefilesonly " ) ;
2015-02-16 07:53:59 -05:00
// Compile UnrealBuildTool if it doesn't exist. This can happen if we're just copying source from somewhere.
bool bRes = true ;
2015-03-17 09:34:18 -04:00
Warn - > BeginSlowTask ( LOCTEXT ( " InvalidateMakefiles " , " Invalidating makefiles... " ) , true , true ) ;
2015-02-16 07:53:59 -05:00
if ( ! FPaths : : FileExists ( GetUnrealBuildToolExecutableFilename ( RootDir ) ) )
{
Warn - > StatusUpdate ( 0 , 1 , LOCTEXT ( " BuildingUBT " , " Building UnrealBuildTool... " ) ) ;
bRes = BuildUnrealBuildTool ( RootDir , * Warn ) ;
}
if ( bRes )
{
2015-03-17 09:34:18 -04:00
Warn - > StatusUpdate ( 0 , 1 , LOCTEXT ( " InvalidateMakefiles " , " Invalidating makefiles... " ) ) ;
bRes = RunUnrealBuildTool ( LOCTEXT ( " InvalidateMakefiles " , " Invalidating makefiles... " ) , RootDir , Arguments , Warn ) ;
2015-02-16 07:53:59 -05:00
}
Warn - > EndSlowTask ( ) ;
return bRes ;
}
2014-09-05 13:31:22 -04:00
bool FDesktopPlatformBase : : IsUnrealBuildToolAvailable ( )
{
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
// If using installed build and the unreal build tool executable exists, then UBT is available. Otherwise check it can be built.
2014-09-05 13:31:22 -04:00
if ( FApp : : IsEngineInstalled ( ) )
{
2015-01-29 16:15:16 -05:00
return FPaths : : FileExists ( GetUnrealBuildToolExecutableFilename ( FPaths : : RootDir ( ) ) ) ;
2014-09-05 13:31:22 -04:00
}
else
{
2015-01-29 16:15:16 -05:00
return FPaths : : FileExists ( GetUnrealBuildToolProjectFileName ( FPaths : : RootDir ( ) ) ) ;
2014-09-05 13:31:22 -04:00
}
}
bool FDesktopPlatformBase : : InvokeUnrealBuildToolSync ( const FString & InCmdLineParams , FOutputDevice & Ar , bool bSkipBuildUBT , int32 & OutReturnCode , FString & OutProcOutput )
{
2015-03-09 11:45:35 -04:00
void * PipeRead = nullptr ;
void * PipeWrite = nullptr ;
2014-09-05 13:31:22 -04:00
verify ( FPlatformProcess : : CreatePipe ( PipeRead , PipeWrite ) ) ;
bool bInvoked = false ;
FProcHandle ProcHandle = InvokeUnrealBuildToolAsync ( InCmdLineParams , Ar , PipeRead , PipeWrite , bSkipBuildUBT ) ;
if ( ProcHandle . IsValid ( ) )
{
// rather than waiting, we must flush the read pipe or UBT will stall if it writes out a ton of text to the console.
while ( FPlatformProcess : : IsProcRunning ( ProcHandle ) )
{
OutProcOutput + = FPlatformProcess : : ReadPipe ( PipeRead ) ;
FPlatformProcess : : Sleep ( 0.1f ) ;
}
bInvoked = true ;
bool bGotReturnCode = FPlatformProcess : : GetProcReturnCode ( ProcHandle , & OutReturnCode ) ;
check ( bGotReturnCode ) ;
}
else
{
bInvoked = false ;
OutReturnCode = - 1 ;
OutProcOutput = TEXT ( " " ) ;
}
FPlatformProcess : : ClosePipe ( PipeRead , PipeWrite ) ;
return bInvoked ;
}
FProcHandle FDesktopPlatformBase : : InvokeUnrealBuildToolAsync ( const FString & InCmdLineParams , FOutputDevice & Ar , void * & OutReadPipe , void * & OutWritePipe , bool bSkipBuildUBT )
{
FString CmdLineParams = InCmdLineParams ;
// UnrealBuildTool is currently always located in the Binaries/DotNET folder
2015-01-29 16:15:16 -05:00
FString ExecutableFileName = GetUnrealBuildToolExecutableFilename ( FPaths : : RootDir ( ) ) ;
2014-09-05 13:31:22 -04:00
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
// Installed builds never build UBT, UnrealBuildTool should already exist
2014-09-05 13:31:22 -04:00
bool bSkipBuild = FApp : : IsEngineInstalled ( ) | | bSkipBuildUBT ;
if ( ! bSkipBuild )
{
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
// When not using an installed build, we should attempt to build UBT to make sure it is up to date
2014-09-05 13:31:22 -04:00
// Only do this if we have not already successfully done it once during this session.
static bool bSuccessfullyBuiltUBTOnce = false ;
if ( ! bSuccessfullyBuiltUBTOnce )
{
Ar . Log ( TEXT ( " Building UnrealBuildTool... " ) ) ;
2015-01-29 16:15:16 -05:00
if ( BuildUnrealBuildTool ( FPaths : : RootDir ( ) , Ar ) )
2014-09-05 13:31:22 -04:00
{
bSuccessfullyBuiltUBTOnce = true ;
}
else
{
// Failed to build UBT
Ar . Log ( TEXT ( " Failed to build UnrealBuildTool. " ) ) ;
return FProcHandle ( ) ;
}
}
}
2014-11-04 16:37:36 -05:00
# if PLATFORM_LINUX
CmdLineParams + = ( " -progress " ) ;
# endif // PLATFORM_LINUX
2014-09-05 13:31:22 -04:00
Ar . Logf ( TEXT ( " Launching UnrealBuildTool... [%s %s] " ) , * ExecutableFileName , * CmdLineParams ) ;
# if PLATFORM_MAC
// On Mac we launch UBT with Mono
FString ScriptPath = FPaths : : ConvertRelativePathToFull ( FPaths : : EngineDir ( ) / TEXT ( " Build/BatchFiles/Mac/RunMono.sh " ) ) ;
CmdLineParams = FString : : Printf ( TEXT ( " \" %s \" \" %s \" %s " ) , * ScriptPath , * ExecutableFileName , * CmdLineParams ) ;
ExecutableFileName = TEXT ( " /bin/sh " ) ;
2014-11-04 16:37:36 -05:00
# elif PLATFORM_LINUX
// Real men run Linux (with Mono??)
FString ScriptPath = FPaths : : ConvertRelativePathToFull ( FPaths : : EngineDir ( ) / TEXT ( " Build/BatchFiles/Linux/RunMono.sh " ) ) ;
CmdLineParams = FString : : Printf ( TEXT ( " \" %s \" \" %s \" %s " ) , * ScriptPath , * ExecutableFileName , * CmdLineParams ) ;
ExecutableFileName = TEXT ( " /bin/bash " ) ;
2014-09-05 13:31:22 -04:00
# endif
// Run UnrealBuildTool
const bool bLaunchDetached = false ;
const bool bLaunchHidden = true ;
const bool bLaunchReallyHidden = bLaunchHidden ;
FProcHandle ProcHandle = FPlatformProcess : : CreateProc ( * ExecutableFileName , * CmdLineParams , bLaunchDetached , bLaunchHidden , bLaunchReallyHidden , NULL , 0 , NULL , OutWritePipe ) ;
if ( ! ProcHandle . IsValid ( ) )
{
Ar . Logf ( TEXT ( " Failed to launch Unreal Build Tool. (%s) " ) , * ExecutableFileName ) ;
}
return ProcHandle ;
}
2014-08-29 15:31:27 -04:00
bool FDesktopPlatformBase : : GetSolutionPath ( FString & OutSolutionPath )
{
// Get the platform-specific suffix for solution files
# if PLATFORM_MAC
2015-12-10 16:56:55 -05:00
const TCHAR * Suffix = TEXT ( " .xcworkspace/contents.xcworkspacedata " ) ;
2014-08-29 15:31:27 -04:00
# elif PLATFORM_LINUX
2015-07-14 18:17:55 -04:00
const TCHAR * Suffix = TEXT ( " .workspace " ) ; // FIXME: Should depend on PreferredAccessor setting
2014-08-29 15:31:27 -04:00
# else
const TCHAR * Suffix = TEXT ( " .sln " ) ;
# endif
// When using game specific uproject files, the solution is named after the game and in the uproject folder
if ( FPaths : : IsProjectFilePathSet ( ) )
{
FString SolutionPath = FPaths : : GameDir ( ) / FPaths : : GetBaseFilename ( FPaths : : GetProjectFilePath ( ) ) + Suffix ;
if ( FPaths : : FileExists ( SolutionPath ) )
{
OutSolutionPath = SolutionPath ;
return true ;
}
}
// Otherwise, it is simply titled UE4.sln
FString DefaultSolutionPath = FPaths : : RootDir ( ) / FString ( TEXT ( " UE4 " ) ) + Suffix ;
if ( FPaths : : FileExists ( DefaultSolutionPath ) )
{
OutSolutionPath = DefaultSolutionPath ;
return true ;
}
return false ;
}
2015-06-10 11:14:19 -04:00
FString FDesktopPlatformBase : : GetDefaultProjectCreationPath ( )
2014-06-04 18:06:57 -04:00
{
// My Documents
const FString DefaultProjectSubFolder = TEXT ( " Unreal Projects " ) ;
return FString ( FPlatformProcess : : UserDir ( ) ) + DefaultProjectSubFolder ;
}
2014-05-14 15:20:39 -04:00
void FDesktopPlatformBase : : ReadLauncherInstallationList ( )
2014-05-08 08:20:34 -04:00
{
2015-06-19 14:22:08 -04:00
FString InstalledListFile = FString ( FPlatformProcess : : ApplicationSettingsDir ( ) ) / TEXT ( " UnrealEngineLauncher/LauncherInstalled.dat " ) ;
2015-06-19 10:12:02 -04:00
2014-05-14 15:20:39 -04:00
// If the file does not exist, manually check for the 4.0 or 4.1 manifest
FDateTime NewListTimestamp = IFileManager : : Get ( ) . GetTimeStamp ( * InstalledListFile ) ;
if ( NewListTimestamp = = FDateTime : : MinValue ( ) )
2014-05-08 08:20:34 -04:00
{
2014-05-14 15:20:39 -04:00
if ( LauncherInstallationList . Num ( ) = = 0 )
2014-05-08 08:20:34 -04:00
{
2014-05-14 15:20:39 -04:00
CheckForLauncherEngineInstallation ( TEXT ( " 40003 " ) , TEXT ( " UE_4.0 " ) , LauncherInstallationList ) ;
CheckForLauncherEngineInstallation ( TEXT ( " 1040003 " ) , TEXT ( " UE_4.1 " ) , LauncherInstallationList ) ;
}
}
else if ( NewListTimestamp ! = LauncherInstallationTimestamp )
{
// Read the installation manifest
FString InstalledText ;
if ( FFileHelper : : LoadFileToString ( InstalledText , * InstalledListFile ) )
{
// Deserialize the object
TSharedPtr < FJsonObject > RootObject ;
TSharedRef < TJsonReader < > > Reader = TJsonReaderFactory < > : : Create ( InstalledText ) ;
if ( FJsonSerializer : : Deserialize ( Reader , RootObject ) & & RootObject . IsValid ( ) )
{
// Parse the list of installations
TArray < TSharedPtr < FJsonValue > > InstallationList = RootObject - > GetArrayField ( TEXT ( " InstallationList " ) ) ;
for ( int32 Idx = 0 ; Idx < InstallationList . Num ( ) ; Idx + + )
{
TSharedPtr < FJsonObject > InstallationItem = InstallationList [ Idx ] - > AsObject ( ) ;
FString AppName = InstallationItem - > GetStringField ( TEXT ( " AppName " ) ) ;
FString InstallLocation = InstallationItem - > GetStringField ( TEXT ( " InstallLocation " ) ) ;
if ( AppName . Len ( ) > 0 & & InstallLocation . Len ( ) > 0 )
{
FPaths : : NormalizeDirectoryName ( InstallLocation ) ;
LauncherInstallationList . Add ( AppName , InstallLocation ) ;
}
}
}
LauncherInstallationTimestamp = NewListTimestamp ;
2014-05-08 08:20:34 -04:00
}
}
}
2014-04-23 18:46:48 -04:00
void FDesktopPlatformBase : : CheckForLauncherEngineInstallation ( const FString & AppId , const FString & Identifier , TMap < FString , FString > & OutInstallations )
{
FString ManifestText ;
2015-06-19 14:22:08 -04:00
FString ManifestFileName = FString ( FPlatformProcess : : ApplicationSettingsDir ( ) ) / FString : : Printf ( TEXT ( " UnrealEngineLauncher/Data/Manifests/%s.manifest " ) , * AppId ) ;
2015-06-19 13:26:10 -04:00
2014-04-23 18:46:48 -04:00
if ( FFileHelper : : LoadFileToString ( ManifestText , * ManifestFileName ) )
{
TSharedPtr < FJsonObject > RootObject ;
TSharedRef < TJsonReader < > > Reader = TJsonReaderFactory < > : : Create ( ManifestText ) ;
if ( FJsonSerializer : : Deserialize ( Reader , RootObject ) & & RootObject . IsValid ( ) )
{
TSharedPtr < FJsonObject > CustomFieldsObject = RootObject - > GetObjectField ( TEXT ( " CustomFields " ) ) ;
if ( CustomFieldsObject . IsValid ( ) )
{
FString InstallLocation = CustomFieldsObject - > GetStringField ( " InstallLocation " ) ;
if ( InstallLocation . Len ( ) > 0 )
{
OutInstallations . Add ( Identifier , InstallLocation ) ;
}
}
}
}
}
int32 FDesktopPlatformBase : : ParseReleaseVersion ( const FString & Version )
{
TCHAR * End ;
uint64 Major = FCString : : Strtoui64 ( * Version , & End , 10 ) ;
if ( Major > = MAX_int16 | | * ( End + + ) ! = ' . ' )
{
return INDEX_NONE ;
}
uint64 Minor = FCString : : Strtoui64 ( End , & End , 10 ) ;
if ( Minor > = MAX_int16 | | * End ! = 0 )
{
return INDEX_NONE ;
}
return ( Major < < 16 ) + Minor ;
}
TSharedPtr < FJsonObject > FDesktopPlatformBase : : LoadProjectFile ( const FString & FileName )
{
FString FileContents ;
if ( ! FFileHelper : : LoadFileToString ( FileContents , * FileName ) )
{
return TSharedPtr < FJsonObject > ( NULL ) ;
}
TSharedPtr < FJsonObject > JsonObject ;
TSharedRef < TJsonReader < > > Reader = TJsonReaderFactory < > : : Create ( FileContents ) ;
if ( ! FJsonSerializer : : Deserialize ( Reader , JsonObject ) | | ! JsonObject . IsValid ( ) )
{
return TSharedPtr < FJsonObject > ( NULL ) ;
}
return JsonObject ;
}
bool FDesktopPlatformBase : : SaveProjectFile ( const FString & FileName , TSharedPtr < FJsonObject > Object )
{
FString FileContents ;
TSharedRef < TJsonWriter < > > Writer = TJsonWriterFactory < > : : Create ( & FileContents ) ;
if ( ! FJsonSerializer : : Serialize ( Object . ToSharedRef ( ) , Writer ) )
{
return false ;
}
if ( ! FFileHelper : : SaveStringToFile ( FileContents , * FileName ) )
{
return false ;
}
return true ;
}
2014-05-13 18:23:53 -04:00
const FUProjectDictionary & FDesktopPlatformBase : : GetCachedProjectDictionary ( const FString & RootDir )
{
FString NormalizedRootDir = RootDir ;
FPaths : : NormalizeDirectoryName ( NormalizedRootDir ) ;
FUProjectDictionary * Dictionary = CachedProjectDictionaries . Find ( NormalizedRootDir ) ;
if ( Dictionary = = NULL )
{
Dictionary = & CachedProjectDictionaries . Add ( RootDir , FUProjectDictionary ( RootDir ) ) ;
}
return * Dictionary ;
}
2014-05-29 17:45:17 -04:00
void FDesktopPlatformBase : : GetProjectBuildProducts ( const FString & ProjectDir , TArray < FString > & OutFileNames , TArray < FString > & OutDirectoryNames )
2014-05-14 19:11:30 -04:00
{
FString NormalizedProjectDir = ProjectDir ;
FPaths : : NormalizeDirectoryName ( NormalizedProjectDir ) ;
// Find all the build roots
TArray < FString > BuildRootDirectories ;
BuildRootDirectories . Add ( NormalizedProjectDir ) ;
// Add all the plugin directories
TArray < FString > PluginFileNames ;
IFileManager : : Get ( ) . FindFilesRecursive ( PluginFileNames , * ( NormalizedProjectDir / TEXT ( " Plugins " ) ) , TEXT ( " *.uplugin " ) , true , false ) ;
for ( int32 Idx = 0 ; Idx < PluginFileNames . Num ( ) ; Idx + + )
{
BuildRootDirectories . Add ( FPaths : : GetPath ( PluginFileNames [ Idx ] ) ) ;
}
2014-05-29 17:45:17 -04:00
// Add all the intermediate directories
for ( int32 Idx = 0 ; Idx < BuildRootDirectories . Num ( ) ; Idx + + )
2014-05-14 19:11:30 -04:00
{
2014-05-29 17:45:17 -04:00
OutDirectoryNames . Add ( BuildRootDirectories [ Idx ] / TEXT ( " Intermediate " ) ) ;
2014-05-14 19:11:30 -04:00
}
2014-05-29 17:45:17 -04:00
// Add the files in the cleaned directories to the output list
for ( int32 Idx = 0 ; Idx < OutDirectoryNames . Num ( ) ; Idx + + )
2014-05-14 19:11:30 -04:00
{
2014-05-29 17:45:17 -04:00
IFileManager : : Get ( ) . FindFilesRecursive ( OutFileNames , * OutDirectoryNames [ Idx ] , TEXT ( " * " ) , true , false , false ) ;
2014-05-14 19:11:30 -04:00
}
}
2015-04-20 14:30:09 -04:00
FString FDesktopPlatformBase : : GetEngineSavedConfigDirectory ( const FString & Identifier )
2014-06-04 18:06:57 -04:00
{
// Get the engine root directory
FString RootDir ;
2015-04-20 14:30:09 -04:00
if ( ! GetEngineRootDirFromIdentifier ( Identifier , RootDir ) )
2014-06-04 18:06:57 -04:00
{
2015-04-20 14:30:09 -04:00
return FString ( ) ;
2014-06-04 18:06:57 -04:00
}
// Get the path to the game agnostic settings
FString UserDir ;
2015-04-20 14:30:09 -04:00
if ( IsStockEngineRelease ( Identifier ) )
2014-06-04 18:06:57 -04:00
{
2015-06-12 12:01:23 -04:00
UserDir = FPaths : : Combine ( FPlatformProcess : : UserSettingsDir ( ) , * FApp : : GetEpicProductIdentifier ( ) , * Identifier ) ;
2014-06-04 18:06:57 -04:00
}
else
{
UserDir = FPaths : : Combine ( * RootDir , TEXT ( " Engine " ) ) ;
}
// Get the game agnostic config dir
2015-04-20 14:30:09 -04:00
return UserDir / TEXT ( " Saved/Config " ) / ANSI_TO_TCHAR ( FPlatformProperties : : PlatformName ( ) ) ;
}
bool FDesktopPlatformBase : : EnumerateProjectsKnownByEngine ( const FString & Identifier , bool bIncludeNativeProjects , TArray < FString > & OutProjectFileNames )
{
// Get the engine root directory
FString RootDir ;
if ( ! GetEngineRootDirFromIdentifier ( Identifier , RootDir ) )
{
return false ;
}
FString GameAgnosticConfigDir = GetEngineSavedConfigDirectory ( Identifier ) ;
if ( GameAgnosticConfigDir . Len ( ) = = 0 )
{
return false ;
}
2014-06-04 18:06:57 -04:00
// Find all the created project directories. Start with the default project creation path.
TArray < FString > SearchDirectories ;
SearchDirectories . AddUnique ( GetDefaultProjectCreationPath ( ) ) ;
// Load the config file
FConfigFile GameAgnosticConfig ;
2015-04-20 10:12:55 -04:00
FConfigCacheIni : : LoadExternalIniFile ( GameAgnosticConfig , TEXT ( " EditorSettings " ) , NULL , * GameAgnosticConfigDir , false ) ;
2014-06-04 18:06:57 -04:00
// Find the editor game-agnostic settings
2015-04-20 10:12:55 -04:00
FConfigSection * Section = GameAgnosticConfig . Find ( TEXT ( " /Script/UnrealEd.EditorSettings " ) ) ;
2015-06-19 09:54:12 -04:00
if ( Section = = NULL )
{
FConfigCacheIni : : LoadExternalIniFile ( GameAgnosticConfig , TEXT ( " EditorGameAgnostic " ) , NULL , * GameAgnosticConfigDir , false ) ;
Section = GameAgnosticConfig . Find ( TEXT ( " /Script/UnrealEd.EditorGameAgnosticSettings " ) ) ;
}
2014-06-04 18:06:57 -04:00
if ( Section ! = NULL )
{
// Add in every path that the user has ever created a project file. This is to catch new projects showing up in the user's project folders
TArray < FString > AdditionalDirectories ;
Section - > MultiFind ( TEXT ( " CreatedProjectPaths " ) , AdditionalDirectories ) ;
for ( int Idx = 0 ; Idx < AdditionalDirectories . Num ( ) ; Idx + + )
{
FPaths : : NormalizeDirectoryName ( AdditionalDirectories [ Idx ] ) ;
SearchDirectories . AddUnique ( AdditionalDirectories [ Idx ] ) ;
}
// Also add in all the recently opened projects
TArray < FString > RecentlyOpenedFiles ;
Section - > MultiFind ( TEXT ( " RecentlyOpenedProjectFiles " ) , RecentlyOpenedFiles ) ;
for ( int Idx = 0 ; Idx < RecentlyOpenedFiles . Num ( ) ; Idx + + )
{
FPaths : : NormalizeFilename ( RecentlyOpenedFiles [ Idx ] ) ;
OutProjectFileNames . AddUnique ( RecentlyOpenedFiles [ Idx ] ) ;
}
}
// Find all the other projects that are in the search directories
for ( int Idx = 0 ; Idx < SearchDirectories . Num ( ) ; Idx + + )
{
TArray < FString > ProjectFolders ;
IFileManager : : Get ( ) . FindFiles ( ProjectFolders , * ( SearchDirectories [ Idx ] / TEXT ( " * " ) ) , false , true ) ;
for ( int32 FolderIdx = 0 ; FolderIdx < ProjectFolders . Num ( ) ; FolderIdx + + )
{
TArray < FString > ProjectFiles ;
2014-06-05 16:39:57 -04:00
IFileManager : : Get ( ) . FindFiles ( ProjectFiles , * ( SearchDirectories [ Idx ] / ProjectFolders [ FolderIdx ] / TEXT ( " *.uproject " ) ) , true , false ) ;
2014-06-04 18:06:57 -04:00
for ( int32 FileIdx = 0 ; FileIdx < ProjectFiles . Num ( ) ; FileIdx + + )
{
2014-06-05 16:39:57 -04:00
OutProjectFileNames . AddUnique ( SearchDirectories [ Idx ] / ProjectFolders [ FolderIdx ] / ProjectFiles [ FileIdx ] ) ;
2014-06-04 18:06:57 -04:00
}
}
}
// Find all the native projects, and either add or remove them from the list depending on whether we want native projects
const FUProjectDictionary & Dictionary = GetCachedProjectDictionary ( RootDir ) ;
if ( bIncludeNativeProjects )
{
TArray < FString > NativeProjectPaths = Dictionary . GetProjectPaths ( ) ;
for ( int Idx = 0 ; Idx < NativeProjectPaths . Num ( ) ; Idx + + )
{
if ( ! NativeProjectPaths [ Idx ] . Contains ( TEXT ( " /Templates/ " ) ) )
{
OutProjectFileNames . AddUnique ( NativeProjectPaths [ Idx ] ) ;
}
}
}
else
{
TArray < FString > NativeProjectPaths = Dictionary . GetProjectPaths ( ) ;
for ( int Idx = 0 ; Idx < NativeProjectPaths . Num ( ) ; Idx + + )
{
OutProjectFileNames . Remove ( NativeProjectPaths [ Idx ] ) ;
}
}
return true ;
}
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3232619)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3121996 on 2016/09/12 by Ben.Marsh
Add support for Visual Studio 2017 (aka "15"; assuming consistent naming with other versions until final name is announced).
* Compiler, STL implementation and CRT are binary compatible with VS2015 (see https://blogs.msdn.microsoft.com/vcblog/2016/08/24/c1417-features-and-stl-fixes-in-vs-15-preview-4/), so no new third-party libraries needed so far. WindowsPlatform.GetVisualStudioCompilerVersionName() returns "2015" as a result.
* Default compiler for compiling and generating project files is still VS 2015 for now. Pass -2017 on the command line to GenerateProjectFiles.bat to generate VS2017 projects. Projects generated for VS2017 will use the 2017 compiler by default.
* Visual Studio source code accessor can talk to VS 2017 instances.
* Added a VS2017 configuration for UnrealVS, and added precompiled vsix package.
* Switched GetVSComnTools to check the SOFTWARE\Microsoft\VisualStudio\SxS\VS7 registry key rather than the individual product install registry key. "15" doesn't seem to have it's own "InstallDir" key, but this system seems to work for all versions of Visual Studio (including previous releases of VS Express).
* Removed ATL dependency from VisualStudioSourceCodeAccessor. It's not installed with VS by default any more, and is only used for a couple of smart pointer classes.
Tested running the editor and packaging TP_Flying for Win64. Packaging from the editor still defaults to using the 2015 compiler, so ConfigureToolchain() needs to be overriden from the .target.cs file if multiple Visual Studio versions are installed.
Change 3189363 on 2016/11/07 by Ben.Marsh
Consolidate functionality for determining the path to MSBuild.exe to use for compiling UE4 tools into a single batch file (GetMSBuildToolPath) and fix "Clean" not working on PS4 due to include/library paths being set to something by the Visual Studio environment.
Change 3210598 on 2016/11/27 by Ben.Marsh
UBT: Prevent the name of each file compiled being output twice on XboxOne. Compiler already outputs this string; the action doesn't need to.
Change 3210601 on 2016/11/27 by Ben.Marsh
PR #2967: Add silent version of switch game version (Contributed by EricLeeFriedman)
Change 3210602 on 2016/11/27 by Ben.Marsh
PR #2964: GitDependencies shouldn't try to clean up working directory files that are excluded or ignored (Contributed by joelmcginnis)
Change 3210605 on 2016/11/27 by Ben.Marsh
UGS: Add a warning when syncing latest would remove changes that have been authored locally. Typically happens when working with precompiled binaries.
Change 3211656 on 2016/11/28 by Ben.Marsh
UBT: Move ModuleRules and TargetRules into their own file.
Change 3211797 on 2016/11/28 by Ben.Marsh
UBT: Remove utility functions from TargetRules for checking different classes of target types. Moving TargetRules to be data-only.
Change 3211833 on 2016/11/28 by Ben.Marsh
UBT: Remove overridable configuration name from target rules. This feature is not used anywhere.
Change 3211859 on 2016/11/28 by Ben.Marsh
UBT: Deprecate the GetGeneratedCodeVersion() callback in favor of a member variable instead.
Change 3211942 on 2016/11/28 by Ben.Marsh
UBT: Remove legacy code which tries to change the output paths for console binaries. Output paths for monolithic binaries are always in the project folder now.
Change 3215333 on 2016/11/30 by Ben.Marsh
UBT: Replace the GetSupportedPlatforms() callback on TargetRules with a SupportedPlatforms attribute. Since a TargetRules object can only be instantiated with an actual platform, it doesn't make sense for it to be an instance method.
Change 3215482 on 2016/11/30 by Ben.Marsh
UBT: Remove the GetSupportedConfigurations() callback on the TargetRules class. A configuration is required to construct a TargetRules instance, so it doesn't make sense to need to call an instance method to find out which configurations are supported.
Change 3215743 on 2016/11/30 by Ben.Marsh
UBT: Deprecate the TargetRules.ShouldCompileMonolithic() function: this function requires access to the global command line to operate correctly, which prevents creating target-specific instances, and does not use the platform/configuration passed into the TargetRules constructor.
Rather than being a callback, the LinkType field can now be set to TargetLinkType.Modular or TargetLinkType.Monolithic from the constructor as appropriate. The default value (TargetLinkType.Default) results in the default link type for the target type being used. Parsing of the command-line overrides is now done when building the TargetDescriptor.
Change 3215778 on 2016/11/30 by Ben.Marsh
UBT: Mark overrides of the TargetRules.GetModulesToPrecompile method as obsolete.
Change 3217681 on 2016/12/01 by Ben.Marsh
UAT: Prevent UE4Build deleting .modules files when running with the -Clean argument; these files are artifacts generated by UBT itself, not by the exported XGE script.
Change 3217723 on 2016/12/01 by Ben.Marsh
UBT: Run pre- and post-build steps for all plugins that are being built, not just those that are enabled.
Change 3217930 on 2016/12/01 by Ben.Marsh
UGS: Add a perforce settings window, allowing users to set optional values for tuning Perforce performance on unreliable connections.
Change 3218762 on 2016/12/02 by Ben.Marsh
Enable warnings whenever an undefined macro is used in a constant expression inside an #if or #elif directive, and fix existing violations.
Change 3219161 on 2016/12/02 by Ben.Marsh
Core: Use the directory containing the current module to derive the UE4 base directory, rather than the executable directory. Allows UE4 to be hosted by a process in a different directory.
Change 3219197 on 2016/12/02 by Ben.Marsh
Core: When loading a DLL from disk, convert any relative paths to absolute before calling LoadLibrary. The OS resolves these paths relative to the directory containing the process executable -- not the working directory -- so paths need to be absolute to allow UE4 to be hosted by a process elsewhere.
Change 3219209 on 2016/12/02 by Ben.Marsh
Replace some calls to LoadLibrary() with FPlatformProcess::GetDllHandle(). The UE4 function makes sure that relative paths are resolved relative to the correct base directory, which is important when the host executable is not in Engine/Binaries/Win64.
Change 3219610 on 2016/12/02 by Ben.Marsh
Add the -q (quiet) option to the Mac unzip command, since it's creating too much log output to be useful.
Change 3219731 on 2016/12/02 by Ben.Marsh
UBT: Add option to disable IWYU checks regarding the use of monolithic headers (Engine.h, UnrealEd.h, etc...) and including the matching header for a cpp file first. bEnforceIWYU can be set to false in UEBuildConfiguration or on a per-module basis in the module rules.
Change 3220796 on 2016/12/04 by Ben.Marsh
Remove PrepForUATPackageOrDeploy from the UEBuildDeploy base class. It never has to be accessed through the base class anyway.
Change 3220825 on 2016/12/04 by Ben.Marsh
UBT: Change all executors to derive from a common base class (ActionExecutor).
Change 3220834 on 2016/12/04 by Ben.Marsh
UBT: Remove the global CommandLineContains() function.
Change 3222706 on 2016/12/05 by Ben.Marsh
Merging CL 3221949 from //UE4/Release-4.14: Fixes to code analysis template causing problems with stock install of VS2017.
Change 3222712 on 2016/12/05 by Ben.Marsh
Merging CL 3222021 from //UE4/Release-4.14: Change detection of MSBuild.exe path to match GetMSBuildPath.bat
Change 3223628 on 2016/12/06 by Ben.Marsh
Merging CL 3223369 from 4.14 branch: Use the same logic as GetMsBuildPath.bat inside FDesktopPlatformBase to determine path to MSBuild.exe
Change 3223817 on 2016/12/06 by Ben.Marsh
Remove non-ANSI characters from source files. Compiler/P4 support is patchy for this, and we want to avoid failing prey to different codepages resulting in different interpretations of the source text.
Change 3224046 on 2016/12/06 by Ben.Marsh
Remove the need for the iOS/TVOS deployment instances to have an IOSPlatformContext instance. The only dependency between the two -- a call to GetRequiredCapabilities() -- is now implemented by querying the INI file for the supported architectures when neeeded.
Change 3224792 on 2016/12/07 by Ben.Marsh
UBT: Touch PCH wrapper files whenever the file they include is newer rather than writing the timestamp for the included file into it as a comment. Allows use of ccache and similar tools.
Change 3225212 on 2016/12/07 by Ben.Marsh
UBT: Move settings required for deployment into the UEBuildDeployTarget class, allowing them to be serialized to and from a file the intermediate directory without having to construct a phony UEBuildTarget to deploy.
Deployment is now performed by a method on UEBuildPlatform, rather than having to create a UEBuildPlatformContext and using that to create a UEBuildDeploy object.
The -prepfordeploy UBT invocation from UAT, previously done by the per-platform PostBuildTarget() callback when building with XGE, is replaced by running UBT with a path to the serialized UEBuildDeployTarget object, and can be done in a platform agnostic manner.
Change 3226310 on 2016/12/07 by Ben.Marsh
PR #3015: Fixes wrong VSC++ flags being passed for .c files (Contributed by badlogic)
Change 3228273 on 2016/12/08 by Ben.Marsh
Update copyright notices for QAGame.
Change 3229166 on 2016/12/09 by Ben.Marsh
UBT: Rewritten config file parser. No longer requires hard-coded list of sections to be parsed, but parses them on demand. Measured 2x faster read speeds (largely due to eliminating construction of temporary string objects when parsing each line, to trim whitespace and so on). Also includes an attribute-driven parser, which allows reading named config values for marked up fields in an object.
Change 3230601 on 2016/12/12 by Ben.Marsh
Swarm: Change Swarm AgentInterface to target .NET framework 4.5, to remove dependency on having 4.0 framework installed.
Change 3230737 on 2016/12/12 by Ben.Marsh
UAT: Stop UE4Build deriving from CommandUtils. Confusing pattern, and causes problems trying to access instance variables that are only set for build commands.
Change 3230751 on 2016/12/12 by Ben.Marsh
UAT: Move ParseParam*() functions which use the instanced parameter list from CommandUtils to BuildCommand, since that's the only thing that it's instanced for.
Change 3230804 on 2016/12/12 by Ben.Marsh
UBT: Add the IsPromotedBuild flag to Build.version, and only set the bFormalBuild flag in UBT if it's set. This allows UGS users to avoid having to compile separate RC files for each output binary.
Change 3230831 on 2016/12/12 by Ben.Marsh
UGS: Warn when trying to switch streams if files are checked out.
Change 3231281 on 2016/12/12 by Chad.Garyet
Fixing a bug where .modules files were getting put into receipts with their absolute path instead of their relative one
Change 3231496 on 2016/12/12 by Ben.Marsh
Disable code analysis in CrashReportProcess; causes warnings when compiled with VS2015.
Change 3231979 on 2016/12/12 by Ben.Marsh
UBT: Suppress LNK4221 when generating import libraries. This can happen often when generating import libraries separately to linking.
Change 3232619 on 2016/12/13 by Ben.Marsh
Fix "#pragma once in main file" errors on Mac, which are occurring in //UE4/Main.
[CL 3232653 by Ben Marsh in Main branch]
2016-12-13 11:58:16 -05:00
# if PLATFORM_WINDOWS
# include "WindowsHWrapper.h"
# include "AllowWindowsPlatformTypes.h"
# include <ShlObj.h>
# include "HideWindowsPlatformTypes.h"
static bool TryReadMsBuildInstallPath ( HKEY RootKey , const TCHAR * KeyName , const TCHAR * ValueName , const TCHAR * MsBuildRelativePath , FString & OutMsBuildPath )
{
FString Value ;
if ( ! FWindowsPlatformMisc : : QueryRegKey ( RootKey , KeyName , ValueName , Value ) )
{
return false ;
}
FString Result = Value / MsBuildRelativePath ;
if ( ! FPaths : : FileExists ( Result ) )
{
return false ;
}
OutMsBuildPath = Result ;
return true ;
}
static bool TryReadMsBuildInstallPath ( const TCHAR * KeyRelativeName , const TCHAR * ValueName , const TCHAR * MsBuildRelativePath , FString & OutMsBuildPath )
{
if ( TryReadMsBuildInstallPath ( HKEY_CURRENT_USER , * ( FString ( " SOFTWARE \\ " ) + KeyRelativeName ) , ValueName , MsBuildRelativePath , OutMsBuildPath ) )
{
return true ;
}
if ( TryReadMsBuildInstallPath ( HKEY_LOCAL_MACHINE , * ( FString ( " SOFTWARE \\ " ) + KeyRelativeName ) , ValueName , MsBuildRelativePath , OutMsBuildPath ) )
{
return true ;
}
if ( TryReadMsBuildInstallPath ( HKEY_CURRENT_USER , * ( FString ( " SOFTWARE \\ Wow6432Node \\ " ) + KeyRelativeName ) , ValueName , MsBuildRelativePath , OutMsBuildPath ) )
{
return true ;
}
if ( TryReadMsBuildInstallPath ( HKEY_LOCAL_MACHINE , * ( FString ( " SOFTWARE \\ Wow6432Node \\ " ) + KeyRelativeName ) , ValueName , MsBuildRelativePath , OutMsBuildPath ) )
{
return true ;
}
return false ;
}
static bool TryReadMsBuildInstallPath ( FString & OutPath )
{
// Try to get the MSBuild 14.0 path directly (see https://msdn.microsoft.com/en-us/library/hh162058(v=vs.120).aspx)
TCHAR ProgramFilesX86 [ MAX_PATH ] ;
if ( SUCCEEDED ( SHGetFolderPath ( NULL , CSIDL_PROGRAM_FILES | CSIDL_FLAG_CREATE , NULL , SHGFP_TYPE_CURRENT , ProgramFilesX86 ) ) )
{
FString ToolPath = FString ( ProgramFilesX86 ) / TEXT ( " MSBuild/14.0/bin/MSBuild.exe " ) ;
if ( FPaths : : FileExists ( ToolPath ) )
{
OutPath = ToolPath ;
return true ;
}
}
// Try to get the MSBuild 14.0 path from the registry
if ( TryReadMsBuildInstallPath ( TEXT ( " Microsoft \\ MSBuild \\ ToolsVersions \\ 14.0 " ) , TEXT ( " MSBuildToolsPath " ) , TEXT ( " MSBuild.exe " ) , OutPath ) )
{
return true ;
}
// Check for MSBuild 15. This is installed alongside Visual Studio 2017, so we get the path relative to that.
if ( TryReadMsBuildInstallPath ( TEXT ( " Microsoft \\ VisualStudio \\ SxS \\ VS7 " ) , TEXT ( " 15.0 " ) , TEXT ( " MSBuild \\ 15.0 \\ bin \\ MSBuild.exe " ) , OutPath ) )
{
return true ;
}
// Check for older versions of MSBuild. These are registered as separate versions in the registry.
if ( TryReadMsBuildInstallPath ( TEXT ( " Microsoft \\ MSBuild \\ ToolsVersions \\ 12.0 " ) , TEXT ( " MSBuildToolsPath " ) , TEXT ( " MSBuild.exe " ) , OutPath ) )
{
return true ;
}
if ( TryReadMsBuildInstallPath ( TEXT ( " Microsoft \\ MSBuild \\ ToolsVersions \\ 4.0 " ) , TEXT ( " MSBuildToolsPath " ) , TEXT ( " MSBuild.exe " ) , OutPath ) )
{
return true ;
}
return false ;
}
# endif
2015-01-29 16:15:16 -05:00
bool FDesktopPlatformBase : : BuildUnrealBuildTool ( const FString & RootDir , FOutputDevice & Ar )
2014-09-05 13:31:22 -04:00
{
2015-01-29 16:15:16 -05:00
Ar . Logf ( TEXT ( " Building UnrealBuildTool in %s... " ) , * RootDir ) ;
2014-09-05 13:31:22 -04:00
2015-01-29 16:15:16 -05:00
// Check the project file exists
FString CsProjLocation = GetUnrealBuildToolProjectFileName ( RootDir ) ;
if ( ! FPaths : : FileExists ( CsProjLocation ) )
{
Ar . Logf ( TEXT ( " Project file not found at %s " ) , * CsProjLocation ) ;
return false ;
}
2014-09-05 13:31:22 -04:00
FString CompilerExecutableFilename ;
FString CmdLineParams ;
2015-03-17 18:47:43 -04:00
if ( PLATFORM_WINDOWS )
2014-09-05 13:31:22 -04:00
{
2015-03-17 18:47:43 -04:00
# if PLATFORM_WINDOWS
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3232619)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3121996 on 2016/09/12 by Ben.Marsh
Add support for Visual Studio 2017 (aka "15"; assuming consistent naming with other versions until final name is announced).
* Compiler, STL implementation and CRT are binary compatible with VS2015 (see https://blogs.msdn.microsoft.com/vcblog/2016/08/24/c1417-features-and-stl-fixes-in-vs-15-preview-4/), so no new third-party libraries needed so far. WindowsPlatform.GetVisualStudioCompilerVersionName() returns "2015" as a result.
* Default compiler for compiling and generating project files is still VS 2015 for now. Pass -2017 on the command line to GenerateProjectFiles.bat to generate VS2017 projects. Projects generated for VS2017 will use the 2017 compiler by default.
* Visual Studio source code accessor can talk to VS 2017 instances.
* Added a VS2017 configuration for UnrealVS, and added precompiled vsix package.
* Switched GetVSComnTools to check the SOFTWARE\Microsoft\VisualStudio\SxS\VS7 registry key rather than the individual product install registry key. "15" doesn't seem to have it's own "InstallDir" key, but this system seems to work for all versions of Visual Studio (including previous releases of VS Express).
* Removed ATL dependency from VisualStudioSourceCodeAccessor. It's not installed with VS by default any more, and is only used for a couple of smart pointer classes.
Tested running the editor and packaging TP_Flying for Win64. Packaging from the editor still defaults to using the 2015 compiler, so ConfigureToolchain() needs to be overriden from the .target.cs file if multiple Visual Studio versions are installed.
Change 3189363 on 2016/11/07 by Ben.Marsh
Consolidate functionality for determining the path to MSBuild.exe to use for compiling UE4 tools into a single batch file (GetMSBuildToolPath) and fix "Clean" not working on PS4 due to include/library paths being set to something by the Visual Studio environment.
Change 3210598 on 2016/11/27 by Ben.Marsh
UBT: Prevent the name of each file compiled being output twice on XboxOne. Compiler already outputs this string; the action doesn't need to.
Change 3210601 on 2016/11/27 by Ben.Marsh
PR #2967: Add silent version of switch game version (Contributed by EricLeeFriedman)
Change 3210602 on 2016/11/27 by Ben.Marsh
PR #2964: GitDependencies shouldn't try to clean up working directory files that are excluded or ignored (Contributed by joelmcginnis)
Change 3210605 on 2016/11/27 by Ben.Marsh
UGS: Add a warning when syncing latest would remove changes that have been authored locally. Typically happens when working with precompiled binaries.
Change 3211656 on 2016/11/28 by Ben.Marsh
UBT: Move ModuleRules and TargetRules into their own file.
Change 3211797 on 2016/11/28 by Ben.Marsh
UBT: Remove utility functions from TargetRules for checking different classes of target types. Moving TargetRules to be data-only.
Change 3211833 on 2016/11/28 by Ben.Marsh
UBT: Remove overridable configuration name from target rules. This feature is not used anywhere.
Change 3211859 on 2016/11/28 by Ben.Marsh
UBT: Deprecate the GetGeneratedCodeVersion() callback in favor of a member variable instead.
Change 3211942 on 2016/11/28 by Ben.Marsh
UBT: Remove legacy code which tries to change the output paths for console binaries. Output paths for monolithic binaries are always in the project folder now.
Change 3215333 on 2016/11/30 by Ben.Marsh
UBT: Replace the GetSupportedPlatforms() callback on TargetRules with a SupportedPlatforms attribute. Since a TargetRules object can only be instantiated with an actual platform, it doesn't make sense for it to be an instance method.
Change 3215482 on 2016/11/30 by Ben.Marsh
UBT: Remove the GetSupportedConfigurations() callback on the TargetRules class. A configuration is required to construct a TargetRules instance, so it doesn't make sense to need to call an instance method to find out which configurations are supported.
Change 3215743 on 2016/11/30 by Ben.Marsh
UBT: Deprecate the TargetRules.ShouldCompileMonolithic() function: this function requires access to the global command line to operate correctly, which prevents creating target-specific instances, and does not use the platform/configuration passed into the TargetRules constructor.
Rather than being a callback, the LinkType field can now be set to TargetLinkType.Modular or TargetLinkType.Monolithic from the constructor as appropriate. The default value (TargetLinkType.Default) results in the default link type for the target type being used. Parsing of the command-line overrides is now done when building the TargetDescriptor.
Change 3215778 on 2016/11/30 by Ben.Marsh
UBT: Mark overrides of the TargetRules.GetModulesToPrecompile method as obsolete.
Change 3217681 on 2016/12/01 by Ben.Marsh
UAT: Prevent UE4Build deleting .modules files when running with the -Clean argument; these files are artifacts generated by UBT itself, not by the exported XGE script.
Change 3217723 on 2016/12/01 by Ben.Marsh
UBT: Run pre- and post-build steps for all plugins that are being built, not just those that are enabled.
Change 3217930 on 2016/12/01 by Ben.Marsh
UGS: Add a perforce settings window, allowing users to set optional values for tuning Perforce performance on unreliable connections.
Change 3218762 on 2016/12/02 by Ben.Marsh
Enable warnings whenever an undefined macro is used in a constant expression inside an #if or #elif directive, and fix existing violations.
Change 3219161 on 2016/12/02 by Ben.Marsh
Core: Use the directory containing the current module to derive the UE4 base directory, rather than the executable directory. Allows UE4 to be hosted by a process in a different directory.
Change 3219197 on 2016/12/02 by Ben.Marsh
Core: When loading a DLL from disk, convert any relative paths to absolute before calling LoadLibrary. The OS resolves these paths relative to the directory containing the process executable -- not the working directory -- so paths need to be absolute to allow UE4 to be hosted by a process elsewhere.
Change 3219209 on 2016/12/02 by Ben.Marsh
Replace some calls to LoadLibrary() with FPlatformProcess::GetDllHandle(). The UE4 function makes sure that relative paths are resolved relative to the correct base directory, which is important when the host executable is not in Engine/Binaries/Win64.
Change 3219610 on 2016/12/02 by Ben.Marsh
Add the -q (quiet) option to the Mac unzip command, since it's creating too much log output to be useful.
Change 3219731 on 2016/12/02 by Ben.Marsh
UBT: Add option to disable IWYU checks regarding the use of monolithic headers (Engine.h, UnrealEd.h, etc...) and including the matching header for a cpp file first. bEnforceIWYU can be set to false in UEBuildConfiguration or on a per-module basis in the module rules.
Change 3220796 on 2016/12/04 by Ben.Marsh
Remove PrepForUATPackageOrDeploy from the UEBuildDeploy base class. It never has to be accessed through the base class anyway.
Change 3220825 on 2016/12/04 by Ben.Marsh
UBT: Change all executors to derive from a common base class (ActionExecutor).
Change 3220834 on 2016/12/04 by Ben.Marsh
UBT: Remove the global CommandLineContains() function.
Change 3222706 on 2016/12/05 by Ben.Marsh
Merging CL 3221949 from //UE4/Release-4.14: Fixes to code analysis template causing problems with stock install of VS2017.
Change 3222712 on 2016/12/05 by Ben.Marsh
Merging CL 3222021 from //UE4/Release-4.14: Change detection of MSBuild.exe path to match GetMSBuildPath.bat
Change 3223628 on 2016/12/06 by Ben.Marsh
Merging CL 3223369 from 4.14 branch: Use the same logic as GetMsBuildPath.bat inside FDesktopPlatformBase to determine path to MSBuild.exe
Change 3223817 on 2016/12/06 by Ben.Marsh
Remove non-ANSI characters from source files. Compiler/P4 support is patchy for this, and we want to avoid failing prey to different codepages resulting in different interpretations of the source text.
Change 3224046 on 2016/12/06 by Ben.Marsh
Remove the need for the iOS/TVOS deployment instances to have an IOSPlatformContext instance. The only dependency between the two -- a call to GetRequiredCapabilities() -- is now implemented by querying the INI file for the supported architectures when neeeded.
Change 3224792 on 2016/12/07 by Ben.Marsh
UBT: Touch PCH wrapper files whenever the file they include is newer rather than writing the timestamp for the included file into it as a comment. Allows use of ccache and similar tools.
Change 3225212 on 2016/12/07 by Ben.Marsh
UBT: Move settings required for deployment into the UEBuildDeployTarget class, allowing them to be serialized to and from a file the intermediate directory without having to construct a phony UEBuildTarget to deploy.
Deployment is now performed by a method on UEBuildPlatform, rather than having to create a UEBuildPlatformContext and using that to create a UEBuildDeploy object.
The -prepfordeploy UBT invocation from UAT, previously done by the per-platform PostBuildTarget() callback when building with XGE, is replaced by running UBT with a path to the serialized UEBuildDeployTarget object, and can be done in a platform agnostic manner.
Change 3226310 on 2016/12/07 by Ben.Marsh
PR #3015: Fixes wrong VSC++ flags being passed for .c files (Contributed by badlogic)
Change 3228273 on 2016/12/08 by Ben.Marsh
Update copyright notices for QAGame.
Change 3229166 on 2016/12/09 by Ben.Marsh
UBT: Rewritten config file parser. No longer requires hard-coded list of sections to be parsed, but parses them on demand. Measured 2x faster read speeds (largely due to eliminating construction of temporary string objects when parsing each line, to trim whitespace and so on). Also includes an attribute-driven parser, which allows reading named config values for marked up fields in an object.
Change 3230601 on 2016/12/12 by Ben.Marsh
Swarm: Change Swarm AgentInterface to target .NET framework 4.5, to remove dependency on having 4.0 framework installed.
Change 3230737 on 2016/12/12 by Ben.Marsh
UAT: Stop UE4Build deriving from CommandUtils. Confusing pattern, and causes problems trying to access instance variables that are only set for build commands.
Change 3230751 on 2016/12/12 by Ben.Marsh
UAT: Move ParseParam*() functions which use the instanced parameter list from CommandUtils to BuildCommand, since that's the only thing that it's instanced for.
Change 3230804 on 2016/12/12 by Ben.Marsh
UBT: Add the IsPromotedBuild flag to Build.version, and only set the bFormalBuild flag in UBT if it's set. This allows UGS users to avoid having to compile separate RC files for each output binary.
Change 3230831 on 2016/12/12 by Ben.Marsh
UGS: Warn when trying to switch streams if files are checked out.
Change 3231281 on 2016/12/12 by Chad.Garyet
Fixing a bug where .modules files were getting put into receipts with their absolute path instead of their relative one
Change 3231496 on 2016/12/12 by Ben.Marsh
Disable code analysis in CrashReportProcess; causes warnings when compiled with VS2015.
Change 3231979 on 2016/12/12 by Ben.Marsh
UBT: Suppress LNK4221 when generating import libraries. This can happen often when generating import libraries separately to linking.
Change 3232619 on 2016/12/13 by Ben.Marsh
Fix "#pragma once in main file" errors on Mac, which are occurring in //UE4/Main.
[CL 3232653 by Ben Marsh in Main branch]
2016-12-13 11:58:16 -05:00
if ( ! TryReadMsBuildInstallPath ( CompilerExecutableFilename ) )
2015-03-17 18:47:43 -04:00
{
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3232619)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3121996 on 2016/09/12 by Ben.Marsh
Add support for Visual Studio 2017 (aka "15"; assuming consistent naming with other versions until final name is announced).
* Compiler, STL implementation and CRT are binary compatible with VS2015 (see https://blogs.msdn.microsoft.com/vcblog/2016/08/24/c1417-features-and-stl-fixes-in-vs-15-preview-4/), so no new third-party libraries needed so far. WindowsPlatform.GetVisualStudioCompilerVersionName() returns "2015" as a result.
* Default compiler for compiling and generating project files is still VS 2015 for now. Pass -2017 on the command line to GenerateProjectFiles.bat to generate VS2017 projects. Projects generated for VS2017 will use the 2017 compiler by default.
* Visual Studio source code accessor can talk to VS 2017 instances.
* Added a VS2017 configuration for UnrealVS, and added precompiled vsix package.
* Switched GetVSComnTools to check the SOFTWARE\Microsoft\VisualStudio\SxS\VS7 registry key rather than the individual product install registry key. "15" doesn't seem to have it's own "InstallDir" key, but this system seems to work for all versions of Visual Studio (including previous releases of VS Express).
* Removed ATL dependency from VisualStudioSourceCodeAccessor. It's not installed with VS by default any more, and is only used for a couple of smart pointer classes.
Tested running the editor and packaging TP_Flying for Win64. Packaging from the editor still defaults to using the 2015 compiler, so ConfigureToolchain() needs to be overriden from the .target.cs file if multiple Visual Studio versions are installed.
Change 3189363 on 2016/11/07 by Ben.Marsh
Consolidate functionality for determining the path to MSBuild.exe to use for compiling UE4 tools into a single batch file (GetMSBuildToolPath) and fix "Clean" not working on PS4 due to include/library paths being set to something by the Visual Studio environment.
Change 3210598 on 2016/11/27 by Ben.Marsh
UBT: Prevent the name of each file compiled being output twice on XboxOne. Compiler already outputs this string; the action doesn't need to.
Change 3210601 on 2016/11/27 by Ben.Marsh
PR #2967: Add silent version of switch game version (Contributed by EricLeeFriedman)
Change 3210602 on 2016/11/27 by Ben.Marsh
PR #2964: GitDependencies shouldn't try to clean up working directory files that are excluded or ignored (Contributed by joelmcginnis)
Change 3210605 on 2016/11/27 by Ben.Marsh
UGS: Add a warning when syncing latest would remove changes that have been authored locally. Typically happens when working with precompiled binaries.
Change 3211656 on 2016/11/28 by Ben.Marsh
UBT: Move ModuleRules and TargetRules into their own file.
Change 3211797 on 2016/11/28 by Ben.Marsh
UBT: Remove utility functions from TargetRules for checking different classes of target types. Moving TargetRules to be data-only.
Change 3211833 on 2016/11/28 by Ben.Marsh
UBT: Remove overridable configuration name from target rules. This feature is not used anywhere.
Change 3211859 on 2016/11/28 by Ben.Marsh
UBT: Deprecate the GetGeneratedCodeVersion() callback in favor of a member variable instead.
Change 3211942 on 2016/11/28 by Ben.Marsh
UBT: Remove legacy code which tries to change the output paths for console binaries. Output paths for monolithic binaries are always in the project folder now.
Change 3215333 on 2016/11/30 by Ben.Marsh
UBT: Replace the GetSupportedPlatforms() callback on TargetRules with a SupportedPlatforms attribute. Since a TargetRules object can only be instantiated with an actual platform, it doesn't make sense for it to be an instance method.
Change 3215482 on 2016/11/30 by Ben.Marsh
UBT: Remove the GetSupportedConfigurations() callback on the TargetRules class. A configuration is required to construct a TargetRules instance, so it doesn't make sense to need to call an instance method to find out which configurations are supported.
Change 3215743 on 2016/11/30 by Ben.Marsh
UBT: Deprecate the TargetRules.ShouldCompileMonolithic() function: this function requires access to the global command line to operate correctly, which prevents creating target-specific instances, and does not use the platform/configuration passed into the TargetRules constructor.
Rather than being a callback, the LinkType field can now be set to TargetLinkType.Modular or TargetLinkType.Monolithic from the constructor as appropriate. The default value (TargetLinkType.Default) results in the default link type for the target type being used. Parsing of the command-line overrides is now done when building the TargetDescriptor.
Change 3215778 on 2016/11/30 by Ben.Marsh
UBT: Mark overrides of the TargetRules.GetModulesToPrecompile method as obsolete.
Change 3217681 on 2016/12/01 by Ben.Marsh
UAT: Prevent UE4Build deleting .modules files when running with the -Clean argument; these files are artifacts generated by UBT itself, not by the exported XGE script.
Change 3217723 on 2016/12/01 by Ben.Marsh
UBT: Run pre- and post-build steps for all plugins that are being built, not just those that are enabled.
Change 3217930 on 2016/12/01 by Ben.Marsh
UGS: Add a perforce settings window, allowing users to set optional values for tuning Perforce performance on unreliable connections.
Change 3218762 on 2016/12/02 by Ben.Marsh
Enable warnings whenever an undefined macro is used in a constant expression inside an #if or #elif directive, and fix existing violations.
Change 3219161 on 2016/12/02 by Ben.Marsh
Core: Use the directory containing the current module to derive the UE4 base directory, rather than the executable directory. Allows UE4 to be hosted by a process in a different directory.
Change 3219197 on 2016/12/02 by Ben.Marsh
Core: When loading a DLL from disk, convert any relative paths to absolute before calling LoadLibrary. The OS resolves these paths relative to the directory containing the process executable -- not the working directory -- so paths need to be absolute to allow UE4 to be hosted by a process elsewhere.
Change 3219209 on 2016/12/02 by Ben.Marsh
Replace some calls to LoadLibrary() with FPlatformProcess::GetDllHandle(). The UE4 function makes sure that relative paths are resolved relative to the correct base directory, which is important when the host executable is not in Engine/Binaries/Win64.
Change 3219610 on 2016/12/02 by Ben.Marsh
Add the -q (quiet) option to the Mac unzip command, since it's creating too much log output to be useful.
Change 3219731 on 2016/12/02 by Ben.Marsh
UBT: Add option to disable IWYU checks regarding the use of monolithic headers (Engine.h, UnrealEd.h, etc...) and including the matching header for a cpp file first. bEnforceIWYU can be set to false in UEBuildConfiguration or on a per-module basis in the module rules.
Change 3220796 on 2016/12/04 by Ben.Marsh
Remove PrepForUATPackageOrDeploy from the UEBuildDeploy base class. It never has to be accessed through the base class anyway.
Change 3220825 on 2016/12/04 by Ben.Marsh
UBT: Change all executors to derive from a common base class (ActionExecutor).
Change 3220834 on 2016/12/04 by Ben.Marsh
UBT: Remove the global CommandLineContains() function.
Change 3222706 on 2016/12/05 by Ben.Marsh
Merging CL 3221949 from //UE4/Release-4.14: Fixes to code analysis template causing problems with stock install of VS2017.
Change 3222712 on 2016/12/05 by Ben.Marsh
Merging CL 3222021 from //UE4/Release-4.14: Change detection of MSBuild.exe path to match GetMSBuildPath.bat
Change 3223628 on 2016/12/06 by Ben.Marsh
Merging CL 3223369 from 4.14 branch: Use the same logic as GetMsBuildPath.bat inside FDesktopPlatformBase to determine path to MSBuild.exe
Change 3223817 on 2016/12/06 by Ben.Marsh
Remove non-ANSI characters from source files. Compiler/P4 support is patchy for this, and we want to avoid failing prey to different codepages resulting in different interpretations of the source text.
Change 3224046 on 2016/12/06 by Ben.Marsh
Remove the need for the iOS/TVOS deployment instances to have an IOSPlatformContext instance. The only dependency between the two -- a call to GetRequiredCapabilities() -- is now implemented by querying the INI file for the supported architectures when neeeded.
Change 3224792 on 2016/12/07 by Ben.Marsh
UBT: Touch PCH wrapper files whenever the file they include is newer rather than writing the timestamp for the included file into it as a comment. Allows use of ccache and similar tools.
Change 3225212 on 2016/12/07 by Ben.Marsh
UBT: Move settings required for deployment into the UEBuildDeployTarget class, allowing them to be serialized to and from a file the intermediate directory without having to construct a phony UEBuildTarget to deploy.
Deployment is now performed by a method on UEBuildPlatform, rather than having to create a UEBuildPlatformContext and using that to create a UEBuildDeploy object.
The -prepfordeploy UBT invocation from UAT, previously done by the per-platform PostBuildTarget() callback when building with XGE, is replaced by running UBT with a path to the serialized UEBuildDeployTarget object, and can be done in a platform agnostic manner.
Change 3226310 on 2016/12/07 by Ben.Marsh
PR #3015: Fixes wrong VSC++ flags being passed for .c files (Contributed by badlogic)
Change 3228273 on 2016/12/08 by Ben.Marsh
Update copyright notices for QAGame.
Change 3229166 on 2016/12/09 by Ben.Marsh
UBT: Rewritten config file parser. No longer requires hard-coded list of sections to be parsed, but parses them on demand. Measured 2x faster read speeds (largely due to eliminating construction of temporary string objects when parsing each line, to trim whitespace and so on). Also includes an attribute-driven parser, which allows reading named config values for marked up fields in an object.
Change 3230601 on 2016/12/12 by Ben.Marsh
Swarm: Change Swarm AgentInterface to target .NET framework 4.5, to remove dependency on having 4.0 framework installed.
Change 3230737 on 2016/12/12 by Ben.Marsh
UAT: Stop UE4Build deriving from CommandUtils. Confusing pattern, and causes problems trying to access instance variables that are only set for build commands.
Change 3230751 on 2016/12/12 by Ben.Marsh
UAT: Move ParseParam*() functions which use the instanced parameter list from CommandUtils to BuildCommand, since that's the only thing that it's instanced for.
Change 3230804 on 2016/12/12 by Ben.Marsh
UBT: Add the IsPromotedBuild flag to Build.version, and only set the bFormalBuild flag in UBT if it's set. This allows UGS users to avoid having to compile separate RC files for each output binary.
Change 3230831 on 2016/12/12 by Ben.Marsh
UGS: Warn when trying to switch streams if files are checked out.
Change 3231281 on 2016/12/12 by Chad.Garyet
Fixing a bug where .modules files were getting put into receipts with their absolute path instead of their relative one
Change 3231496 on 2016/12/12 by Ben.Marsh
Disable code analysis in CrashReportProcess; causes warnings when compiled with VS2015.
Change 3231979 on 2016/12/12 by Ben.Marsh
UBT: Suppress LNK4221 when generating import libraries. This can happen often when generating import libraries separately to linking.
Change 3232619 on 2016/12/13 by Ben.Marsh
Fix "#pragma once in main file" errors on Mac, which are occurring in //UE4/Main.
[CL 3232653 by Ben Marsh in Main branch]
2016-12-13 11:58:16 -05:00
Ar . Logf ( TEXT ( " Couldn't find MSBuild installation; skipping. " ) ) ;
2015-03-17 18:47:43 -04:00
return false ;
}
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3232619)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3121996 on 2016/09/12 by Ben.Marsh
Add support for Visual Studio 2017 (aka "15"; assuming consistent naming with other versions until final name is announced).
* Compiler, STL implementation and CRT are binary compatible with VS2015 (see https://blogs.msdn.microsoft.com/vcblog/2016/08/24/c1417-features-and-stl-fixes-in-vs-15-preview-4/), so no new third-party libraries needed so far. WindowsPlatform.GetVisualStudioCompilerVersionName() returns "2015" as a result.
* Default compiler for compiling and generating project files is still VS 2015 for now. Pass -2017 on the command line to GenerateProjectFiles.bat to generate VS2017 projects. Projects generated for VS2017 will use the 2017 compiler by default.
* Visual Studio source code accessor can talk to VS 2017 instances.
* Added a VS2017 configuration for UnrealVS, and added precompiled vsix package.
* Switched GetVSComnTools to check the SOFTWARE\Microsoft\VisualStudio\SxS\VS7 registry key rather than the individual product install registry key. "15" doesn't seem to have it's own "InstallDir" key, but this system seems to work for all versions of Visual Studio (including previous releases of VS Express).
* Removed ATL dependency from VisualStudioSourceCodeAccessor. It's not installed with VS by default any more, and is only used for a couple of smart pointer classes.
Tested running the editor and packaging TP_Flying for Win64. Packaging from the editor still defaults to using the 2015 compiler, so ConfigureToolchain() needs to be overriden from the .target.cs file if multiple Visual Studio versions are installed.
Change 3189363 on 2016/11/07 by Ben.Marsh
Consolidate functionality for determining the path to MSBuild.exe to use for compiling UE4 tools into a single batch file (GetMSBuildToolPath) and fix "Clean" not working on PS4 due to include/library paths being set to something by the Visual Studio environment.
Change 3210598 on 2016/11/27 by Ben.Marsh
UBT: Prevent the name of each file compiled being output twice on XboxOne. Compiler already outputs this string; the action doesn't need to.
Change 3210601 on 2016/11/27 by Ben.Marsh
PR #2967: Add silent version of switch game version (Contributed by EricLeeFriedman)
Change 3210602 on 2016/11/27 by Ben.Marsh
PR #2964: GitDependencies shouldn't try to clean up working directory files that are excluded or ignored (Contributed by joelmcginnis)
Change 3210605 on 2016/11/27 by Ben.Marsh
UGS: Add a warning when syncing latest would remove changes that have been authored locally. Typically happens when working with precompiled binaries.
Change 3211656 on 2016/11/28 by Ben.Marsh
UBT: Move ModuleRules and TargetRules into their own file.
Change 3211797 on 2016/11/28 by Ben.Marsh
UBT: Remove utility functions from TargetRules for checking different classes of target types. Moving TargetRules to be data-only.
Change 3211833 on 2016/11/28 by Ben.Marsh
UBT: Remove overridable configuration name from target rules. This feature is not used anywhere.
Change 3211859 on 2016/11/28 by Ben.Marsh
UBT: Deprecate the GetGeneratedCodeVersion() callback in favor of a member variable instead.
Change 3211942 on 2016/11/28 by Ben.Marsh
UBT: Remove legacy code which tries to change the output paths for console binaries. Output paths for monolithic binaries are always in the project folder now.
Change 3215333 on 2016/11/30 by Ben.Marsh
UBT: Replace the GetSupportedPlatforms() callback on TargetRules with a SupportedPlatforms attribute. Since a TargetRules object can only be instantiated with an actual platform, it doesn't make sense for it to be an instance method.
Change 3215482 on 2016/11/30 by Ben.Marsh
UBT: Remove the GetSupportedConfigurations() callback on the TargetRules class. A configuration is required to construct a TargetRules instance, so it doesn't make sense to need to call an instance method to find out which configurations are supported.
Change 3215743 on 2016/11/30 by Ben.Marsh
UBT: Deprecate the TargetRules.ShouldCompileMonolithic() function: this function requires access to the global command line to operate correctly, which prevents creating target-specific instances, and does not use the platform/configuration passed into the TargetRules constructor.
Rather than being a callback, the LinkType field can now be set to TargetLinkType.Modular or TargetLinkType.Monolithic from the constructor as appropriate. The default value (TargetLinkType.Default) results in the default link type for the target type being used. Parsing of the command-line overrides is now done when building the TargetDescriptor.
Change 3215778 on 2016/11/30 by Ben.Marsh
UBT: Mark overrides of the TargetRules.GetModulesToPrecompile method as obsolete.
Change 3217681 on 2016/12/01 by Ben.Marsh
UAT: Prevent UE4Build deleting .modules files when running with the -Clean argument; these files are artifacts generated by UBT itself, not by the exported XGE script.
Change 3217723 on 2016/12/01 by Ben.Marsh
UBT: Run pre- and post-build steps for all plugins that are being built, not just those that are enabled.
Change 3217930 on 2016/12/01 by Ben.Marsh
UGS: Add a perforce settings window, allowing users to set optional values for tuning Perforce performance on unreliable connections.
Change 3218762 on 2016/12/02 by Ben.Marsh
Enable warnings whenever an undefined macro is used in a constant expression inside an #if or #elif directive, and fix existing violations.
Change 3219161 on 2016/12/02 by Ben.Marsh
Core: Use the directory containing the current module to derive the UE4 base directory, rather than the executable directory. Allows UE4 to be hosted by a process in a different directory.
Change 3219197 on 2016/12/02 by Ben.Marsh
Core: When loading a DLL from disk, convert any relative paths to absolute before calling LoadLibrary. The OS resolves these paths relative to the directory containing the process executable -- not the working directory -- so paths need to be absolute to allow UE4 to be hosted by a process elsewhere.
Change 3219209 on 2016/12/02 by Ben.Marsh
Replace some calls to LoadLibrary() with FPlatformProcess::GetDllHandle(). The UE4 function makes sure that relative paths are resolved relative to the correct base directory, which is important when the host executable is not in Engine/Binaries/Win64.
Change 3219610 on 2016/12/02 by Ben.Marsh
Add the -q (quiet) option to the Mac unzip command, since it's creating too much log output to be useful.
Change 3219731 on 2016/12/02 by Ben.Marsh
UBT: Add option to disable IWYU checks regarding the use of monolithic headers (Engine.h, UnrealEd.h, etc...) and including the matching header for a cpp file first. bEnforceIWYU can be set to false in UEBuildConfiguration or on a per-module basis in the module rules.
Change 3220796 on 2016/12/04 by Ben.Marsh
Remove PrepForUATPackageOrDeploy from the UEBuildDeploy base class. It never has to be accessed through the base class anyway.
Change 3220825 on 2016/12/04 by Ben.Marsh
UBT: Change all executors to derive from a common base class (ActionExecutor).
Change 3220834 on 2016/12/04 by Ben.Marsh
UBT: Remove the global CommandLineContains() function.
Change 3222706 on 2016/12/05 by Ben.Marsh
Merging CL 3221949 from //UE4/Release-4.14: Fixes to code analysis template causing problems with stock install of VS2017.
Change 3222712 on 2016/12/05 by Ben.Marsh
Merging CL 3222021 from //UE4/Release-4.14: Change detection of MSBuild.exe path to match GetMSBuildPath.bat
Change 3223628 on 2016/12/06 by Ben.Marsh
Merging CL 3223369 from 4.14 branch: Use the same logic as GetMsBuildPath.bat inside FDesktopPlatformBase to determine path to MSBuild.exe
Change 3223817 on 2016/12/06 by Ben.Marsh
Remove non-ANSI characters from source files. Compiler/P4 support is patchy for this, and we want to avoid failing prey to different codepages resulting in different interpretations of the source text.
Change 3224046 on 2016/12/06 by Ben.Marsh
Remove the need for the iOS/TVOS deployment instances to have an IOSPlatformContext instance. The only dependency between the two -- a call to GetRequiredCapabilities() -- is now implemented by querying the INI file for the supported architectures when neeeded.
Change 3224792 on 2016/12/07 by Ben.Marsh
UBT: Touch PCH wrapper files whenever the file they include is newer rather than writing the timestamp for the included file into it as a comment. Allows use of ccache and similar tools.
Change 3225212 on 2016/12/07 by Ben.Marsh
UBT: Move settings required for deployment into the UEBuildDeployTarget class, allowing them to be serialized to and from a file the intermediate directory without having to construct a phony UEBuildTarget to deploy.
Deployment is now performed by a method on UEBuildPlatform, rather than having to create a UEBuildPlatformContext and using that to create a UEBuildDeploy object.
The -prepfordeploy UBT invocation from UAT, previously done by the per-platform PostBuildTarget() callback when building with XGE, is replaced by running UBT with a path to the serialized UEBuildDeployTarget object, and can be done in a platform agnostic manner.
Change 3226310 on 2016/12/07 by Ben.Marsh
PR #3015: Fixes wrong VSC++ flags being passed for .c files (Contributed by badlogic)
Change 3228273 on 2016/12/08 by Ben.Marsh
Update copyright notices for QAGame.
Change 3229166 on 2016/12/09 by Ben.Marsh
UBT: Rewritten config file parser. No longer requires hard-coded list of sections to be parsed, but parses them on demand. Measured 2x faster read speeds (largely due to eliminating construction of temporary string objects when parsing each line, to trim whitespace and so on). Also includes an attribute-driven parser, which allows reading named config values for marked up fields in an object.
Change 3230601 on 2016/12/12 by Ben.Marsh
Swarm: Change Swarm AgentInterface to target .NET framework 4.5, to remove dependency on having 4.0 framework installed.
Change 3230737 on 2016/12/12 by Ben.Marsh
UAT: Stop UE4Build deriving from CommandUtils. Confusing pattern, and causes problems trying to access instance variables that are only set for build commands.
Change 3230751 on 2016/12/12 by Ben.Marsh
UAT: Move ParseParam*() functions which use the instanced parameter list from CommandUtils to BuildCommand, since that's the only thing that it's instanced for.
Change 3230804 on 2016/12/12 by Ben.Marsh
UBT: Add the IsPromotedBuild flag to Build.version, and only set the bFormalBuild flag in UBT if it's set. This allows UGS users to avoid having to compile separate RC files for each output binary.
Change 3230831 on 2016/12/12 by Ben.Marsh
UGS: Warn when trying to switch streams if files are checked out.
Change 3231281 on 2016/12/12 by Chad.Garyet
Fixing a bug where .modules files were getting put into receipts with their absolute path instead of their relative one
Change 3231496 on 2016/12/12 by Ben.Marsh
Disable code analysis in CrashReportProcess; causes warnings when compiled with VS2015.
Change 3231979 on 2016/12/12 by Ben.Marsh
UBT: Suppress LNK4221 when generating import libraries. This can happen often when generating import libraries separately to linking.
Change 3232619 on 2016/12/13 by Ben.Marsh
Fix "#pragma once in main file" errors on Mac, which are occurring in //UE4/Main.
[CL 3232653 by Ben Marsh in Main branch]
2016-12-13 11:58:16 -05:00
# endif
CmdLineParams = FString : : Printf ( TEXT ( " /nologo /verbosity:quiet \" %s \" /property:Configuration=Development /property:Platform=AnyCPU " ) , * CsProjLocation ) ;
2015-03-17 18:47:43 -04:00
}
else if ( PLATFORM_MAC )
{
FString ScriptPath = FPaths : : ConvertRelativePathToFull ( RootDir / TEXT ( " Engine/Build/BatchFiles/Mac/RunXBuild.sh " ) ) ;
CompilerExecutableFilename = TEXT ( " /bin/sh " ) ;
CmdLineParams = FString : : Printf ( TEXT ( " \" %s \" /property:Configuration=Development %s " ) , * ScriptPath , * CsProjLocation ) ;
}
else if ( PLATFORM_LINUX )
{
FString ScriptPath = FPaths : : ConvertRelativePathToFull ( RootDir / TEXT ( " Engine/Build/BatchFiles/Linux/RunXBuild.sh " ) ) ;
CompilerExecutableFilename = TEXT ( " /bin/bash " ) ;
CmdLineParams = FString : : Printf ( TEXT ( " \" %s \" /property:Configuration=Development /property:TargetFrameworkVersion=v4.0 %s " ) , * ScriptPath , * CsProjLocation ) ;
}
else
{
Ar . Log ( TEXT ( " Unknown platform, unable to build UnrealBuildTool. " ) ) ;
2015-01-29 16:15:16 -05:00
return false ;
2014-09-05 13:31:22 -04:00
}
2015-01-29 16:15:16 -05:00
// Spawn the compiler
Ar . Logf ( TEXT ( " Running: %s %s " ) , * CompilerExecutableFilename , * CmdLineParams ) ;
2014-09-11 16:10:11 -04:00
const bool bLaunchDetached = false ;
const bool bLaunchHidden = true ;
const bool bLaunchReallyHidden = bLaunchHidden ;
FProcHandle ProcHandle = FPlatformProcess : : CreateProc ( * CompilerExecutableFilename , * CmdLineParams , bLaunchDetached , bLaunchHidden , bLaunchReallyHidden , NULL , 0 , NULL , NULL ) ;
2015-01-29 16:15:16 -05:00
if ( ! ProcHandle . IsValid ( ) )
2014-09-11 16:10:11 -04:00
{
2015-01-29 16:15:16 -05:00
Ar . Log ( TEXT ( " Failed to start process. " ) ) ;
return false ;
2014-09-11 16:10:11 -04:00
}
2015-01-29 16:15:16 -05:00
FPlatformProcess : : WaitForProc ( ProcHandle ) ;
2015-03-12 00:06:15 -04:00
FPlatformProcess : : CloseProc ( ProcHandle ) ;
2014-09-11 16:10:11 -04:00
// If the executable appeared where we expect it, then we were successful
2015-01-29 16:15:16 -05:00
FString UnrealBuildToolExePath = GetUnrealBuildToolExecutableFilename ( RootDir ) ;
if ( ! FPaths : : FileExists ( UnrealBuildToolExePath ) )
{
Ar . Logf ( TEXT ( " Missing %s after build " ) , * UnrealBuildToolExePath ) ;
return false ;
}
return true ;
}
FString FDesktopPlatformBase : : GetUnrealBuildToolProjectFileName ( const FString & RootDir ) const
{
return FPaths : : ConvertRelativePathToFull ( RootDir / TEXT ( " Engine/Source/Programs/UnrealBuildTool/UnrealBuildTool.csproj " ) ) ;
}
FString FDesktopPlatformBase : : GetUnrealBuildToolExecutableFilename ( const FString & RootDir ) const
{
return FPaths : : ConvertRelativePathToFull ( RootDir / TEXT ( " Engine/Binaries/DotNET/UnrealBuildTool.exe " ) ) ;
2014-09-05 13:31:22 -04:00
}
2014-05-13 18:23:53 -04:00
# undef LOCTEXT_NAMESPACE