You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#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. Change3180487on 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 Change3188865on 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 Change3194711on 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 Change3202332on 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]
1403 lines
74 KiB
C#
1403 lines
74 KiB
C#
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Xml;
|
|
using System.Xml.XPath;
|
|
using System.Xml.Linq;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace UnrealBuildTool
|
|
{
|
|
/// <summary>
|
|
/// Info needed to make a file a member of specific group
|
|
/// </summary>
|
|
class XcodeSourceFile : ProjectFile.SourceFile
|
|
{
|
|
/// <summary>
|
|
/// Constructor
|
|
/// </summary>
|
|
public XcodeSourceFile(FileReference InitFilePath, DirectoryReference InitRelativeBaseFolder)
|
|
: base(InitFilePath, InitRelativeBaseFolder)
|
|
{
|
|
FileGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
FileRefGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
}
|
|
|
|
/// <summary>
|
|
/// File Guid for use in Xcode project
|
|
/// </summary>
|
|
public string FileGuid
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
public void ReplaceGuids(string NewFileGuid, string NewFileRefGuid)
|
|
{
|
|
FileGuid = NewFileGuid;
|
|
FileRefGuid = NewFileRefGuid;
|
|
}
|
|
|
|
/// <summary>
|
|
/// File reference Guid for use in Xcode project
|
|
/// </summary>
|
|
public string FileRefGuid
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Represents a group of files shown in Xcode's project navigator as a folder
|
|
/// </summary>
|
|
class XcodeFileGroup
|
|
{
|
|
public XcodeFileGroup(string InName, string InPath, bool InIsReference = false)
|
|
{
|
|
GroupName = InName;
|
|
GroupPath = InPath;
|
|
GroupGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
bIsReference = InIsReference;
|
|
}
|
|
|
|
public string GroupGuid;
|
|
public string GroupName;
|
|
public string GroupPath;
|
|
public Dictionary<string, XcodeFileGroup> Children = new Dictionary<string, XcodeFileGroup>();
|
|
public List<XcodeSourceFile> Files = new List<XcodeSourceFile>();
|
|
public bool bIsReference;
|
|
}
|
|
|
|
class XcodeProjectFile : ProjectFile
|
|
{
|
|
FileReference OnlyGameProject;
|
|
|
|
Dictionary<string, XcodeFileGroup> Groups = new Dictionary<string, XcodeFileGroup>();
|
|
|
|
/// <summary>
|
|
/// Constructs a new project file object
|
|
/// </summary>
|
|
/// <param name="InitFilePath">The path to the project file on disk</param>
|
|
public XcodeProjectFile(FileReference InitFilePath, FileReference InOnlyGameProject)
|
|
: base(InitFilePath)
|
|
{
|
|
OnlyGameProject = InOnlyGameProject;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return ProjectFilePath.GetFileNameWithoutExtension();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets Xcode file category based on its extension
|
|
/// </summary>
|
|
private string GetFileCategory(string Extension)
|
|
{
|
|
// @todo Mac: Handle more categories
|
|
switch (Extension)
|
|
{
|
|
case ".framework":
|
|
return "Frameworks";
|
|
default:
|
|
return "Sources";
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets Xcode file type based on its extension
|
|
/// </summary>
|
|
private string GetFileType(string Extension)
|
|
{
|
|
// @todo Mac: Handle more file types
|
|
switch (Extension)
|
|
{
|
|
case ".c":
|
|
case ".m":
|
|
return "sourcecode.c.objc";
|
|
case ".cc":
|
|
case ".cpp":
|
|
case ".mm":
|
|
return "sourcecode.cpp.objcpp";
|
|
case ".h":
|
|
case ".inl":
|
|
case ".pch":
|
|
return "sourcecode.c.h";
|
|
case ".framework":
|
|
return "wrapper.framework";
|
|
case ".plist":
|
|
return "text.plist.xml";
|
|
case ".png":
|
|
return "image.png";
|
|
case ".icns":
|
|
return "image.icns";
|
|
default:
|
|
return "file.text";
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns true if Extension is a known extension for files containing source code
|
|
/// </summary>
|
|
private bool IsSourceCode(string Extension)
|
|
{
|
|
return Extension == ".c" || Extension == ".cc" || Extension == ".cpp" || Extension == ".m" || Extension == ".mm";
|
|
}
|
|
|
|
private bool ShouldIncludeFileInBuildPhaseSection(XcodeSourceFile SourceFile)
|
|
{
|
|
string FileExtension = SourceFile.Reference.GetExtension();
|
|
|
|
if (IsSourceCode(FileExtension))
|
|
{
|
|
foreach (string PlatformName in Enum.GetNames(typeof(UnrealTargetPlatform)))
|
|
{
|
|
string AltName = PlatformName == "Win32" || PlatformName == "Win64" ? "windows" : PlatformName.ToLower();
|
|
if ((SourceFile.Reference.FullName.ToLower().Contains("/" + PlatformName.ToLower() + "/") || SourceFile.Reference.FullName.ToLower().Contains("/" + AltName + "/"))
|
|
&& PlatformName != "Mac" && PlatformName != "IOS" && PlatformName != "TVOS")
|
|
{
|
|
// Build phase is used for indexing only and indexing currently works only with files that can be compiled for Mac, so skip files for other platforms
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns a project navigator group to which the file should belong based on its path.
|
|
/// Creates a group tree if it doesn't exist yet.
|
|
/// </summary>
|
|
public XcodeFileGroup FindGroupByRelativePath(ref Dictionary<string, XcodeFileGroup> Groups, string RelativePath)
|
|
{
|
|
string[] Parts = RelativePath.Split(Path.DirectorySeparatorChar);
|
|
string CurrentPath = "";
|
|
Dictionary<string, XcodeFileGroup> CurrentParent = Groups;
|
|
|
|
foreach (string Part in Parts)
|
|
{
|
|
XcodeFileGroup CurrentGroup;
|
|
|
|
if (CurrentPath != "")
|
|
{
|
|
CurrentPath += Path.DirectorySeparatorChar;
|
|
}
|
|
|
|
CurrentPath += Part;
|
|
|
|
if (!CurrentParent.ContainsKey(CurrentPath))
|
|
{
|
|
CurrentGroup = new XcodeFileGroup(Path.GetFileName(CurrentPath), CurrentPath);
|
|
CurrentParent.Add(CurrentPath, CurrentGroup);
|
|
}
|
|
else
|
|
{
|
|
CurrentGroup = CurrentParent[CurrentPath];
|
|
}
|
|
|
|
if (CurrentPath == RelativePath)
|
|
{
|
|
return CurrentGroup;
|
|
}
|
|
|
|
CurrentParent = CurrentGroup.Children;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Convert all paths to Apple/Unix format (with forward slashes)
|
|
/// </summary>
|
|
/// <param name="InPath">The path to convert</param>
|
|
/// <returns>The normalized path</returns>
|
|
private static string ConvertPath(string InPath)
|
|
{
|
|
if (BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac)
|
|
{
|
|
if (InPath[1] != ':')
|
|
{
|
|
throw new BuildException("Can only convert full paths ({0})", InPath);
|
|
}
|
|
|
|
string MacPath = string.Format("{0}/{1}/{2}/{3}",
|
|
RemoteToolChain.UserDevRootMac,
|
|
Environment.MachineName,
|
|
InPath[0].ToString().ToUpper(),
|
|
InPath.Substring(3));
|
|
|
|
// clean the path
|
|
MacPath = MacPath.Replace("\\", "/");
|
|
|
|
return MacPath;
|
|
}
|
|
else
|
|
{
|
|
return InPath.Replace("\\", "/");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allocates a generator-specific source file object
|
|
/// </summary>
|
|
/// <param name="InitFilePath">Path to the source file on disk</param>
|
|
/// <param name="InitProjectSubFolder">Optional sub-folder to put the file in. If empty, this will be determined automatically from the file's path relative to the project file</param>
|
|
/// <returns>The newly allocated source file object</returns>
|
|
public override SourceFile AllocSourceFile(FileReference InitFilePath, DirectoryReference InitProjectSubFolder)
|
|
{
|
|
if (InitFilePath.GetFileName().StartsWith("."))
|
|
{
|
|
return null;
|
|
}
|
|
return new XcodeSourceFile(InitFilePath, InitProjectSubFolder);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Generates bodies of all sections that contain a list of source files plus a dictionary of project navigator groups.
|
|
/// </summary>
|
|
private void GenerateSectionsWithSourceFiles(StringBuilder PBXBuildFileSection, StringBuilder PBXFileReferenceSection, StringBuilder PBXSourcesBuildPhaseSection, string TargetAppGuid, string TargetName)
|
|
{
|
|
foreach (var CurSourceFile in SourceFiles)
|
|
{
|
|
XcodeSourceFile SourceFile = CurSourceFile as XcodeSourceFile;
|
|
string FileName = SourceFile.Reference.GetFileName();
|
|
string FileExtension = Path.GetExtension(FileName);
|
|
string FilePath = SourceFile.Reference.MakeRelativeTo(ProjectFilePath.Directory);
|
|
string FilePathMac = Utils.CleanDirectorySeparators(FilePath, '/');
|
|
|
|
if (IsGeneratedProject)
|
|
{
|
|
PBXBuildFileSection.Append(string.Format("\t\t{0} /* {1} in {2} */ = {{isa = PBXBuildFile; fileRef = {3} /* {1} */; }};" + ProjectFileGenerator.NewLine,
|
|
SourceFile.FileGuid,
|
|
FileName,
|
|
GetFileCategory(FileExtension),
|
|
SourceFile.FileRefGuid));
|
|
}
|
|
|
|
PBXFileReferenceSection.Append(string.Format("\t\t{0} /* {1} */ = {{isa = PBXFileReference; lastKnownFileType = {2}; name = \"{1}\"; path = \"{3}\"; sourceTree = SOURCE_ROOT; }};" + ProjectFileGenerator.NewLine,
|
|
SourceFile.FileRefGuid,
|
|
FileName,
|
|
GetFileType(FileExtension),
|
|
FilePathMac));
|
|
|
|
if (ShouldIncludeFileInBuildPhaseSection(SourceFile))
|
|
{
|
|
PBXSourcesBuildPhaseSection.Append("\t\t\t\t" + SourceFile.FileGuid + " /* " + FileName + " in Sources */," + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
var ProjectRelativeSourceFile = CurSourceFile.Reference.MakeRelativeTo(ProjectFilePath.Directory);
|
|
string RelativeSourceDirectory = Path.GetDirectoryName(ProjectRelativeSourceFile);
|
|
// Use the specified relative base folder
|
|
if (CurSourceFile.BaseFolder != null) // NOTE: We are looking for null strings, not empty strings!
|
|
{
|
|
RelativeSourceDirectory = Path.GetDirectoryName(CurSourceFile.Reference.MakeRelativeTo(CurSourceFile.BaseFolder));
|
|
}
|
|
XcodeFileGroup Group = FindGroupByRelativePath(ref Groups, RelativeSourceDirectory);
|
|
if (Group != null)
|
|
{
|
|
Group.Files.Add(SourceFile);
|
|
}
|
|
}
|
|
|
|
PBXFileReferenceSection.Append(string.Format("\t\t{0} /* {1} */ = {{isa = PBXFileReference; explicitFileType = wrapper.application; path = {1}; sourceTree = BUILT_PRODUCTS_DIR; }};" + ProjectFileGenerator.NewLine, TargetAppGuid, TargetName));
|
|
}
|
|
|
|
private void AppendGroup(XcodeFileGroup Group, StringBuilder Content, bool bFilesOnly)
|
|
{
|
|
if (!Group.bIsReference)
|
|
{
|
|
if (!bFilesOnly)
|
|
{
|
|
Content.Append(string.Format("\t\t{0} = {{{1}", Group.GroupGuid, ProjectFileGenerator.NewLine));
|
|
Content.Append("\t\t\tisa = PBXGroup;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tchildren = (" + ProjectFileGenerator.NewLine);
|
|
|
|
foreach (XcodeFileGroup ChildGroup in Group.Children.Values)
|
|
{
|
|
Content.Append(string.Format("\t\t\t\t{0} /* {1} */,{2}", ChildGroup.GroupGuid, ChildGroup.GroupName, ProjectFileGenerator.NewLine));
|
|
}
|
|
}
|
|
|
|
foreach (XcodeSourceFile File in Group.Files)
|
|
{
|
|
Content.Append(string.Format("\t\t\t\t{0} /* {1} */,{2}", File.FileRefGuid, File.Reference.GetFileName(), ProjectFileGenerator.NewLine));
|
|
}
|
|
|
|
if (!bFilesOnly)
|
|
{
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tname = \"" + Group.GroupName + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tpath = \"" + Group.GroupPath + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tsourceTree = \"<group>\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
|
|
foreach (XcodeFileGroup ChildGroup in Group.Children.Values)
|
|
{
|
|
AppendGroup(ChildGroup, Content, bFilesOnly: false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void AppendBuildFileSection(StringBuilder Content, StringBuilder SectionContent)
|
|
{
|
|
Content.Append("/* Begin PBXBuildFile section */" + ProjectFileGenerator.NewLine);
|
|
Content.Append(SectionContent);
|
|
Content.Append("/* End PBXBuildFile section */" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendFileReferenceSection(StringBuilder Content, StringBuilder SectionContent)
|
|
{
|
|
Content.Append("/* Begin PBXFileReference section */" + ProjectFileGenerator.NewLine);
|
|
Content.Append(SectionContent);
|
|
Content.Append("/* End PBXFileReference section */" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendSourcesBuildPhaseSection(StringBuilder Content, StringBuilder SectionContent, string SourcesBuildPhaseGuid)
|
|
{
|
|
Content.Append("/* Begin PBXSourcesBuildPhase section */" + ProjectFileGenerator.NewLine);
|
|
Content.Append(string.Format("\t\t{0} = {{{1}", SourcesBuildPhaseGuid, ProjectFileGenerator.NewLine));
|
|
Content.Append("\t\t\tisa = PBXSourcesBuildPhase;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildActionMask = 2147483647;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tfiles = (" + ProjectFileGenerator.NewLine);
|
|
Content.Append(SectionContent);
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\trunOnlyForDeploymentPostprocessing = 0;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
Content.Append("/* End PBXSourcesBuildPhase section */" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendGroupSection(StringBuilder Content, string MainGroupGuid, string ProductRefGroupGuid, string TargetAppGuid, string TargetName)
|
|
{
|
|
Content.Append("/* Begin PBXGroup section */" + ProjectFileGenerator.NewLine);
|
|
|
|
// Main group
|
|
Content.Append(string.Format("\t\t{0} = {{{1}", MainGroupGuid, ProjectFileGenerator.NewLine));
|
|
Content.Append("\t\t\tisa = PBXGroup;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tchildren = (" + ProjectFileGenerator.NewLine);
|
|
|
|
foreach (XcodeFileGroup Group in Groups.Values)
|
|
{
|
|
if (!string.IsNullOrEmpty(Group.GroupName))
|
|
{
|
|
Content.Append(string.Format("\t\t\t\t{0} /* {1} */,{2}", Group.GroupGuid, Group.GroupName, ProjectFileGenerator.NewLine));
|
|
}
|
|
}
|
|
|
|
if (Groups.ContainsKey(""))
|
|
{
|
|
AppendGroup(Groups[""], Content, bFilesOnly: true);
|
|
}
|
|
|
|
Content.Append(string.Format("\t\t\t\t{0} /* Products */,{1}", ProductRefGroupGuid, ProjectFileGenerator.NewLine));
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tsourceTree = \"<group>\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
|
|
// Sources groups
|
|
foreach (XcodeFileGroup Group in Groups.Values)
|
|
{
|
|
if (Group.GroupName != "")
|
|
{
|
|
AppendGroup(Group, Content, bFilesOnly: false);
|
|
}
|
|
}
|
|
|
|
// Products group
|
|
Content.Append(string.Format("\t\t{0} /* Products */ = {{{1}", ProductRefGroupGuid, ProjectFileGenerator.NewLine));
|
|
Content.Append("\t\t\tisa = PBXGroup;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tchildren = (" + ProjectFileGenerator.NewLine);
|
|
Content.Append(string.Format("\t\t\t\t{0} /* {1} */,{2}", TargetAppGuid, TargetName, ProjectFileGenerator.NewLine));
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tname = Products;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tsourceTree = \"<group>\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
|
|
Content.Append("/* End PBXGroup section */" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendLegacyTargetSection(StringBuilder Content, string TargetName, string TargetGuid, string TargetBuildConfigGuid, FileReference UProjectPath)
|
|
{
|
|
string UE4Dir = ConvertPath(Path.GetFullPath(Directory.GetCurrentDirectory() + "../../.."));
|
|
string BuildToolPath = UE4Dir + "/Engine/Build/BatchFiles/Mac/Build.sh";
|
|
|
|
Content.Append("/* Begin PBXLegacyTarget section */" + ProjectFileGenerator.NewLine);
|
|
|
|
Content.Append("\t\t" + TargetGuid + " /* " + TargetName + " */ = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tisa = PBXLegacyTarget;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildArgumentsString = \"$(ACTION) $(UE_BUILD_TARGET_NAME) $(PLATFORM_NAME) $(UE_BUILD_TARGET_CONFIG)" + (UProjectPath == null ? "" : " \\\"" + UProjectPath.FullName + "\\\"") + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildConfigurationList = " + TargetBuildConfigGuid + " /* Build configuration list for PBXLegacyTarget \"" + TargetName + "\" */;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildPhases = (" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildToolPath = \"" + BuildToolPath + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildWorkingDirectory = \"" + UE4Dir + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tdependencies = (" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tname = \"" + TargetName + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tpassBuildSettingsInEnvironment = 1;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tproductName = \"" + TargetName + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
|
|
Content.Append("/* End PBXLegacyTarget section */" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendRunTargetSection(StringBuilder Content, string TargetName, string TargetGuid, string TargetBuildConfigGuid, string TargetDependencyGuid, string TargetAppGuid)
|
|
{
|
|
Content.Append("/* Begin PBXNativeTarget section */" + ProjectFileGenerator.NewLine);
|
|
|
|
Content.Append("\t\t" + TargetGuid + " /* " + TargetName + " */ = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tisa = PBXNativeTarget;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildConfigurationList = " + TargetBuildConfigGuid + " /* Build configuration list for PBXNativeTarget \"" + TargetName + "\" */;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildPhases = (" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tdependencies = (" + ProjectFileGenerator.NewLine);
|
|
if (!XcodeProjectFileGenerator.bGeneratingRunIOSProject && !XcodeProjectFileGenerator.bGeneratingRunTVOSProject)
|
|
{
|
|
Content.Append("\t\t\t\t" + TargetDependencyGuid + " /* PBXTargetDependency */," + ProjectFileGenerator.NewLine);
|
|
}
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tname = \"" + TargetName + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tpassBuildSettingsInEnvironment = 1;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tproductName = \"" + TargetName + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tproductReference = \"" + TargetAppGuid + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tproductType = \"com.apple.product-type.application\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
|
|
Content.Append("/* End PBXNativeTarget section */" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendIndexTargetSection(StringBuilder Content, string TargetName, string TargetGuid, string TargetBuildConfigGuid, string SourcesBuildPhaseGuid)
|
|
{
|
|
Content.Append("/* Begin PBXNativeTarget section */" + ProjectFileGenerator.NewLine);
|
|
|
|
Content.Append("\t\t" + TargetGuid + " /* " + TargetName + " */ = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tisa = PBXNativeTarget;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildConfigurationList = " + TargetBuildConfigGuid + " /* Build configuration list for PBXNativeTarget \"" + TargetName + "\" */;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildPhases = (" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t" + SourcesBuildPhaseGuid + " /* Sources */," + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tdependencies = (" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tname = \"" + TargetName + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tpassBuildSettingsInEnvironment = 1;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tproductName = \"" + TargetName + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tproductType = \"com.apple.product-type.library.static\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
|
|
Content.Append("/* End PBXNativeTarget section */" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendProjectSection(StringBuilder Content, string TargetName, string TargetGuid, string BuildTargetName, string BuildTargetGuid, string IndexTargetName, string IndexTargetGuid, string MainGroupGuid, string ProductRefGroupGuid, string ProjectGuid, string ProjectBuildConfigGuid)
|
|
{
|
|
Content.Append("/* Begin PBXProject section */" + ProjectFileGenerator.NewLine);
|
|
|
|
Content.Append("\t\t" + ProjectGuid + " /* Project object */ = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tisa = PBXProject;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tattributes = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tLastUpgradeCheck = 0800;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tORGANIZATIONNAME = \"Epic Games, Inc.\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tTargetAttributes = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\t" + TargetGuid + " = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\t\tProvisioningStyle = Manual;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\t};" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t};" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t};" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildConfigurationList = " + ProjectBuildConfigGuid + " /* Build configuration list for PBXProject \"" + TargetName + "\" */;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tcompatibilityVersion = \"Xcode 3.2\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tdevelopmentRegion = English;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\thasScannedForEncodings = 0;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tknownRegions = (" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\ten" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tmainGroup = " + MainGroupGuid + ";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tproductRefGroup = " + ProductRefGroupGuid + ";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tprojectDirPath = \"\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tprojectRoot = \"\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\ttargets = (" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t" + TargetGuid + " /* " + TargetName + " */," + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t" + BuildTargetGuid + " /* " + BuildTargetName + " */," + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t" + IndexTargetGuid + " /* " + IndexTargetName + " */," + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
|
|
Content.Append("/* End PBXProject section */" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendContainerItemProxySection(StringBuilder Content, string TargetName, string TargetGuid, string TargetProxyGuid, string ProjectGuid)
|
|
{
|
|
Content.Append("/* Begin PBXContainerItemProxy section */" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t" + TargetProxyGuid + " /* PBXContainerItemProxy */ = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tisa = PBXContainerItemProxy;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tcontainerPortal = " + ProjectGuid + " /* Project object */;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tproxyType = 1;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tremoteGlobalIDString = " + TargetGuid + ";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tremoteInfo = \"" + TargetName + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
Content.Append("/* End PBXContainerItemProxy section */" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendTargetDependencySection(StringBuilder Content, string TargetName, string TargetGuid, string TargetDependencyGuid, string TargetProxyGuid)
|
|
{
|
|
Content.Append("/* Begin PBXTargetDependency section */" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t" + TargetDependencyGuid + " /* PBXTargetDependency */ = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tisa = PBXTargetDependency;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\ttarget = " + TargetGuid + " /* " + TargetName + " */;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\ttargetProxy = " + TargetProxyGuid + " /* PBXContainerItemProxy */;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
Content.Append("/* End PBXTargetDependency section */" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendProjectBuildConfiguration(StringBuilder Content, string ConfigName, string ConfigGuid)
|
|
{
|
|
Content.Append("\t\t" + ConfigGuid + " /* \"" + ConfigName + "\" */ = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tisa = XCBuildConfiguration;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildSettings = {" + ProjectFileGenerator.NewLine);
|
|
|
|
Content.Append("\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (" + ProjectFileGenerator.NewLine);
|
|
foreach (var Definition in IntelliSensePreprocessorDefinitions)
|
|
{
|
|
Content.Append("\t\t\t\t\t\"" + Definition.Replace("\"", "") + "\"," + ProjectFileGenerator.NewLine);
|
|
}
|
|
Content.Append("\t\t\t\t\t\"MONOLITHIC_BUILD=1\"," + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
|
|
Content.Append("\t\t\t\tHEADER_SEARCH_PATHS = (" + ProjectFileGenerator.NewLine);
|
|
foreach (var Path in IntelliSenseSystemIncludeSearchPaths)
|
|
{
|
|
Content.Append("\t\t\t\t\t\"" + Path + "\"," + ProjectFileGenerator.NewLine);
|
|
}
|
|
Content.Append("\t\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
|
|
Content.Append("\t\t\t\tUSER_HEADER_SEARCH_PATHS = (" + ProjectFileGenerator.NewLine);
|
|
foreach (var Path in IntelliSenseIncludeSearchPaths)
|
|
{
|
|
Content.Append("\t\t\t\t\t\"" + Path + "\"," + ProjectFileGenerator.NewLine);
|
|
}
|
|
Content.Append("\t\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
|
|
if (ConfigName == "Debug")
|
|
{
|
|
Content.Append("\t\t\t\tONLY_ACTIVE_ARCH = YES;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tENABLE_TESTABILITY = YES;" + ProjectFileGenerator.NewLine);
|
|
}
|
|
Content.Append("\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tGCC_ENABLE_CPP_RTTI = NO;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tGCC_WARN_CHECK_SWITCH_STATEMENTS = NO;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tUSE_HEADERMAP = NO;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t};" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tname = \"" + ConfigName + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendNativeTargetBuildConfiguration(StringBuilder Content, XcodeBuildConfig Config, string ConfigGuid, bool bIsAGame, FileReference ProjectFile)
|
|
{
|
|
bool bMacOnly = true;
|
|
if (Config.ProjectTarget.TargetRules != null && XcodeProjectFileGenerator.ProjectFilePlatform.HasFlag(XcodeProjectFileGenerator.XcodeProjectFilePlatform.iOS))
|
|
{
|
|
var SupportedPlatforms = new List<UnrealTargetPlatform>();
|
|
Config.ProjectTarget.TargetRules.GetSupportedPlatforms(ref SupportedPlatforms);
|
|
if (SupportedPlatforms.Contains(UnrealTargetPlatform.IOS))
|
|
{
|
|
bMacOnly = false;
|
|
}
|
|
}
|
|
|
|
Content.Append("\t\t" + ConfigGuid + " /* \"" + Config.DisplayName + "\" */ = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tisa = XCBuildConfiguration;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildSettings = {" + ProjectFileGenerator.NewLine);
|
|
|
|
if (UnrealBuildTool.IsValidPlatform(UnrealTargetPlatform.Mac))
|
|
{
|
|
MacPlatform MacBuildPlat = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.Mac) as MacPlatform;
|
|
MacPlatformContext PlatformContextMac = (MacPlatformContext)MacBuildPlat.CreateContext(ProjectFile);
|
|
PlatformContextMac.SetUpProjectEnvironment(Config.BuildConfig);
|
|
}
|
|
else if (UnrealBuildTool.IsValidPlatform(UnrealTargetPlatform.IOS))
|
|
{
|
|
IOSPlatform IOSBuildPlat = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.IOS) as IOSPlatform;
|
|
IOSPlatformContext PlatformContextIOS = (IOSPlatformContext)IOSBuildPlat.CreateContext(ProjectFile);
|
|
PlatformContextIOS.SetUpProjectEnvironment(Config.BuildConfig);
|
|
}
|
|
else
|
|
{
|
|
throw new BuildException("No valid build platform found when trying to generate an Xcode project file.");
|
|
}
|
|
|
|
string UE4Dir = ConvertPath(Path.GetFullPath(Directory.GetCurrentDirectory() + "../../.."));
|
|
string MacExecutableDir = ConvertPath(Config.MacExecutablePath.Directory.FullName);
|
|
string MacExecutableFileName = Config.MacExecutablePath.GetFileName();
|
|
|
|
if (bMacOnly)
|
|
{
|
|
Content.Append("\t\t\t\tVALID_ARCHS = \"x86_64\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tSUPPORTED_PLATFORMS = \"macosx\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tPRODUCT_NAME = \"" + MacExecutableFileName + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tCONFIGURATION_BUILD_DIR = \"" + MacExecutableDir + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;" + ProjectFileGenerator.NewLine);
|
|
}
|
|
else
|
|
{
|
|
string IOSRunTimeVersion = null;
|
|
string IOSRunTimeDevices = null;
|
|
string TVOSRunTimeVersion = null;
|
|
string TVOSRunTimeDevices = null;
|
|
string ValidArchs = "x86_64";
|
|
string SupportedPlatforms = "macosx";
|
|
|
|
string UUID_IOS = "";
|
|
string UUID_TVOS = "";
|
|
string TEAM_IOS = "";
|
|
string TEAM_TVOS = "";
|
|
string IOS_CERT = "iPhone Developer";
|
|
string TVOS_CERT = "iPhone Developer";
|
|
if (UnrealBuildTool.IsValidPlatform(UnrealTargetPlatform.IOS))
|
|
{
|
|
IOSPlatform IOSBuildPlat = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.IOS) as IOSPlatform;
|
|
IOSPlatformContext PlatformContextIOS = (IOSPlatformContext)IOSBuildPlat.CreateContext(ProjectFile);
|
|
PlatformContextIOS.SetUpProjectEnvironment(Config.BuildConfig);
|
|
IOSRunTimeVersion = PlatformContextIOS.GetRunTimeVersion();
|
|
IOSRunTimeDevices = PlatformContextIOS.GetRunTimeDevices();
|
|
ValidArchs += " arm64 armv7 armv7s";
|
|
SupportedPlatforms += " iphoneos";
|
|
UUID_IOS = PlatformContextIOS.MobileProvisionUUID;
|
|
TEAM_IOS = PlatformContextIOS.TeamUUID;
|
|
IOS_CERT = PlatformContextIOS.SigningCertificate;
|
|
}
|
|
|
|
if (UnrealBuildTool.IsValidPlatform(UnrealTargetPlatform.TVOS))
|
|
{
|
|
TVOSPlatform TVOSBuildPlat = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.TVOS) as TVOSPlatform;
|
|
TVOSPlatformContext PlatformContextTVOS = (TVOSPlatformContext)TVOSBuildPlat.CreateContext(ProjectFile);
|
|
PlatformContextTVOS.SetUpProjectEnvironment(Config.BuildConfig);
|
|
TVOSRunTimeVersion = PlatformContextTVOS.GetRunTimeVersion();
|
|
TVOSRunTimeDevices = PlatformContextTVOS.GetRunTimeDevices();
|
|
if (ValidArchs == "x86_64")
|
|
{
|
|
ValidArchs += " arm64 armv7 armv7s";
|
|
}
|
|
SupportedPlatforms += " appletvos";
|
|
UUID_TVOS = PlatformContextTVOS.MobileProvisionUUID;
|
|
TEAM_TVOS = PlatformContextTVOS.TeamUUID;
|
|
TVOS_CERT = PlatformContextTVOS.SigningCertificate;
|
|
}
|
|
|
|
Content.Append("\t\t\t\tVALID_ARCHS = \"" + ValidArchs + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tSUPPORTED_PLATFORMS = \"" + SupportedPlatforms + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"PRODUCT_NAME[sdk=macosx*]\" = \"" + MacExecutableFileName + "\";" + ProjectFileGenerator.NewLine);
|
|
if (IOSRunTimeVersion != null)
|
|
{
|
|
Content.Append("\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = " + IOSRunTimeVersion + ";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"PRODUCT_NAME[sdk=iphoneos*]\" = \"" + Config.BuildTarget + "\";" + ProjectFileGenerator.NewLine); // @todo: change to Path.GetFileName(Config.IOSExecutablePath) when we stop using payload
|
|
Content.Append("\t\t\t\t\"TARGETED_DEVICE_FAMILY[sdk=iphoneos*]\" = \"" + IOSRunTimeDevices + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"" + IOS_CERT + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"SDKROOT[sdk=iphoneos]\" = iphoneos;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]\" = \"" + UUID_IOS + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"DEVELOPMENT_TEAM[sdk=iphoneos*]\" = \"" + TEAM_IOS + "\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
if (TVOSRunTimeVersion != null)
|
|
{
|
|
Content.Append("\t\t\t\tTVOS_DEPLOYMENT_TARGET = " + TVOSRunTimeVersion + ";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"PRODUCT_NAME[sdk=appletvos*]\" = \"" + Config.BuildTarget + "\";" + ProjectFileGenerator.NewLine); // @todo: change to Path.GetFileName(Config.TVOSExecutablePath) when we stop using payload
|
|
Content.Append("\t\t\t\t\"TARGETED_DEVICE_FAMILY[sdk=appletvos*]\" = \"" + TVOSRunTimeDevices + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=appletvos*]\" = \"" + TVOS_CERT + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"SDKROOT[sdk=appletvos]\" = appletvos;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"PROVISIONING_PROFILE_SPECIFIER[sdk=appletvos*]\" = \"" + UUID_TVOS + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"DEVELOPMENT_TEAM[sdk=appletvos*]\" = \"" + TEAM_TVOS + "\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
Content.Append("\t\t\t\t\"CONFIGURATION_BUILD_DIR[sdk=macosx*]\" = \"" + MacExecutableDir + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"SDKROOT[sdk=macosx]\" = macosx;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tINFOPLIST_OUTPUT_FORMAT = xml;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;" + ProjectFileGenerator.NewLine);
|
|
|
|
bool bIsUE4Game = Config.BuildTarget.Equals("UE4Game", StringComparison.InvariantCultureIgnoreCase);
|
|
bool bIsUE4Client = Config.BuildTarget.Equals("UE4Client", StringComparison.InvariantCultureIgnoreCase);
|
|
|
|
DirectoryReference GameDir = ProjectFile != null ? ProjectFile.Directory : null;
|
|
string GamePath = GameDir != null ? ConvertPath(GameDir.FullName) : null;
|
|
|
|
string IOSInfoPlistPath = null;
|
|
string TVOSInfoPlistPath = null;
|
|
string MacInfoPlistPath = null;
|
|
string IOSEntitlementPath = null;
|
|
if (bIsUE4Game)
|
|
{
|
|
IOSInfoPlistPath = UE4Dir + "/Engine/Intermediate/IOS/" + Config.BuildTarget + "-Info.plist";
|
|
TVOSInfoPlistPath = UE4Dir + "/Engine/Intermediate/TVOS/" + Config.BuildTarget + "-Info.plist";
|
|
MacInfoPlistPath = UE4Dir + "/Engine/Intermediate/Mac/" + MacExecutableFileName + "-Info.plist";
|
|
IOSEntitlementPath = "";
|
|
if (IOSRunTimeVersion != null)
|
|
{
|
|
Content.Append("\t\t\t\t\"CONFIGURATION_BUILD_DIR[sdk=iphoneos*]\" = \"" + UE4Dir + "/Engine/Binaries/IOS/Payload\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
if (TVOSRunTimeVersion != null)
|
|
{
|
|
Content.Append("\t\t\t\t\"CONFIGURATION_BUILD_DIR[sdk=appletvos*]\" = \"" + UE4Dir + "/Engine/Binaries/TVOS/Payload\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
}
|
|
else if (bIsUE4Client)
|
|
{
|
|
IOSInfoPlistPath = UE4Dir + "/Engine/Intermediate/IOS/UE4Game-Info.plist";
|
|
TVOSInfoPlistPath = UE4Dir + "/Engine/Intermediate/TVOS/UE4Game-Info.plist";
|
|
MacInfoPlistPath = UE4Dir + "/Engine/Intermediate/Mac/" + MacExecutableFileName + "-Info.plist";
|
|
IOSEntitlementPath = "";
|
|
if (IOSRunTimeVersion != null)
|
|
{
|
|
Content.Append("\t\t\t\t\"CONFIGURATION_BUILD_DIR[sdk=iphoneos*]\" = \"" + UE4Dir + "/Engine/Binaries/IOS/Payload\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
if (TVOSRunTimeVersion != null)
|
|
{
|
|
Content.Append("\t\t\t\t\"CONFIGURATION_BUILD_DIR[sdk=appletvos*]\" = \"" + UE4Dir + "/Engine/Binaries/TVOS/Payload\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
}
|
|
else if (bIsAGame)
|
|
{
|
|
IOSInfoPlistPath = GamePath + "/Intermediate/IOS/" + Config.BuildTarget + "-Info.plist";
|
|
TVOSInfoPlistPath = GamePath + "/Intermediate/TVOS/" + Config.BuildTarget + "-Info.plist";
|
|
MacInfoPlistPath = GamePath + "/Intermediate/Mac/" + MacExecutableFileName + "-Info.plist";
|
|
IOSEntitlementPath = GamePath + "/Intermediate/IOS/" + Config.BuildTarget + ".entitlements";
|
|
if (IOSRunTimeVersion != null)
|
|
{
|
|
Content.Append("\t\t\t\t\"CONFIGURATION_BUILD_DIR[sdk=iphoneos*]\" = \"" + GamePath + "/Binaries/IOS/Payload\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
if (TVOSRunTimeVersion != null)
|
|
{
|
|
Content.Append("\t\t\t\t\"CONFIGURATION_BUILD_DIR[sdk=appletvos*]\" = \"" + GamePath + "/Binaries/TVOS/Payload\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (GamePath == null)
|
|
{
|
|
IOSInfoPlistPath = UE4Dir + "/Engine/Intermediate/IOS/" + Config.BuildTarget + "-Info.plist";
|
|
TVOSInfoPlistPath = UE4Dir + "/Engine/Intermediate/TVOS/" + Config.BuildTarget + "-Info.plist";
|
|
MacInfoPlistPath = UE4Dir + "/Engine/Intermediate/Mac/" + MacExecutableFileName + "-Info.plist";
|
|
}
|
|
else
|
|
{
|
|
IOSInfoPlistPath = GamePath + "/Intermediate/IOS/" + Config.BuildTarget + "-Info.plist";
|
|
TVOSInfoPlistPath = GamePath + "/Intermediate/TVOS/" + Config.BuildTarget + "-Info.plist";
|
|
MacInfoPlistPath = GamePath + "/Intermediate/Mac/" + MacExecutableFileName + "-Info.plist";
|
|
}
|
|
if (IOSRunTimeVersion != null)
|
|
{
|
|
Content.Append("\t\t\t\t\"CONFIGURATION_BUILD_DIR[sdk=iphoneos*]\" = \"" + UE4Dir + "/Engine/Binaries/IOS/Payload\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
if (TVOSRunTimeVersion != null)
|
|
{
|
|
Content.Append("\t\t\t\t\"CONFIGURATION_BUILD_DIR[sdk=appletvos*]\" = \"" + UE4Dir + "/Engine/Binaries/TVOS/Payload\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
}
|
|
|
|
if (XcodeProjectFileGenerator.bGeneratingRunIOSProject)
|
|
{
|
|
Content.Append("\t\t\t\tINFOPLIST_FILE = \"" + IOSInfoPlistPath + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tCODE_SIGN_ENTITLEMENTS = \"" + IOSEntitlementPath + "\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
else if (XcodeProjectFileGenerator.bGeneratingRunTVOSProject)
|
|
{
|
|
Content.Append("\t\t\t\tINFOPLIST_FILE = \"" + TVOSInfoPlistPath + "\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
else
|
|
{
|
|
Content.Append("\t\t\t\t\"INFOPLIST_FILE[sdk=macosx*]\" = \"" + MacInfoPlistPath + "\";" + ProjectFileGenerator.NewLine);
|
|
if (IOSRunTimeVersion != null)
|
|
{
|
|
Content.Append("\t\t\t\t\"INFOPLIST_FILE[sdk=iphoneos*]\" = \"" + IOSInfoPlistPath + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\t\"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]\" = \"" + IOSEntitlementPath + "\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
if (TVOSRunTimeVersion != null)
|
|
{
|
|
Content.Append("\t\t\t\t\"INFOPLIST_FILE[sdk=appletvos*]\" = \"" + TVOSInfoPlistPath + "\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
}
|
|
|
|
// Prepare a temp Info.plist file so Xcode has some basic info about the target immediately after opening the project.
|
|
// This is needed for the target to pass the settings validation before code signing. UBT will overwrite this plist file later, with proper contents.
|
|
if (BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Mac)
|
|
{
|
|
bool bCreateMacInfoPlist = !File.Exists(MacInfoPlistPath);
|
|
bool bCreateIOSInfoPlist = !File.Exists(IOSInfoPlistPath) && IOSRunTimeVersion != null;
|
|
bool bCreateTVOSInfoPlist = !File.Exists(TVOSInfoPlistPath) && TVOSRunTimeVersion != null;
|
|
if (bCreateMacInfoPlist || bCreateIOSInfoPlist || bCreateTVOSInfoPlist)
|
|
{
|
|
DirectoryReference ProjectPath = GameDir;
|
|
DirectoryReference EngineDir = DirectoryReference.Combine(new DirectoryReference(UE4Dir), "Engine");
|
|
string GameName = Config.BuildTarget;
|
|
if (ProjectPath == null)
|
|
{
|
|
ProjectPath = EngineDir;
|
|
}
|
|
if (bIsUE4Game)
|
|
{
|
|
ProjectPath = EngineDir;
|
|
GameName = "UE4Game";
|
|
}
|
|
|
|
if (bCreateMacInfoPlist)
|
|
{
|
|
Directory.CreateDirectory(Path.GetDirectoryName(MacInfoPlistPath));
|
|
UEDeployMac.GeneratePList(ProjectPath.FullName, bIsUE4Game, GameName, Config.BuildTarget, EngineDir.FullName, MacExecutableFileName);
|
|
}
|
|
if (bCreateIOSInfoPlist)
|
|
{
|
|
Directory.CreateDirectory(Path.GetDirectoryName(IOSInfoPlistPath));
|
|
UEDeployIOS.GenerateIOSPList(ProjectPath.FullName, bIsUE4Game, GameName, Config.BuildTarget, EngineDir.FullName, ProjectPath + "/Binaries/IOS/Payload");
|
|
}
|
|
if (bCreateTVOSInfoPlist)
|
|
{
|
|
Directory.CreateDirectory(Path.GetDirectoryName(TVOSInfoPlistPath));
|
|
UEDeployTVOS.GenerateTVOSPList(ProjectPath.FullName, bIsUE4Game, GameName, Config.BuildTarget, EngineDir.FullName, ProjectPath + "/Binaries/TVOS/Payload");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Content.Append("\t\t\t\tMACOSX_DEPLOYMENT_TARGET = " + MacToolChain.MacOSVersion + ";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tSDKROOT = macosx;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tGCC_PREFIX_HEADER = \"" + UE4Dir + "/Engine/Source/Editor/UnrealEd/Public/UnrealEd.h\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t};" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tname = \"" + Config.DisplayName + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendLegacyTargetBuildConfiguration(StringBuilder Content, XcodeBuildConfig Config, string ConfigGuid)
|
|
{
|
|
bool bMacOnly = true;
|
|
if (Config.ProjectTarget.TargetRules != null && XcodeProjectFileGenerator.ProjectFilePlatform.HasFlag(XcodeProjectFileGenerator.XcodeProjectFilePlatform.iOS))
|
|
{
|
|
var SupportedPlatforms = new List<UnrealTargetPlatform>();
|
|
Config.ProjectTarget.TargetRules.GetSupportedPlatforms(ref SupportedPlatforms);
|
|
if (SupportedPlatforms.Contains(UnrealTargetPlatform.IOS))
|
|
{
|
|
bMacOnly = false;
|
|
}
|
|
}
|
|
|
|
Content.Append("\t\t" + ConfigGuid + " /* \"" + Config.DisplayName + "\" */ = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tisa = XCBuildConfiguration;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildSettings = {" + ProjectFileGenerator.NewLine);
|
|
if (bMacOnly)
|
|
{
|
|
Content.Append("\t\t\t\tVALID_ARCHS = \"x86_64\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tSUPPORTED_PLATFORMS = \"macosx\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
else
|
|
{
|
|
string ValidArchs = "x86_64";
|
|
string SupportedPlatforms = "macosx";
|
|
if (UnrealBuildTool.IsValidPlatform(UnrealTargetPlatform.IOS))
|
|
{
|
|
ValidArchs += " arm64 armv7 armv7s";
|
|
SupportedPlatforms += " iphoneos";
|
|
}
|
|
if (UnrealBuildTool.IsValidPlatform(UnrealTargetPlatform.TVOS))
|
|
{
|
|
if (ValidArchs == "x86_64")
|
|
{
|
|
ValidArchs += " arm64 armv7 armv7s";
|
|
}
|
|
SupportedPlatforms += " appletvos";
|
|
}
|
|
Content.Append("\t\t\t\tVALID_ARCHS = \"" + ValidArchs + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tSUPPORTED_PLATFORMS = \"" + SupportedPlatforms + "\";" + ProjectFileGenerator.NewLine);
|
|
}
|
|
Content.Append("\t\t\t\tUE_BUILD_TARGET_NAME = \"" + Config.BuildTarget + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t\tUE_BUILD_TARGET_CONFIG = \"" + Config.BuildConfig + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t};" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tname = \"" + Config.DisplayName + "\";" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendXCBuildConfigurationSection(StringBuilder Content, Dictionary<string, XcodeBuildConfig> ProjectBuildConfigs, Dictionary<string, XcodeBuildConfig> TargetBuildConfigs,
|
|
Dictionary<string, XcodeBuildConfig> BuildTargetBuildConfigs, Dictionary<string, XcodeBuildConfig> IndexTargetBuildConfigs, bool bIsAGame, FileReference GameProjectPath)
|
|
{
|
|
Content.Append("/* Begin XCBuildConfiguration section */" + ProjectFileGenerator.NewLine);
|
|
|
|
foreach (var Config in ProjectBuildConfigs)
|
|
{
|
|
AppendProjectBuildConfiguration(Content, Config.Value.DisplayName, Config.Key);
|
|
}
|
|
|
|
foreach (var Config in TargetBuildConfigs)
|
|
{
|
|
AppendNativeTargetBuildConfiguration(Content, Config.Value, Config.Key, bIsAGame, GameProjectPath);
|
|
}
|
|
|
|
foreach (var Config in BuildTargetBuildConfigs)
|
|
{
|
|
AppendLegacyTargetBuildConfiguration(Content, Config.Value, Config.Key);
|
|
}
|
|
|
|
foreach (var Config in IndexTargetBuildConfigs)
|
|
{
|
|
AppendNativeTargetBuildConfiguration(Content, Config.Value, Config.Key, bIsAGame, GameProjectPath);
|
|
}
|
|
|
|
Content.Append("/* End XCBuildConfiguration section */" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendXCConfigurationList(StringBuilder Content, string TypeName, string TargetName, string ConfigListGuid, Dictionary<string, XcodeBuildConfig> BuildConfigs)
|
|
{
|
|
Content.Append("\t\t" + ConfigListGuid + " /* Build configuration list for " + TypeName + " \"" + TargetName + "\" */ = {" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tisa = XCConfigurationList;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tbuildConfigurations = (" + ProjectFileGenerator.NewLine);
|
|
foreach (var Config in BuildConfigs)
|
|
{
|
|
Content.Append("\t\t\t\t" + Config.Key + " /* \"" + Config.Value.DisplayName + "\" */," + ProjectFileGenerator.NewLine);
|
|
}
|
|
Content.Append("\t\t\t);" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tdefaultConfigurationIsVisible = 0;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\tdefaultConfigurationName = Development;" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t};" + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
private void AppendXCConfigurationListSection(StringBuilder Content, string TargetName, string BuildTargetName, string IndexTargetName, string ProjectConfigListGuid,
|
|
Dictionary<string, XcodeBuildConfig> ProjectBuildConfigs, string TargetConfigListGuid, Dictionary<string, XcodeBuildConfig> TargetBuildConfigs,
|
|
string BuildTargetConfigListGuid, Dictionary<string, XcodeBuildConfig> BuildTargetBuildConfigs,
|
|
string IndexTargetConfigListGuid, Dictionary<string, XcodeBuildConfig> IndexTargetBuildConfigs)
|
|
{
|
|
Content.Append("/* Begin XCConfigurationList section */" + ProjectFileGenerator.NewLine);
|
|
|
|
AppendXCConfigurationList(Content, "PBXProject", TargetName, ProjectConfigListGuid, ProjectBuildConfigs);
|
|
AppendXCConfigurationList(Content, "PBXLegacyTarget", BuildTargetName, BuildTargetConfigListGuid, BuildTargetBuildConfigs);
|
|
AppendXCConfigurationList(Content, "PBXNativeTarget", TargetName, TargetConfigListGuid, TargetBuildConfigs);
|
|
AppendXCConfigurationList(Content, "PBXNativeTarget", IndexTargetName, IndexTargetConfigListGuid, IndexTargetBuildConfigs);
|
|
|
|
Content.Append("/* End XCConfigurationList section */" + ProjectFileGenerator.NewLine);
|
|
}
|
|
|
|
public struct XcodeBuildConfig
|
|
{
|
|
public XcodeBuildConfig(string InDisplayName, string InBuildTarget, FileReference InMacExecutablePath, FileReference InIOSExecutablePath, FileReference InTVOSExecutablePath,
|
|
ProjectTarget InProjectTarget, UnrealTargetConfiguration InBuildConfig)
|
|
{
|
|
DisplayName = InDisplayName;
|
|
MacExecutablePath = InMacExecutablePath;
|
|
IOSExecutablePath = InIOSExecutablePath;
|
|
TVOSExecutablePath = InTVOSExecutablePath;
|
|
BuildTarget = InBuildTarget;
|
|
ProjectTarget = InProjectTarget;
|
|
BuildConfig = InBuildConfig;
|
|
}
|
|
|
|
public string DisplayName;
|
|
public FileReference MacExecutablePath;
|
|
public FileReference IOSExecutablePath;
|
|
public FileReference TVOSExecutablePath;
|
|
public string BuildTarget;
|
|
public ProjectTarget ProjectTarget;
|
|
public UnrealTargetConfiguration BuildConfig;
|
|
};
|
|
|
|
private List<XcodeBuildConfig> GetSupportedBuildConfigs(List<UnrealTargetPlatform> Platforms, List<UnrealTargetConfiguration> Configurations)
|
|
{
|
|
var BuildConfigs = new List<XcodeBuildConfig>();
|
|
|
|
string ProjectName = ProjectFilePath.GetFileNameWithoutExtension();
|
|
|
|
foreach (var Configuration in Configurations)
|
|
{
|
|
if (UnrealBuildTool.IsValidConfiguration(Configuration))
|
|
{
|
|
foreach (var Platform in Platforms)
|
|
{
|
|
if (UnrealBuildTool.IsValidPlatform(Platform) && (Platform == UnrealTargetPlatform.Mac || Platform == UnrealTargetPlatform.IOS)) // @todo support other platforms
|
|
{
|
|
var BuildPlatform = UEBuildPlatform.GetBuildPlatform(Platform, true);
|
|
if ((BuildPlatform != null) && (BuildPlatform.HasRequiredSDKsInstalled() == SDKStatus.Valid))
|
|
{
|
|
// Now go through all of the target types for this project
|
|
if (ProjectTargets.Count == 0)
|
|
{
|
|
throw new BuildException("Expecting at least one ProjectTarget to be associated with project '{0}' in the TargetProjects list ", ProjectFilePath);
|
|
}
|
|
|
|
foreach (var ProjectTarget in ProjectTargets)
|
|
{
|
|
if (MSBuildProjectFile.IsValidProjectPlatformAndConfiguration(ProjectTarget, Platform, Configuration))
|
|
{
|
|
// Figure out if this is a monolithic build
|
|
bool bShouldCompileMonolithic = BuildPlatform.ShouldCompileMonolithicBinary(Platform);
|
|
bShouldCompileMonolithic |= ProjectTarget.TargetRules.ShouldCompileMonolithic(Platform, Configuration);
|
|
|
|
var ConfigName = Configuration.ToString();
|
|
if (ProjectTarget.TargetRules.ConfigurationName != "Game" && ProjectTarget.TargetRules.ConfigurationName != "Program")
|
|
{
|
|
ConfigName += " " + ProjectTarget.TargetRules.ConfigurationName;
|
|
}
|
|
|
|
if (BuildConfigs.Where(Config => Config.DisplayName == ConfigName).ToList().Count == 0)
|
|
{
|
|
string TargetName = ProjectTarget.TargetFilePath.GetFileNameWithoutAnyExtensions();
|
|
|
|
// Get the output directory
|
|
DirectoryReference RootDirectory = UnrealBuildTool.EngineDirectory;
|
|
if ((TargetRules.IsAGame(ProjectTarget.TargetRules.Type) || ProjectTarget.TargetRules.Type == TargetRules.TargetType.Server) && bShouldCompileMonolithic && !ProjectTarget.TargetRules.bOutputToEngineBinaries)
|
|
{
|
|
if (OnlyGameProject != null && ProjectTarget.TargetFilePath.IsUnderDirectory(OnlyGameProject.Directory))
|
|
{
|
|
RootDirectory = OnlyGameProject.Directory;
|
|
}
|
|
else
|
|
{
|
|
FileReference ProjectFileName;
|
|
if (UProjectInfo.TryGetProjectFileName(ProjectName, out ProjectFileName))
|
|
{
|
|
RootDirectory = ProjectFileName.Directory;
|
|
}
|
|
}
|
|
}
|
|
|
|
if(ProjectTarget.TargetRules.Type == TargetRules.TargetType.Program && !ProjectTarget.TargetRules.bOutputToEngineBinaries)
|
|
{
|
|
FileReference ProjectFileName;
|
|
if (UProjectInfo.TryGetProjectForTarget(TargetName, out ProjectFileName))
|
|
{
|
|
RootDirectory = ProjectFileName.Directory;
|
|
}
|
|
}
|
|
|
|
// Get the output directory
|
|
DirectoryReference OutputDirectory = DirectoryReference.Combine(RootDirectory, "Binaries");
|
|
|
|
string ExeName = TargetName;
|
|
if (!bShouldCompileMonolithic && ProjectTarget.TargetRules.Type != TargetRules.TargetType.Program)
|
|
{
|
|
// Figure out what the compiled binary will be called so that we can point the IDE to the correct file
|
|
string TargetConfigurationName = ProjectTarget.TargetRules.ConfigurationName;
|
|
if (TargetConfigurationName != TargetRules.TargetType.Game.ToString() && TargetConfigurationName != TargetRules.TargetType.Program.ToString())
|
|
{
|
|
ExeName = "UE4" + TargetConfigurationName;
|
|
}
|
|
}
|
|
|
|
if (BuildPlatform.Platform == UnrealTargetPlatform.Mac)
|
|
{
|
|
MacPlatform MacBuildPlat = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.Mac) as MacPlatform;
|
|
MacPlatformContext PlatformContextMac = (MacPlatformContext)MacBuildPlat.CreateContext(OnlyGameProject);
|
|
|
|
string MacExecutableName = UEBuildTarget.MakeBinaryFileName(ExeName, UnrealTargetPlatform.Mac, (ExeName == "UE4Editor" && Configuration == UnrealTargetConfiguration.DebugGame) ? UnrealTargetConfiguration.Development : Configuration, PlatformContextMac.GetActiveArchitecture(), ProjectTarget.TargetRules.UndecoratedConfiguration, UEBuildBinaryType.Executable);
|
|
string IOSExecutableName = MacExecutableName.Replace("-Mac-", "-IOS-");
|
|
string TVOSExecutableName = MacExecutableName.Replace("-Mac-", "-TVOS-");
|
|
BuildConfigs.Add(new XcodeBuildConfig(ConfigName, TargetName, FileReference.Combine(OutputDirectory, "Mac", MacExecutableName), FileReference.Combine(OutputDirectory, "IOS", IOSExecutableName), FileReference.Combine(OutputDirectory, "TVOS", TVOSExecutableName), ProjectTarget, Configuration));
|
|
}
|
|
else if (BuildPlatform.Platform == UnrealTargetPlatform.IOS)
|
|
{
|
|
IOSPlatform IOSBuildPlat = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.IOS) as IOSPlatform;
|
|
IOSPlatformContext PlatformContextIOS = (IOSPlatformContext)IOSBuildPlat.CreateContext(OnlyGameProject);
|
|
|
|
string IOSExecutableName = UEBuildTarget.MakeBinaryFileName(ExeName, UnrealTargetPlatform.IOS, (ExeName == "UE4Editor" && Configuration == UnrealTargetConfiguration.DebugGame) ? UnrealTargetConfiguration.Development : Configuration, PlatformContextIOS.GetActiveArchitecture(), ProjectTarget.TargetRules.UndecoratedConfiguration, UEBuildBinaryType.Executable);
|
|
string TVOSExecutableName = IOSExecutableName.Replace("-IOS-", "-TVOS-");
|
|
string MacExecutableName = IOSExecutableName.Replace("-IOS-", "-Mac-");
|
|
BuildConfigs.Add(new XcodeBuildConfig(ConfigName, TargetName, FileReference.Combine(OutputDirectory, "Mac", IOSExecutableName), FileReference.Combine(OutputDirectory, "IOS", IOSExecutableName), FileReference.Combine(OutputDirectory, "TVOS", TVOSExecutableName), ProjectTarget, Configuration));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return BuildConfigs;
|
|
}
|
|
|
|
private void WriteSchemeFile(string TargetName, string TargetGuid, string BuildTargetGuid, string IndexTargetGuid, bool bHasEditorConfiguration, string GameProjectPath)
|
|
{
|
|
string DefaultConfiguration = bHasEditorConfiguration && !XcodeProjectFileGenerator.bGeneratingRunIOSProject && !XcodeProjectFileGenerator.bGeneratingRunTVOSProject ? "Development Editor" : "Development";
|
|
|
|
var Content = new StringBuilder();
|
|
|
|
Content.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("<Scheme" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" LastUpgradeVersion = \"0710\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" version = \"1.3\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <BuildAction" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" parallelizeBuildables = \"YES\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" buildImplicitDependencies = \"YES\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <BuildActionEntries>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <BuildActionEntry" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" buildForTesting = \"YES\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" buildForRunning = \"YES\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" buildForProfiling = \"YES\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" buildForArchiving = \"YES\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" buildForAnalyzing = \"YES\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <BuildableReference" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BuildableIdentifier = \"primary\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BlueprintIdentifier = \"" + TargetGuid + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BuildableName = \"" + TargetName + ".app\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BlueprintName = \"" + TargetName + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" ReferencedContainer = \"container:" + TargetName + ".xcodeproj\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </BuildableReference>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </BuildActionEntry>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </BuildActionEntries>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </BuildAction>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <TestAction" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" buildConfiguration = \"" + DefaultConfiguration + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" shouldUseLaunchSchemeArgsEnv = \"YES\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <Testables>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </Testables>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <MacroExpansion>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <BuildableReference" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BuildableIdentifier = \"primary\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BlueprintIdentifier = \"" + TargetGuid + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BuildableName = \"" + TargetName + ".app\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BlueprintName = \"" + TargetName + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" ReferencedContainer = \"container:" + TargetName + ".xcodeproj\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </BuildableReference>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </MacroExpansion>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <AdditionalOptions>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </AdditionalOptions>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </TestAction>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <LaunchAction" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" buildConfiguration = \"" + DefaultConfiguration + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" launchStyle = \"0\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" useCustomWorkingDirectory = \"NO\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" ignoresPersistentStateOnLaunch = \"NO\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" debugDocumentVersioning = \"YES\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" debugServiceExtension = \"internal\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" allowLocationSimulation = \"YES\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <BuildableProductRunnable" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" runnableDebuggingMode = \"0\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <BuildableReference" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BuildableIdentifier = \"primary\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BlueprintIdentifier = \"" + TargetGuid + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BuildableName = \"" + TargetName + ".app\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BlueprintName = \"" + TargetName + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" ReferencedContainer = \"container:" + TargetName + ".xcodeproj\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </BuildableReference>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </BuildableProductRunnable>" + ProjectFileGenerator.NewLine);
|
|
if (bHasEditorConfiguration && TargetName != "UE4")
|
|
{
|
|
Content.Append(" <CommandLineArguments>" + ProjectFileGenerator.NewLine);
|
|
if (IsForeignProject)
|
|
{
|
|
Content.Append(" <CommandLineArgument" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" argument = \""" + GameProjectPath + ""\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" isEnabled = \"YES\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </CommandLineArgument>" + ProjectFileGenerator.NewLine);
|
|
}
|
|
else
|
|
{
|
|
Content.Append(" <CommandLineArgument" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" argument = \"" + TargetName + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" isEnabled = \"YES\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </CommandLineArgument>" + ProjectFileGenerator.NewLine);
|
|
}
|
|
Content.Append(" </CommandLineArguments>" + ProjectFileGenerator.NewLine);
|
|
}
|
|
Content.Append(" <AdditionalOptions>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </AdditionalOptions>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </LaunchAction>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <ProfileAction" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" buildConfiguration = \"" + DefaultConfiguration + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" shouldUseLaunchSchemeArgsEnv = \"YES\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" savedToolIdentifier = \"\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" useCustomWorkingDirectory = \"NO\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" debugDocumentVersioning = \"YES\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <BuildableProductRunnable" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" runnableDebuggingMode = \"0\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <BuildableReference" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BuildableIdentifier = \"primary\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BlueprintIdentifier = \"" + TargetGuid + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BuildableName = \"" + TargetName + ".app\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" BlueprintName = \"" + TargetName + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" ReferencedContainer = \"container:" + TargetName + ".xcodeproj\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </BuildableReference>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </BuildableProductRunnable>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </ProfileAction>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <AnalyzeAction" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" buildConfiguration = \"" + DefaultConfiguration + "\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </AnalyzeAction>" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" <ArchiveAction" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" buildConfiguration = \"" + DefaultConfiguration + "\"" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" revealArchiveInOrganizer = \"YES\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append(" </ArchiveAction>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("</Scheme>" + ProjectFileGenerator.NewLine);
|
|
|
|
DirectoryReference SchemesDir = new DirectoryReference(ProjectFilePath.FullName + "/xcshareddata/xcschemes");
|
|
if (!SchemesDir.Exists())
|
|
{
|
|
SchemesDir.CreateDirectory();
|
|
}
|
|
|
|
string SchemeFilePath = SchemesDir + "/" + TargetName + ".xcscheme";
|
|
File.WriteAllText(SchemeFilePath, Content.ToString(), new UTF8Encoding());
|
|
|
|
Content.Clear();
|
|
|
|
Content.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append("<plist version=\"1.0\">" + ProjectFileGenerator.NewLine);
|
|
Content.Append("<dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t<key>SchemeUserState</key>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t<dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t<key>" + TargetName + ".xcscheme_^#shared#^_</key>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t<dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t<key>orderHint</key>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t<integer>" + SchemeOrderHint.ToString() + "</integer>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t</dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t</dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t<key>SuppressBuildableAutocreation</key>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t<dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t<key>" + TargetGuid + "</key>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t<dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t<key>primary</key>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t<true/>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t</dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t<key>" + BuildTargetGuid + "</key>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t<dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t<key>primary</key>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t<true/>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t</dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t<key>" + IndexTargetGuid + "</key>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t<dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t<key>primary</key>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t\t<true/>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t\t</dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("\t</dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("</dict>" + ProjectFileGenerator.NewLine);
|
|
Content.Append("</plist>" + ProjectFileGenerator.NewLine);
|
|
|
|
DirectoryReference ManagementFileDir = new DirectoryReference(ProjectFilePath.FullName + "/xcuserdata/" + Environment.UserName + ".xcuserdatad/xcschemes");
|
|
if (!ManagementFileDir.Exists())
|
|
{
|
|
ManagementFileDir.CreateDirectory();
|
|
}
|
|
|
|
string ManagementFilePath = ManagementFileDir + "/xcschememanagement.plist";
|
|
File.WriteAllText(ManagementFilePath, Content.ToString(), new UTF8Encoding());
|
|
|
|
SchemeOrderHint++;
|
|
}
|
|
|
|
/// Implements Project interface
|
|
public override bool WriteProjectFile(List<UnrealTargetPlatform> InPlatforms, List<UnrealTargetConfiguration> InConfigurations)
|
|
{
|
|
bool bSuccess = true;
|
|
|
|
var TargetName = ProjectFilePath.GetFileNameWithoutExtension();
|
|
var TargetGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var TargetConfigListGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var TargetDependencyGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var TargetProxyGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var TargetAppGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var BuildTargetName = TargetName + "_Build";
|
|
var BuildTargetGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var BuildTargetConfigListGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var IndexTargetName = TargetName + "_Index";
|
|
var IndexTargetGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var IndexTargetConfigListGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var ProjectGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var ProjectConfigListGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var MainGroupGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var ProductRefGroupGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
var SourcesBuildPhaseGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
|
|
|
|
// Figure out all the desired configurations
|
|
var BuildConfigs = GetSupportedBuildConfigs(InPlatforms, InConfigurations);
|
|
if (BuildConfigs.Count == 0)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
bool bIsAGame = false;
|
|
FileReference GameProjectPath = null;
|
|
List<DirectoryReference> GameFolders = UEBuildTarget.DiscoverAllGameFolders();
|
|
foreach (var GameFolder in GameFolders)
|
|
{
|
|
FileReference UProjectPath = FileReference.Combine(GameFolder, TargetName + ".uproject");
|
|
if (UProjectPath.Exists())
|
|
{
|
|
bIsAGame = true;
|
|
GameProjectPath = UProjectPath;
|
|
break;
|
|
}
|
|
}
|
|
|
|
bool bHasEditorConfiguration = false;
|
|
|
|
var ProjectBuildConfigs = new Dictionary<string, XcodeBuildConfig>();
|
|
var TargetBuildConfigs = new Dictionary<string, XcodeBuildConfig>();
|
|
var BuildTargetBuildConfigs = new Dictionary<string, XcodeBuildConfig>();
|
|
var IndexTargetBuildConfigs = new Dictionary<string, XcodeBuildConfig>();
|
|
foreach (var Config in BuildConfigs)
|
|
{
|
|
ProjectBuildConfigs[XcodeProjectFileGenerator.MakeXcodeGuid()] = Config;
|
|
TargetBuildConfigs[XcodeProjectFileGenerator.MakeXcodeGuid()] = Config;
|
|
BuildTargetBuildConfigs[XcodeProjectFileGenerator.MakeXcodeGuid()] = Config;
|
|
IndexTargetBuildConfigs[XcodeProjectFileGenerator.MakeXcodeGuid()] = Config;
|
|
|
|
if (Config.ProjectTarget.TargetRules.Type == TargetRules.TargetType.Editor)
|
|
{
|
|
bHasEditorConfiguration = true;
|
|
}
|
|
}
|
|
|
|
var PBXBuildFileSection = new StringBuilder();
|
|
var PBXFileReferenceSection = new StringBuilder();
|
|
var PBXSourcesBuildPhaseSection = new StringBuilder();
|
|
GenerateSectionsWithSourceFiles(PBXBuildFileSection, PBXFileReferenceSection, PBXSourcesBuildPhaseSection, TargetAppGuid, TargetName);
|
|
|
|
var ProjectFileContent = new StringBuilder();
|
|
|
|
ProjectFileContent.Append("// !$*UTF8*$!" + ProjectFileGenerator.NewLine);
|
|
ProjectFileContent.Append("{" + ProjectFileGenerator.NewLine);
|
|
ProjectFileContent.Append("\tarchiveVersion = 1;" + ProjectFileGenerator.NewLine);
|
|
ProjectFileContent.Append("\tclasses = {" + ProjectFileGenerator.NewLine);
|
|
ProjectFileContent.Append("\t};" + ProjectFileGenerator.NewLine);
|
|
ProjectFileContent.Append("\tobjectVersion = 46;" + ProjectFileGenerator.NewLine);
|
|
ProjectFileContent.Append("\tobjects = {" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
|
|
|
|
AppendBuildFileSection(ProjectFileContent, PBXBuildFileSection);
|
|
AppendFileReferenceSection(ProjectFileContent, PBXFileReferenceSection);
|
|
AppendSourcesBuildPhaseSection(ProjectFileContent, PBXSourcesBuildPhaseSection, SourcesBuildPhaseGuid);
|
|
AppendContainerItemProxySection(ProjectFileContent, BuildTargetName, BuildTargetGuid, TargetProxyGuid, ProjectGuid);
|
|
if (!XcodeProjectFileGenerator.bGeneratingRunIOSProject && !XcodeProjectFileGenerator.bGeneratingRunIOSProject)
|
|
{
|
|
AppendTargetDependencySection(ProjectFileContent, BuildTargetName, BuildTargetGuid, TargetDependencyGuid, TargetProxyGuid);
|
|
}
|
|
AppendGroupSection(ProjectFileContent, MainGroupGuid, ProductRefGroupGuid, TargetAppGuid, TargetName);
|
|
AppendLegacyTargetSection(ProjectFileContent, BuildTargetName, BuildTargetGuid, BuildTargetConfigListGuid, GameProjectPath);
|
|
AppendRunTargetSection(ProjectFileContent, TargetName, TargetGuid, TargetConfigListGuid, TargetDependencyGuid, TargetAppGuid);
|
|
AppendIndexTargetSection(ProjectFileContent, IndexTargetName, IndexTargetGuid, IndexTargetConfigListGuid, SourcesBuildPhaseGuid);
|
|
AppendProjectSection(ProjectFileContent, TargetName, TargetGuid, BuildTargetName, BuildTargetGuid, IndexTargetName, IndexTargetGuid, MainGroupGuid, ProductRefGroupGuid, ProjectGuid, ProjectConfigListGuid);
|
|
AppendXCBuildConfigurationSection(ProjectFileContent, ProjectBuildConfigs, TargetBuildConfigs, BuildTargetBuildConfigs, IndexTargetBuildConfigs, bIsAGame, GameProjectPath);
|
|
AppendXCConfigurationListSection(ProjectFileContent, TargetName, BuildTargetName, IndexTargetName, ProjectConfigListGuid, ProjectBuildConfigs,
|
|
TargetConfigListGuid, TargetBuildConfigs, BuildTargetConfigListGuid, BuildTargetBuildConfigs, IndexTargetConfigListGuid, IndexTargetBuildConfigs);
|
|
|
|
ProjectFileContent.Append("\t};" + ProjectFileGenerator.NewLine);
|
|
ProjectFileContent.Append("\trootObject = " + ProjectGuid + " /* Project object */;" + ProjectFileGenerator.NewLine);
|
|
ProjectFileContent.Append("}" + ProjectFileGenerator.NewLine);
|
|
|
|
if (bSuccess)
|
|
{
|
|
var PBXProjFilePath = ProjectFilePath + "/project.pbxproj";
|
|
bSuccess = ProjectFileGenerator.WriteFileIfChanged(PBXProjFilePath.FullName, ProjectFileContent.ToString(), new UTF8Encoding());
|
|
}
|
|
|
|
if (bSuccess)
|
|
{
|
|
WriteSchemeFile(TargetName, TargetGuid, BuildTargetGuid, IndexTargetGuid, bHasEditorConfiguration, GameProjectPath != null ? GameProjectPath.FullName : "");
|
|
}
|
|
|
|
return bSuccess;
|
|
}
|
|
|
|
static private int SchemeOrderHint = 0;
|
|
}
|
|
}
|