Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/ProjectFiles/Xcode/XcodeProject.cs
Matt Kuhlenschmidt cd967bc733 Copying //UE4/Dev-Editor to //UE4/Dev-Main (Source: //UE4/Dev-Editor @ 3807299)
#lockdown Nick.Penwarden
#rb none

============================
  MAJOR FEATURES & CHANGES
============================

Change 3528776 by Yannick.Lange

	Allow thumbnails to be captured from a viewport always.

	#jira UE-45392

Change 3564359 by Yannick.Lange

	Back out part of changelist 3528776: Revert allowing thumbnails to be captured from a viewport to fix UE-47827 & UE-47785.

	#jira UE-47785,  UE-47827

Change 3740671 by Matt.Kuhlenschmidt

	Make the font editor canvas respect dpi scale

Change 3740810 by Josh.Engebretson

	PR #4138: Log GenerateProjectFiles to file when using UVS (Contributed by projectgheist)
	#jira UE-51358

Change 3740939 by Cody.Albert

	Fixing some #ifdefs that should be #ifs

Change 3741089 by Alexis.Matte

	Make sure bImportBoneTracks is set to true when importing into level
	#jira UE-51999

Change 3741101 by Alexis.Matte

	Fix the import material search
	#jira UE-51857

Change 3741690 by Jamie.Dale

	Guard against an invalid index in SLocalizationCommandletExecutor::Tick

	#jira UE-52067

Change 3741710 by Jamie.Dale

	Made a static variable also const

Change 3741724 by Michael.Dupuis

	Added missing shader cache

Change 3742037 by Lauren.Ridge

	Details panels can now "own" a color picker so a different details panel refreshing doesn't close it. Also fixed refreshing state of the graph after changing texture or color parameter values

Change 3742250 by Matt.Kuhlenschmidt

	PR #4185: Output Log Filter tooltip shows %s instead of category. (Contributed by LordNed)


Change 3742308 by Lauren.Ridge

	Adding axis input to the material editor's viewport client

Change 3742380 by Matt.Kuhlenschmidt

	USD importer improvements

	- USD now stores source file information for reimports
	- Fixed bug where no geometry would be imported if an exporter had set a time code even without animated data
	- Prevent a crash if a mesh doesnt have enough valid data to be imported

Change 3742536 by Matt.Kuhlenschmidt

	Remove usd wrapper test project

Change 3743564 by Alexis.Matte

	Fix skeletal mesh screen size auto set value when importing a LOD

	#test none
	#jira UE-52100

Change 3743582 by Lauren.Ridge

	Fixing non-desktop compiles

Change 3743598 by Lauren.Ridge

	Fixing shadowed variable by renaming the global color picker weak ptr variable.

Change 3743636 by Lauren.Ridge

	Creating a new parameter immediately allows naming

Change 3743855 by Michael.Dupuis

	Added missing shader from cache

Change 3744277 by Lauren.Ridge

	Don't show empty Global group if it only contained the material layer param.

Change 3744330 by Lauren.Ridge

	Clarifying "no parameter" text

Change 3744529 by Lauren.Ridge

	Making Save to Child and Save To Sibling buttons work for material layer params, show on material layer param panel

Change 3744668 by Chris.Bunner

	Added shared layer input collection asset, a list of float/texture redirectors that allow setting globally in a material graph then retrieving within layer/blend graphs.
	Added output for number of unique shaders generated by a particular material instance.
	Show instruction counts when working on a material layer.
	Relaxed restrictions on material layers, base MA input is now optional.

	#jira UETOOL-1271, UETOOL-1278, UETOOL-1279

Change 3744669 by Chris.Bunner

	Added automated test for material layers, layer/blend instances and shared inputs.

Change 3744754 by Laz.Matech

	Adding localization data to QAGame for the Realtime Preview localization test.

	#jira none

Change 3744860 by Michael.Dupuis

	#jira UE-52049 : Do not update random stream in most case, only when adding new instances, or filling from built data

Change 3744965 by Chris.Bunner

	Rebuilt lighting in automated test map and updated reflection capture screenshot.

Change 3746015 by Michael.Dupuis

	#jira UE-52090: Added missing shader for forward rendering

Change 3746038 by Michael.Dupuis

	#jira UE-51494: Make sure index is valid for this instance as instances from template and instance could mismatch due to in level changes

Change 3746076 by Michael.Dupuis

	Removed unused code

Change 3746998 by Tim.Gautier

	QAGame: - Renamed UMG_RealtimePreview > UMG_InEditorPreview
	- Moved UMG_InEditorPreview into UMG > Localization, setting up for future Localization tests

Change 3747206 by Arciel.Rekman

	Linux: make UI scale more coarse to prevent unnecessary scaling (UE-52086).

	- Monitors whose physical dimensions fall in range of 80-110 DPI should still have scale=1.0.

	(Edigrating CL 3740942 from Release-4.18 to Dev-Editor)

Change 3747211 by Arciel.Rekman

	Make failure to launch SCW more apparent to the user (UE-47263).

	- Fixes frequent crash on Linux.

	(Merging 3747070 from Release-4.18 to Dev-Editor)

Change 3747726 by Tim.Gautier

	QAGame: Resubmitting updated Loc files

Change 3747872 by Tim.Gautier

	QAGame: Resubmitting compiled Loc assets

Change 3748118 by Lauren.Ridge

	Adding help text to the material layers preview tab

Change 3748398 by Lauren.Ridge

	Fixing tooltips for the material layer read-only preview

Change 3748565 by Arciel.Rekman

	Linux: fix RHIs settings being wrong when removed via project properties (UE-51203).

	- This was a deeper issue with config system than just Linux RHIs.
	- This is a better fix than one submitted to 4.18 branch in CL 3747086.

Change 3749441 by Matt.Kuhlenschmidt

	PR #4201: Fix a typo in a comment. (Contributed by dneelyep)


Change 3749442 by Matt.Kuhlenschmidt

	PR #4195: Incorrect specifier used for FText::Format (Contributed by projectgheist)


Change 3749496 by Matt.Kuhlenschmidt

	Fix static analysis

Change 3749805 by Lauren.Ridge

	Fixing reset to default on MaterialLayerParam in base material

Change 3749838 by Lauren.Ridge

	Also correctly resetting names and layer states

Change 3750442 by Mieszko.Zielinski

	Added a safety check which addresses the crash #UE4

	Note that this is a temp fix. A proper fix is making sure ConvexShapeIndices doesn't contain any duplicates and will be inplemented in Dev-Framework.

	#jira UE-52123

Change 3752266 by Arciel.Rekman

	OpenGL: remove PLATFORM_WINDOWS exceptions.

	- Discrepancy in behavior between Windows and Linux OpenGL is unhelpful for bug reproducibility.
	- VAB bug should have been fixed long ago (on both platforms).

Change 3752929 by Arciel.Rekman

	Linux: avoid crashing on unknown drivers.

	- See https://answers.unrealengine.com/questions/724100/crashes-on-startup-after-first-run.html
	- Checks in IsDeviceIntel() and such fail if the drivers were not detected.

Change 3753254 by Michael.Dupuis

	Added missing shader for shader cache

Change 3753426 by Michael.Dupuis

	#jira UE-5751: Added the possibility to change material instance exposed params at runtime using a MID for texture, vector and scalar for 1 component or all components

Change 3753440 by Alexis.Matte

	Fix fbx scene importer morph target import crash

	#jira UE-52255

Change 3753457 by Michael.Dupuis

	build fix

Change 3753700 by Chris.Bunner

	Make GetSharedInput preview fallback always available in editor as this should handle previews, thumbnails and other editor-only cases.
	Refactor to remove duplicate code in material translator.
	Material layer expressions are required for client load, fixes cooked builds using layer instances in the base material layer stack.

Change 3754760 by Chris.Bunner

	Tidying up EngineTest/ShaderModels map.

Change 3754765 by Arciel.Rekman

	Avoid placing tooltip windows under the cursor (UE-12288).

	- Fixes inability to use some corners of the screen on Linux (the tooltips there aren't click-through).

Change 3754788 by Matt.Kuhlenschmidt

	Fix details panel crash after compiling blueprints that have edit conditon properties

Change 3754933 by Christina.TempelaarL

	Fixed typo in heightLerp (transistion->transition).
	#jira UE-46736

Change 3754946 by Cody.Albert

	Update loading movie code to properly calculate delta time when throttled at 60fps

Change 3755059 by Jamie.Dale

	Fixed game preview language not updating in realtime while PIE was enabled

	#jira UE-52209

Change 3755130 by Jamie.Dale

	Fixed game preview language not updating from native when switching between preview languages

	#jira UE-52348

Change 3755664 by Michael.Dupuis

	Fixed compile warning

Change 3755714 by Yannick.Lange

	Always allow capturing thumbnails from viewport.
	This also hides the thumbnail editing UI when a thumbnail was captured from a viewport.

Change 3755944 by Alexis.Matte

	Fix crash when importing morph target with "built in" tangent option

	#jira UE-52319

Change 3756109 by Christina.TempelaarL

	fixed FBX importer Import Textures tooltip, UMaterial -> Material in tooltip text
	#jira UE-48389

Change 3756169 by Jamie.Dale

	Added plural form pattern to SContentBrowser::GetPathText

Change 3756493 by Laz.Matech

	Updating Localization content to further test InEditor Preview Language in UMG

	#jira none

Change 3758336 by Alexis.Matte

	Fix a crash when importing morph target there was a unsync between some buffer depending on the import options

	#jira UE-52319

Change 3758947 by Jamie.Dale

	Fixed cursor position regression in search boxes

	This was caused by a call to SetText that was added in CL# 3627864

	This caused the text to update as it was changed, which made the cursor jump to the end of the text and made it impossible to type in the middle of a search term.

	This was done as a bound FText value had been passed to the InitalText of SSearchBox, which made the text resolution behave strangely. InitalText should always be a value, and SSearchBox now resolves any bindings during its constructor.

	#jira UE-48874

Change 3759000 by Laz.Matech

	Submitting the .PO file for CL 3756493

	#jira none

Change 3759480 by Matt.Kuhlenschmidt

	Safe guard against brush details crash

	#jira UE-52278

Change 3759665 by Matt.Kuhlenschmidt

	PR #4214: UE-52249: Use valid PreviewShadowsIndicatorMaterialName (Contributed by projectgheist)


Change 3761211 by Matt.Kuhlenschmidt

	Remove the restriction that a level must be writable to be locked/unlocked.
	Fixed duplicate icons being used by the level browser

Change 3761304 by Chris.Bunner

	MaterialAttributeLayers graph node BaseMA input is no longer required.
	Note: Requires "Use Preview Value" set to true on inputs.

Change 3761307 by Chris.Bunner

	New material layers and blends will have "Use Preview Value" set to true by default to avoid the need for connected inputs - Missed file on previous commit.

Change 3761357 by Chris.Bunner

	Renamed material shared input enum.

Change 3761419 by Chris.Bunner

	Updating material layers automated test assets after recent changes.
	Reverted some naming changes so existing screenshot tests can be reused.

Change 3762058 by tim.gautier

	QAGame: Adding Material Layer assets for testing (Content/Materials/LayerFunction)

Change 3763328 by Matt.Kuhlenschmidt

	Fix Slate warning at editor startup

Change 3763354 by Alexis.Matte

	Fix skeletal mesh material assign when reducing a LOD that was import from a file using simplygon reduction

	#jira UE-52505

Change 3763501 by Matt.Kuhlenschmidt

	Prevent shared asset thumbnail pools from having their resources forcefully released when they are in use.  ReleaseResources is now private and only called on destruction of the pool

Change 3763574 by Matt.Kuhlenschmidt

	Fix slate material box brushes not being keyed off image size

	#jira UE-40219

Change 3763678 by Jamie.Dale

	Disable realtime level editor viewport if running under remote desktop

	This makes the main editor window much more responsive by default under remote desktop

Change 3763679 by Jamie.Dale

	Added asset caching metrics for the loc gather

Change 3763693 by Matt.Kuhlenschmidt

	Changed the code that activates the actor details tab  when selection changes to a flash. There are simply too many things that change the selection and steal focus away from a tab being used

	#jira UE-51754

Change 3763826 by Michael.Dupuis

	Fixed Fortnite cooking crash

Change 3763864 by Harrison.Moore

	Adding New Default 'LayerBlend' assets

Change 3764028 by Christina.TempelaarL

	#jira UE-47695 Auto LOD bug

	Moved the sections dropdown to the LOD Picker category and modified Custom cb behavior, based on suggestions from charlie.

Change 3764031 by Christina.TempelaarL

	#jira UE-47695 Auto LOD in StaticMeshViewer

	moved LOD combo widget to LOD picker category and hide custom checkboxes until custom checked.

Change 3764076 by tim.gautier

	QAGame: Submitting UMG_Multitouch_test for initial Multitouch testing

Change 3764263 by Matt.Kuhlenschmidt

	Fix the floor mesh thumbnail

Change 3764284 by Chris.Bunner

	Removing some asserts for cases that can validly fail and are already handled.

Change 3764372 by Matt.Kuhlenschmidt

	PR #4196: Show edit icons in editor (Contributed by projectgheist)


Change 3764388 by Chris.Bunner

	Fixing logic for material, function and instance updating active materials and instances and their editors.

Change 3764674 by Harrison.Moore

	test materials added, Blend updates

Change 3764681 by Harrison.Moore

	Adding HMtest map

Change 3766238 by Chris.Bunner

	Material layer callers need to let their internal material function calls update their inputs/outputs.

Change 3766556 by Jamie.Dale

	Fixed crashes that could happen if some of the data table panels were closed

	We now always create the underlying widgets, even if they're currently hidden from view

	#jira UE-52552

Change 3767753 by Chris.Bunner

	When rebuilding a material function instance editor we must re-create and re-apply the proxies as the expressions have likely changed. Take care to maintain local parameter changes as these have not been saved yet.

Change 3768719 by Michael.Dupuis

	#jira UE-52521: Prevent possible crash if a segment have no point or invalid point

Change 3769157 by Jamie.Dale

	Fixed incorrect text selection if selecting via double click beyond the bounds of the line

	It would previously select the second to last word, rather than the last word

	#jira UE-51609

Change 3769159 by Harrison.Moore

	Belica Test update, New layer blends updated with texture type fix.

Change 3769205 by Jamie.Dale

	Fixed Windows file save dialog not appending the correct extension when there were multiple options available

	#jira UE-52180

Change 3769220 by Harrison.Moore

	Layer blend tweaks

Change 3769292 by Jamie.Dale

	Removing redundant code

	Applying the correct package ID, only to then strip it off again is rather pointless

Change 3769479 by Arciel.Rekman

	UBT: Use response files for compiler when compiling for Linux.

	- Some command lines are too long when cross-compiling on Windows.

Change 3769920 by Arciel.Rekman

	Linux: convert yet another initialization crash to a user-friendly message (UE-52457).

	#jira UE-52457

Change 3771055 by Alexis.Matte

	Make sure we set the Used by morph target material flag to material use by the morphtarget instead of all skinned mesh component
	Use the morph vertex factory only for section that has active morph target

	#jira UE-51483

Change 3771135 by Michael.Dupuis

	Fixed fortnite cooking

Change 3773054 by Yannick.Lange

	Avoid loading viewport interaction assets when starting the editor.

Change 3774184 by Arciel.Rekman

	Linux: disabled some gdb visualizers until the issue is fixed.

	- CL 3773942 by CengizT.

Change 3774303 by Matt.Kuhlenschmidt

	Pull requests to fix various typos

Change 3774305 by Matt.Kuhlenschmidt

	PR #4237: Visual Studio Repeatedly Opens (UE-51608) (Contributed by LordNed)


	#jira UE-51608

Change 3774701 by Arciel.Rekman

	OpenGL: fix ARB callback errors when hitting Build Lighting.

	- Merged from 4.18 shelf.

Change 3775812 by Matt.Kuhlenschmidt

	Fix One-off crash undo-ing while working with Material Params / Material Functions

	#jira UE-52680

Change 3775849 by Matt.Kuhlenschmidt

	More info for UE-52610

Change 3775850 by Matt.Kuhlenschmidt

	Guard against mesh paint crashes

	#jira UE-52618

Change 3775904 by Matt.Kuhlenschmidt

	Added logging to track down window shutdown issues

Change 3775913 by Matt.Kuhlenschmidt

	Pull requests for typos

	#jira UE-52751, UE-52748

Change 3776676 by Jamie.Dale

	Fixed being able to insert tabs into spin boxes with units

	#jira UE-52776

Change 3777006 by Michael.Trepka

	Process Mac windowDidBecomeMain and windowDidResignMain notifications immediately instead of deferring them. This solves issues with Slate code that closes and immediately opens new menu windows. Previously closing a window would schedule menu parent's activation event that could be processed after another menu's creation, making it immediately disappear.

	#jira UE-52145

Change 3777170 by Arciel.Rekman

	Linux: use Xft.dpi (most desktop environments expose their scale through that) as a DPI value (UE-52086, UE-52766).

	- Change by Brandon.Schaefer.
	- Limitation: no per-monitor DPI.

	(Edigrating CL 3776509 //UE4/Release-4.18/... to //UE4/Dev-Editor/...)

Change 3777292 by Arciel.Rekman

	Linux: fix symbol collision causing problems with AMD drivers (UE-51843).

	- We cannot have elf_end() hidden, because libcuda.so calls elf_end from libnvidia-fatbinaryloader.so and this breaks linking monolithic binaries ("hidden symbol referenced in DSO").
	- We cannot have elf_end() visible, because of a name collision with a different libelf used by AMD drivers.
	- The only possible workaround is to have elf_end() renamed.

	(Edigrating CL 3777242 from //UE4/Release-4.18/... to //UE4/Dev-Editor/...)

Change 3777686 by Joe.Conley

	Blueprint editor variable type tooltips: fix case mismatch that was preventing type name to be displayed properly in soft object/class reference tooltips.

Change 3778180 by Jamie.Dale

	Avoid a crash if a regex pattern or matcher outlive ICU during shutdown

	#jira UE-52770

Change 3778182 by Jamie.Dale

	Avoid a crash if a break iterator outlives ICU during shutdown

Change 3778368 by Jamie.Dale

	Added missing pragma once

Change 3778560 by Matt.Kuhlenschmidt

	Prevent non-shared DDC notification from triggering for epic internal builds

Change 3778709 by Lauren.Ridge

	Copying 4.18.2 array reordering propagating to children fix (originally 3778547)

Change 3779205 by Lauren.Ridge

	Duplicating 3776649 to fix a crash on compile due to partial GC of a widget.

	#jira UE-52260

Change 3779217 by Brandon.Schaefer

	GitHub #3678 Fix Setup.sh handling of special characters in PNG path

	#jira UE-46103

Change 3779341 by Brandon.Schaefer

	GitHub #3012 Use elemtry OS versions to set the ubuntu versions for depencies

	#jira UE-39364

Change 3780274 by Joe.Conley

	DataTables: Add documentation tooltips showing type information to header columns

Change 3780840 by Alexis.Matte

	Do a re-import when user re-import LOD 0
	Prevent importing more then MAX_SKELETAL_MESH_LODS
	#jira UE-52373

Change 3781067 by Arciel.Rekman

	Linux: fix OSSSteam cross-compilation (and CIS).

	- Broken by previous change that put compile-time arguments into response file and bulk-replaced \ with /, which affected things like Definitions.Add("STEAM_SDK_VER_PATH=TEXT(\"Steam" + SteamVersion + "\")");

Change 3781110 by Christina.TempelaarL

	#jira UE-47695 moved Static Mesh Editor LOD menu from tools to viewport tool bar

Change 3781531 by Christina.TempelaarL

	#jira UE-47695 added LOD menu to Static Mesh Editor viewport

Change 3781663 by Alexis.Matte

	Fix for cancel export fbx when previewing animation sequence export
	#jira UE-49743

Change 3782007 by Jamie.Dale

	Improved the ability to lockdown available game languages

	In addition to the previous "DisabledCultures" array, you can now add an array of "EnabledCultures" (using the same per-build config filters) to explicitly list the cultures that are allowed to be used in your build (if the list is empty, then everything is allowed unless otherwise disabled).

	This also stops the game from attempting to fallback to the native language if the native language has been disabled (we will fallback to the first available language instead).

Change 3782122 by Jordan.Walker

	test assets for material layers

Change 3782131 by Joe.Graf

	Added support for IOS and TVOS targets when generating CMake files on Mac

Change 3782218 by Christina.TempelaarL

	fixing include paths and capitalization causing build errors.

Change 3783171 by Michael.Dupuis

	Added the possibility to override default LOD rules for visible primitive and whole scene shadow casting primitive
	Added the possibility to store Custom data per view for the frame duration

Change 3783172 by Michael.Dupuis

	#jira UE-35097	: Refactored landscape rendering logic to improve general performance while using new custom data and custom lod feature
	Exposed many new settings to control component using sub sections rendering, tessellated component, shadow should be include into tessellation, tessellation falloff based on camera location
	Changed how LOD distribution is done to be in screen size instead of distance.
	Give the possibility to have a different distribution for LOD0 vs the other one.

Change 3783174 by Michael.Dupuis

	missing file to landscape refactor

Change 3783315 by Lauren.Ridge

	Changing a parameter in the Material Parameter Panel now dirties the material correctly.
	Changing a layer parameter in the Material Instance Editor now refreshes the details panel as well.

Change 3783374 by Chris.Bunner

	Adding MaterialSharedInputCollection to hidden list when MaterialLayers disabled.

Change 3783617 by Chris.Bunner

	Added a Channel Mask material expression parameter. Wraps up a vector parameter and dot product with a single channel selection interface, internally a regular vector parameter.
	Fixed GetSharedInput failing to return the preview texture in the Function Instance editor.

Change 3783676 by Lauren.Ridge

	Adding access to a material function instance's parent in the Material Instance Editor

Change 3783751 by Michael.Trepka

	PR #4248: Fixed C++ std in generated Xcode project to match rest of engine (C++14) (Contributed by Bo98)


Change 3783971 by Brandon.Schaefer

	Rename/Move all deploy/Deploy folder/files into AlembicDeploy. Due to case sensitivity on linux, need to maintain the correct case.

	#jira UE-37631

Change 3783992 by Michael.Dupuis

	#jira UE-35097: Remove tessellation on editor tools
	Fixed a case where tessellation multiplier at 0 would cause the component to not be visible
	Fixed minor tessellation falloff calculation error

Change 3784502 by Chris.Bunner

	Restored missing bool setter.
	Coding standards fix.

Change 3784614 by Arciel.Rekman

	Linux: better error message when running out of inotify watches (UE-50459).

	#jira UE-50459

Change 3784620 by Chris.Bunner

	Updated LayerBlend_TextureMask to use new ChannelMask parameter.

Change 3784725 by Lauren.Ridge

	Fixing groups not sorting correctly

Change 3785645 by Chris.Bunner

	Non-editor compile fix.

Change 3785666 by Arciel.Rekman

	Linux: restore ability to use Wayland instead of X11.

	- SDL libs recompiled and Wayland version is set to lower one to be compatible with the compositor shipped on Ubuntu 16.04 LTS
	- Change by Anthony.Bills.

Change 3785708 by Arciel.Rekman

	Linux: implement voice capture using SDL (non-server only) (UE-51298).

	- Based on pull request #4131 by mkirzinger.

Change 3785878 by Arciel.Rekman

	UBT: add VSCode to default generators on Linux.

Change 3786058 by Arciel.Rekman

	Do not add dependencies on other RHIs for servers (UE-48894).

	- Pull request #3944 contributed by pfoote.


	#jira UE-48894

Change 3786845 by Arciel.Rekman

	Code changes to make gcc support easier (UE-51978).

	- Contributed by a licensee (pull request #4181 by tomwardio "Collection of fixes to allow UE4 to be compiled by GCC on Linux").

Change 3786871 by Matt.Kuhlenschmidt

	Fix static analysis

Change 3786883 by Matt.Kuhlenschmidt

	Fix HTML5

Change 3786923 by Matt.Kuhlenschmidt

	Fix engine layer blend asset referencing game content.  This is not allowed

	#jira UE-52888

Change 3786927 by Brandon.Schaefer

	Linux: Alembic support

	#jira: UE-37631

Change 3786994 by Arciel.Rekman

	Remove support for /-prefixed switches (UE-47429).

	- They collide with absolute file paths on Mac/Linux and a source of inconsistencies between platforms.

	#jira UE-47429

Change 3787032 by Michael.Trepka

	Initial support for building and running Niagara on Mac

Change 3787035 by Brandon.Schaefer

	GitHub #4166 Undef GL entrypoint macros after use

	#jira UE-51663

Change 3787144 by Lauren.Ridge

	Fixing material parameter group association resetting after undo

	#jira UE-52514

Change 3787839 by Jordan.Walker

	updated engine level layer blends to not include game content
	switched them to use Chris B's new mask selection node

Change 3787967 by Lauren.Ridge

	Fix for broken layer groups, related crash

Change 3787991 by Lauren.Ridge

	Fixing thumbnails for material function instances, resolving not being able to delete new function instances

	#jira UE-52967

Change 3788226 by Michael.Trepka

	Fixed a deadlock when closing Mac CrashReportClient which resulted from changes in CL 3777006

	#jira UE-53002

Change 3788557 by Brandon.Schaefer

	Fix shadow compiler warnings around our includes

Change 3789700 by Lauren.Ridge

	Experimental setting for turning on Material Layers - off by default.

Change 3789703 by Jamie.Dale

	Harden the LocMeta and LocRes loading to prevent loading files that are too new

Change 3789706 by Jamie.Dale

	Added localization ID to the package summary

	This will allow the localization gatherer to query it without having to load the entire package

Change 3789708 by Jamie.Dale

	Added a way to display and reset the package localization ID via the Content Browser

Change 3789709 by Jamie.Dale

	Added warning for duplicate package localization IDs when gathering asset localization

Change 3789713 by Jamie.Dale

	Special case zero-width space in the text shaper to avoid fonts rendering the fallback glyph

Change 3789736 by Christina.TempelaarL

	Fixed recently-introduced StaticMeshEditor bug - changing LOD dropdown menu selection was not changing LOD sections category.

Change 3789853 by Chris.Bunner

	Material instances should return overridden values when the caller is requesting the default, not leaving the request to fall through to the base material.

	#jira UE-52796

Change 3790185 by Brandon.Schaefer

	Add better error handling when using new SDK for linux on windows.

	#jira UE-50527

Change 3790195 by Jamie.Dale

	Fixed line-ending inconsistency when retrieving rich-text

	We were using LINE_TERMINATOR when getting the offsets, but \n when getting the text

Change 3790473 by Chris.Bunner

	When finding expression by GUID, only return FunctionCall result if expression was found. Fixes cases where searched-for expression is after a FunctionCall in the expressions list.

	#jira UE-52729

Change 3790650 by Arciel.Rekman

	UBT: Linux: print build details first before refusing to build.

	- Tweak to the previous feature that we forgot.

Change 3790681 by Arciel.Rekman

	UBT: Linux: tweaks to wording (SDK -> toolchain).

Change 3791459 by Brandon.Schaefer

	Linux: libcurl rebuild for version 7.57

	#jira OGS-870

Change 3791533 by Arciel.Rekman

	Better error messaging when UMB is unusable (UE-50658).

	- Should be replaced by a better fix, but merging this workaround in case the better fix will not be done in time for 4.19.

	(Edigrating CL 3789387, 3789787 from Release-4.18 to Dev-Editor)

Change 3791885 by Matt.Kuhlenschmidt

	Fix static analysis

	#jira UE-53097

Change 3791910 by Brandon.Schaefer

	Fix for not using proper libraries on x86_64 for libcurl

	#jira OGS-870

Change 3792017 by Jamie.Dale

	Fixed a conflict between the path settings and favorite settings

Change 3792022 by Jamie.Dale

	Fixed a crash that could happen when performing ARO on the property chains of a struct

	#jira UE-52999

Change 3792025 by Jamie.Dale

	Changed package summary localization ID to be versioned by the object version to avoid changing data in unversioned cooked assets

Change 3792066 by Michael.Dupuis

	#jira UE-5751: Fixed possible crash when using dynamic matrial instance
	Added missing shaders for landscape when using tessellation

Change 3792718 by Arciel.Rekman

	OpenGL: bringing back Windows workarounds to unblock copy-up (UE-52534).

	#jira UE-52534

Change 3793018 by Mike.Erwin

	new glTF importer plugin

	Import StaticMesh, Material, and Texture assets from the Khronos glTF 2.0 format. Text (.gltf) and binary (.glb) files are supported.

	Limitations:
	- There is no options UI. All assets from the file are imported.
	- The glTF format can describe animation and whole scenes, but the initial version of this plugin does not attempt either.
	- Data encoded as Base64 data URI is not supported. This is uncommon but is part of the glTF spec.

	#jira: UE-50695

Change 3793626 by Matt.Kuhlenschmidt

	Logging for HTML5 issue

Change 3794034 by Matt.Kuhlenschmidt

	Fix CIS

Change 3794271 by Michael.Dupuis

	#jira UE-53133: Fxed shadow calculation when using non whole scene shadow

Change 3794273 by Chris.Bunner

	Function call material nodes should be created with no outputs by default.

	#jira UE-53127, UE-53128, UE-52616

Change 3794334 by Lina.Halper

	- Fix animation reinitializing when just setting new animation with single node
	- Deprecated GetScalarParameterDefault and replace that with GetScalarParameterDefaultValue

	#jira: UE-52796

Change 3794338 by Michael.Dupuis

	Fixed lod visual popping when texture mip used for landscape is not ready

Change 3794350 by Mike.Erwin

	Fix glTF importer header includes.
	Build was failing on Linux.

Change 3794357 by Michael.Dupuis

	#jira UE-53166: buildfix: removed phase 2 landscape optim leftover...

Change 3794549 by Michael.Dupuis

	#jira UE-53166 : fixed compile error

Change 3794755 by Matt.Kuhlenschmidt

	Fix automation warning

Change 3794910 by Lina.Halper

	Change material default value to be red to keep the behavior same.

	- Previous code was getting default value of parent, which was wrong, but now since we're grabbing correct value, it's not doing what it meant to do. Changed content to keep same value as parent as default.

Change 3795296 by Mike.Erwin

	glTF: fix Linux build errors

	A variable was being shadowed.

	The other errors are due to an obscure corner of the C++ spec which clang enforces.
	https://stackoverflow.com/questions/21900237/do-i-really-need-to-implement-user-provided-constructor-for-const-objects

	#jira UE-53204

Change 3797313 by Chris.Bunner

	Re-built lighting in Rendering/ShaderModels automated test map and updated failing screenshots.

	#jira UE-53198

Change 3803962 by Jamie.Dale

	Fixed struct instances not comparing against the correct default values when gathering for localization

Change 3804771 by Michael.Dupuis

	Back out changelist 3783171

Change 3804772 by Michael.Dupuis

	Back out changelist 3783172

Change 3805258 by Michael.Dupuis

	Added missing shader cache for landscape

Change 3806105 by Matt.Kuhlenschmidt

	Disable harware benchmarking during automation tests, commandlets, and on the build machine

Change 3806438 by Michael.Dupuis

	#jira UE-53228: Fixed rendering path of new landscape optim when using GDoInitViewsLightingAfterPrepass(used in Orion)

Change 3806577 by Matt.Kuhlenschmidt

	Change plugin uploading to crash reporter to only do so in editor builds

Change 3806588 by Michael.Dupuis

	Remove temp test version in landscape version

Change 3806900 by Jamie.Dale

	Fixed 'inconsistent DLL linkage' error when using older versions of Python 2.7

	#jira UE-53353

Change 3807125 by Jamie.Dale

	Fixed UBT warning after Dev-Core merge

Change 3807299 by tim.gautier

	QAGame: Checking in test asset M_LandscapeMaterial_Foliage, quicker repro for UE-53442

[CL 3807911 by Matt Kuhlenschmidt in Main branch]
2017-12-14 10:07:13 -05:00

1424 lines
74 KiB
C#

// Copyright 1998-2017 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;
using Tools.DotNETCommon;
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>
/// <param name="InOnlyGameProject"></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; explicitFileType = {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, bool bHasEditorConfiguration)
{
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 + "\\\"") + (bHasEditorConfiguration ? " -buildscw" : "") + "\";" + 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, FileReference ProjectFile)
{
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 = 0900;" + 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);
bool bAutomaticSigning = false;
if (UnrealBuildTool.IsValidPlatform(UnrealTargetPlatform.IOS))
{
IOSPlatform IOSPlatform = ((IOSPlatform)UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.IOS));
IOSProjectSettings ProjectSettings = IOSPlatform.ReadProjectSettings(ProjectFile);
bAutomaticSigning = ProjectSettings.bAutomaticSigning;
}
if (UnrealBuildTool.IsValidPlatform(UnrealTargetPlatform.TVOS))
{
TVOSPlatform TVOSPlatform = ((TVOSPlatform)UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.TVOS));
TVOSProjectSettings ProjectSettings = TVOSPlatform.ReadProjectSettings(ProjectFile);
TVOSProvisioningData ProvisioningData = TVOSPlatform.ReadProvisioningData(ProjectSettings);
bAutomaticSigning = ProjectSettings.bAutomaticSigning;
}
if (bAutomaticSigning)
{
Content.Append("\t\t\t\t\t\tProvisioningStyle = Automatic;" + ProjectFileGenerator.NewLine);
}
else
{
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 8.0\";" + 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("\"", "").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 SearchPath in IntelliSenseSystemIncludeSearchPaths)
{
string Path = SearchPath.Contains(" ") ? "\\\"" + SearchPath + "\\\"" : SearchPath;
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 SearchPath in IntelliSenseIncludeSearchPaths)
{
string Path = SearchPath.Contains(" ") ? "\\\"" + SearchPath + "\\\"" : SearchPath;
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++14\";" + 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))
{
if (Config.ProjectTarget.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);
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";
bool bAutomaticSigning = false;
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 IOSPlatform = ((IOSPlatform)UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.IOS));
IOSProjectSettings ProjectSettings = IOSPlatform.ReadProjectSettings(ProjectFile);
IOSProvisioningData ProvisioningData = IOSPlatform.ReadProvisioningData(ProjectSettings);
IOSRunTimeVersion = ProjectSettings.RuntimeVersion;
IOSRunTimeDevices = ProjectSettings.RuntimeDevices;
ValidArchs += " arm64 armv7 armv7s";
SupportedPlatforms += " iphoneos";
bAutomaticSigning = ProjectSettings.bAutomaticSigning;
if (!bAutomaticSigning)
{
UUID_IOS = ProvisioningData.MobileProvisionUUID;
IOS_CERT = ProvisioningData.SigningCertificate;
}
TEAM_IOS = ProvisioningData.TeamUUID;
}
if (UnrealBuildTool.IsValidPlatform(UnrealTargetPlatform.TVOS))
{
TVOSPlatform TVOSPlatform = ((TVOSPlatform)UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.TVOS));
TVOSProjectSettings ProjectSettings = TVOSPlatform.ReadProjectSettings(ProjectFile);
TVOSProvisioningData ProvisioningData = TVOSPlatform.ReadProvisioningData(ProjectSettings);
TVOSRunTimeVersion = ProjectSettings.RuntimeVersion;
TVOSRunTimeDevices = ProjectSettings.RuntimeDevices;
if (ValidArchs == "x86_64")
{
ValidArchs += " arm64 armv7 armv7s";
}
SupportedPlatforms += " appletvos";
if (!bAutomaticSigning)
{
UUID_TVOS = ProvisioningData.MobileProvisionUUID;
TVOS_CERT = ProvisioningData.SigningCertificate;
}
TEAM_TVOS = ProvisioningData.TeamUUID;
}
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\"SDKROOT[sdk=iphoneos]\" = iphoneos;" + ProjectFileGenerator.NewLine);
if (!string.IsNullOrEmpty(TEAM_IOS))
{
Content.Append("\t\t\t\t\"DEVELOPMENT_TEAM[sdk=iphoneos*]\" = " + TEAM_IOS + ";" + ProjectFileGenerator.NewLine);
}
Content.Append("\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"" + IOS_CERT + "\";" + ProjectFileGenerator.NewLine);
if (!bAutomaticSigning && !string.IsNullOrEmpty(UUID_IOS))
{
Content.Append("\t\t\t\t\"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]\" = \"" + UUID_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\"SDKROOT[sdk=appletvos]\" = appletvos;" + ProjectFileGenerator.NewLine);
if (!string.IsNullOrEmpty(TEAM_TVOS))
{
Content.Append("\t\t\t\t\"DEVELOPMENT_TEAM[sdk=appletvos*]\" = " + TEAM_TVOS + ";" + ProjectFileGenerator.NewLine);
}
Content.Append("\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=appletvos*]\" = \"" + TVOS_CERT + "\";" + ProjectFileGenerator.NewLine);
if (!bAutomaticSigning && !string.IsNullOrEmpty(UUID_TVOS))
{
Content.Append("\t\t\t\t\"PROVISIONING_PROFILE_SPECIFIER[sdk=appletvos*]\" = \"" + UUID_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));
bool bSupportPortrait, bSupportLandscape, bSkipIcons;
UEDeployIOS.GenerateIOSPList(ProjectFile, Config.BuildConfig, ProjectPath.FullName, bIsUE4Game, GameName, Config.BuildTarget, EngineDir.FullName, ProjectPath + "/Binaries/IOS/Payload", out bSupportPortrait, out bSupportLandscape, out bSkipIcons);
}
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.Settings.MacOSVersion + ";" + ProjectFileGenerator.NewLine);
//#jira UE-50382 Xcode Address Sanitizer feature does not work on iOS
// address sanitizer dylib loader depends on the SDKROOT parameter. For macosx or default (missing, translated as macosx), the path is incorrect for iphone/appletv
if (XcodeProjectFileGenerator.bGeneratingRunIOSProject)
{
Content.Append("\t\t\t\tSDKROOT = iphoneos;" + ProjectFileGenerator.NewLine);
}
else if (XcodeProjectFileGenerator.bGeneratingRunTVOSProject)
{
Content.Append("\t\t\t\tSDKROOT = appletvos;" + ProjectFileGenerator.NewLine);
}
else
{
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))
{
if (Config.ProjectTarget.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.CreateRulesDelegate(Platform, Configuration).GetLegacyLinkType(Platform, Configuration) == TargetLinkType.Monolithic);
var ConfigName = Configuration.ToString();
if (ProjectTarget.TargetRules.Type != TargetType.Game && ProjectTarget.TargetRules.Type != TargetType.Program)
{
ConfigName += " " + ProjectTarget.TargetRules.Type.ToString();
}
if (BuildConfigs.Where(Config => Config.DisplayName == ConfigName).ToList().Count == 0)
{
string TargetName = ProjectTarget.TargetFilePath.GetFileNameWithoutAnyExtensions();
// Get the output directory
DirectoryReference RootDirectory = UnrealBuildTool.EngineDirectory;
if ((ProjectTarget.TargetRules.Type == TargetType.Game || ProjectTarget.TargetRules.Type == TargetType.Client || ProjectTarget.TargetRules.Type == TargetType.Server) && bShouldCompileMonolithic && !ProjectTarget.TargetRules.bOutputToEngineBinaries)
{
if(ProjectTarget.UnrealProjectFilePath != null)
{
RootDirectory = ProjectTarget.UnrealProjectFilePath.Directory;
}
}
if(ProjectTarget.TargetRules.Type == TargetType.Program && !ProjectTarget.TargetRules.bOutputToEngineBinaries && ProjectTarget.UnrealProjectFilePath != null)
{
RootDirectory = ProjectTarget.UnrealProjectFilePath.Directory;
}
// Get the output directory
DirectoryReference OutputDirectory = DirectoryReference.Combine(RootDirectory, "Binaries");
string ExeName = TargetName;
if (!bShouldCompileMonolithic && ProjectTarget.TargetRules.Type != TargetType.Program)
{
// Figure out what the compiled binary will be called so that we can point the IDE to the correct file
if (ProjectTarget.TargetRules.Type != TargetType.Game)
{
ExeName = "UE4" + ProjectTarget.TargetRules.Type.ToString();
}
}
if (BuildPlatform.Platform == UnrealTargetPlatform.Mac)
{
string MacExecutableName = UEBuildTarget.MakeBinaryFileName(ExeName, UnrealTargetPlatform.Mac, (ExeName == "UE4Editor" && Configuration == UnrealTargetConfiguration.DebugGame) ? UnrealTargetConfiguration.Development : Configuration, ProjectTarget.TargetRules.Architecture, ProjectTarget.TargetRules.UndecoratedConfiguration, UEBuildBinaryType.Executable, null);
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)
{
string IOSExecutableName = UEBuildTarget.MakeBinaryFileName(ExeName, UnrealTargetPlatform.IOS, (ExeName == "UE4Editor" && Configuration == UnrealTargetConfiguration.DebugGame) ? UnrealTargetConfiguration.Development : Configuration, ProjectTarget.TargetRules.Architecture, ProjectTarget.TargetRules.UndecoratedConfiguration, UEBuildBinaryType.Executable, null);
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 = \"&quot;" + GameProjectPath + "&quot;\"" + 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);
}
// Always add a configuration argument
Content.Append(" <CommandLineArgument" + ProjectFileGenerator.NewLine);
Content.Append(" argument = \"-RunConfig=$(Configuration)\"" + 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 (!DirectoryReference.Exists(SchemesDir))
{
DirectoryReference.CreateDirectory(SchemesDir);
}
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>1</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 (!DirectoryReference.Exists(ManagementFileDir))
{
DirectoryReference.CreateDirectory(ManagementFileDir);
}
string ManagementFilePath = ManagementFileDir + "/xcschememanagement.plist";
File.WriteAllText(ManagementFilePath, Content.ToString(), new UTF8Encoding());
}
/// 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;
foreach(ProjectTarget Target in ProjectTargets)
{
if(Target.UnrealProjectFilePath != null)
{
bIsAGame = true;
GameProjectPath = Target.UnrealProjectFilePath;
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 == 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)
{
AppendTargetDependencySection(ProjectFileContent, BuildTargetName, BuildTargetGuid, TargetDependencyGuid, TargetProxyGuid);
}
AppendGroupSection(ProjectFileContent, MainGroupGuid, ProductRefGroupGuid, TargetAppGuid, TargetName);
AppendLegacyTargetSection(ProjectFileContent, BuildTargetName, BuildTargetGuid, BuildTargetConfigListGuid, GameProjectPath, bHasEditorConfiguration);
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, GameProjectPath);
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;
}
}
}