Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/System/VCProjectFileGenerator.cs
Matthew Griffin 4136b4f3f8 Copying //UE4/Release-Staging-4.14 to //UE4/Dev-Main (Source: //UE4/Release-4.14 @ 3167010)
#lockdown Nick.Penwarden
#rb none

==========================
MAJOR FEATURES + CHANGES
==========================

Change 3167010 on 2016/10/19 by Dmitriy.Dyomin

	Fix for LevelStreaming getting stuck, and World->PersistentLevel null assert
	Contributed by Funcom: https://udn.unrealengine.com/questions/312900/fix-for-levelstreaming-getting-stuck-and-world-per.html
	#jira UE-36397

Change 3166824 on 2016/10/18 by Alexis.Matte

	Fix re-import of mesh material assignment regression
	#jira UE-37479

Change 3166821 on 2016/10/18 by Alexis.Matte

	Make sure the old asset are build correctly
	#jira UE-37461

Change 3166740 on 2016/10/18 by Lina.Halper

	Fix crash with hide name when bone buffer doesn't exist due to slave component
	#jira: UE-37467

Change 3166737 on 2016/10/18 by Jeff.Campeau

	Fix double release in PhysX if there's an exception during shutdown

	#jira UE-37058

Change 3166733 on 2016/10/18 by Chris.Babcock

	Add missing MultiviewOVR functions for Android deferred
	#jira UE-37401
	#ue4
	#android

Change 3166719 on 2016/10/18 by Richard.TalbotWatkin

	Fixed crash when setting a closed loop on a SplineComponent with no spline points defined.
	#jira UE-37449 - Editor Crashes When Enabling Closed Loop on Spline in Blueprint

Change 3166701 on 2016/10/18 by Daniel.Wright

	Call HandleLegacyMapBuildData before saving a cooked package - fixes cases where map packages get loaded in the cooker via FRedirectCollector::ResolveStringAssetReference in Core, where there is no opportunity to do post-load legacy map fixups.
	#jira UE-37317

Change 3166549 on 2016/10/18 by Alexis.Matte

	Make sure the vertex paint circle brush is display when painting
	#jira UE-37462

Change 3166459 on 2016/10/18 by Mitchell.Wilson

	Removed duplicate mapping of Gamepad_RightY for thrust in BP Flying template
	#jira UE-37471

Change 3166435 on 2016/10/18 by Mitchell.Wilson

	Cleared preview mesh on skydome materials used in ShooterGame to resolve UDK_ProceduralSky_4UVChannel warnings
	#jira UE-29718

Change 3166363 on 2016/10/18 by Mitchell.Wilson

	copied EditorPlane to UI folder of ShooterGame and named it MenuPlane. Replaced EditorPlane in ShooterEntry with MenuPlane.
	Rebuilt lighting for shootergame levels and added build data for each level.
	#jira UE-37435

Change 3166342 on 2016/10/18 by Rolando.Caloca

	UE4.14 - Fix for crash on splines with decals
	#jira UE-36864

Change 3166315 on 2016/10/18 by Ori.Cohen

	Implement copy and assignment operator for convexElem struct and aggregate geometry to avoid shallow copy of raw pointers.

	#JIRA UE-21572, UE-37429

Change 3166274 on 2016/10/18 by Peter.Sauerbrei

	deprecate iOS 7 and provide better messaging for the IOS versions we no longer directly support
	#jira UE-37034

Change 3166238 on 2016/10/18 by Max.Preussner

	MediaPlayerEditor: Failure opening media, even though it opened successfully (UE-37470)
	Copied from Dev-Sequencer CL# 3166218

	#jira UE-37470

Change 3166209 on 2016/10/18 by Daniel.Lamb

	Fixed issue with launch on marking packages as dirty.
	#test Cook shooter game
	#jira UE-37455

Change 3165901 on 2016/10/18 by Jamie.Dale

	Fixed Clang error caused by missing return type

	#jira UE-37421

Change 3165774 on 2016/10/18 by Steve.Robb

	Fix for FMallocBinned::GetAllocationSize() for aligned allocations.

	Copied from CL# 3165739.

	#jira UE-37249
	#jira UE-37243

Change 3165457 on 2016/10/17 by Max.Chen

	Sequencer: Default number frame handles to 0 so that there's no change in behavior when rendering out a master sequence of shots. Handle frames need to enabled explicitly by the user.

	#jira UE-37420

Change 3165444 on 2016/10/17 by Max.Chen

	Sequencer: Fix reset view range so that it's a no-op when the range is negative.

	#jira UE-37412

Change 3165257 on 2016/10/17 by Keli.Hlodversson

	Fix crash when exiting using SteamVR if using VR controllers and launched from steam.
	#jira UE-37432

Change 3165225 on 2016/10/17 by Nick.Darnell

	Strategy Game - No longer overrides the engine default iOS build machine to use.
	Shooter Game - Has been upgraded to user the newer location of the DPI scale curve.

	#jira UE-37001

Change 3165110 on 2016/10/17 by Michael.Trepka

	Fixed GetPlatformLibExtension for iOS and tvOS in PhysX build script

	#jira UE-36939

Change 3165107 on 2016/10/17 by Mitchell.Wilson

	Resolve CIS content warnings in Shooter Game.
	#jira UE-30791

Change 3165001 on 2016/10/17 by Alexis.Matte

	Bump the static mesh build version to force a rebuild.
	#jira UE-37262

Change 3164928 on 2016/10/17 by Ben.Marsh

	GitHub: Allow files in /Engine/Plugins/.../Binaries/... to be distributed on GitHub. This was a hold over from the days that editor binaries used to be checked in to P4, but it's excluding plugin ThirdParty folders too.

Change 3164914 on 2016/10/17 by Max.Chen

	Sequencer: Fix case where restoring the last view target was getting skipped. It should always restore if the camera object and the unlock if camera actor object is null.

	Copy from Dev-Sequencer

	#jira UE-35285

Change 3164896 on 2016/10/17 by Ben.Marsh

	UBT: Include all public headers and libraries when running UBT with -generateexternalfilelist, not just those referenced for external modules. This is a change in behavior, since it will cause public engine headers to be included in the target receipt, but it's reasonable behavior since they are required to build against the precompiled binaries anyway.

Change 3164892 on 2016/10/17 by Jamie.Dale

	Fixed BPs passing a null parent when copying data, as this prevented some fix-up from happening correctly in ImportText

	#jira UE-36977

Change 3164886 on 2016/10/17 by Jamie.Dale

	Fixed issues propagating property changes when editing Blueprints

	- FText property changes that kept the same identity didn't used to propagate due to the CDO and instance sharing the same display string. We now import the previous value into a temporary property and use UProperty::Identical to compare the values, rather than rely on the exported text.
	- TMap/TSet property changes weren't being propagated at all since UI support was added. They needed to be changed to use the parent node like TArray property changes do.
	- TSet property exporting would produce "()" for both an empty set, and a set containing a single empty FString/FName. This confused the property import, and caused the UProperty::Identical to fail. We now make sure that FString/FName properties correctly honor the PPF_Delimited when dealing with empty values.

	#jira UE-36977

Change 3164884 on 2016/10/17 by Jamie.Dale

	We now re-key text when it moves into a new package (with a valid package localization ID) to avoid identity conflicts when instancing in the editor

	#jira UE-36977

Change 3164843 on 2016/10/17 by Ben.Marsh

	UBT: Restore support for generating multiple project file types at once. Move the XML config setting for overwriting the type of project files to generate into a an option specific to Visual Studio, under <VCProjectFileGenerator>/<Version>.

	#jira UE-37386

Change 3164823 on 2016/10/17 by Daniel.Lamb

	Fixed warning about shader compiler stalling.
	#test Cook Shootergame
	#jira UE-37393

Change 3164805 on 2016/10/17 by Alexis.Matte

	Remove the skinxx import workflow for static mesh
	#jira UE-37262

Change 3164803 on 2016/10/17 by Mitchell.Wilson

	Rebuilt lighting on all template projects
	#jira UE-37317

Change 3164775 on 2016/10/17 by Matt.Kuhlenschmidt

	Fixed Editing InlineEditConditionToggle variable inside a blueprint  causing the editor to crash

	#jira UE-37029

Change 3164737 on 2016/10/17 by Matt.Kuhlenschmidt

	Fixed crash debugging blueprints in a networked game session
	- Eliminated pointless assert that in no way was necessary to crash the users game and moved the disabling of realtime viewports until after routing BeginPlay is complete.  This ensures any debugger windows that appear during BeginPlay have realtime disabled by default.

	#jira UE-37360

Change 3164711 on 2016/10/17 by Chris.Wood

	Added char limit to user description in Crash Report Client
	[UE-37377] - Limit description field size in Crash Report Client

	#jira UE-37377

Change 3164706 on 2016/10/17 by Alexis.Matte

	Fix fbx scene re-import of staticmesh loosing there materials
	#jira UE-37032

Change 3164688 on 2016/10/17 by Matt.Kuhlenschmidt

	Fixed incorrect selection borders appearing if an object was duplicated and then undone and redone

	#jira UE-37300

Change 3164686 on 2016/10/17 by Alexis.Matte

	Remove unwanted re-import setting option in both mesh editor.
	#jira UE-36640

Change 3164622 on 2016/10/17 by Dan.Oconnor

	Duplicating 3153975 and 3155758 in 4.14
	#jira UE-36938

Change 3164620 on 2016/10/17 by Robert.Manuszewski

	UE4 - Critical fix for task graph memory leak.

	(re-implementing CL #3159689 by Gil.Gribb)

	#jira UE-37382
	#fyi Gil.Gribb

Change 3164557 on 2016/10/17 by Mitchell.Wilson

	Rebuilt lighting in code and bp first person template.
	#jira UE-37317

Change 3164370 on 2016/10/17 by Chris.Wood

	Fix broken application path in Crash Report Client app restart code.
	[UE-36429] - Send and Restart from Crash Reporter does nothing

	#jira UE-36429

Change 3164329 on 2016/10/17 by Dmitriy.Dyomin

	Fixed: Shader compile error using Point Lights Nvidia Shield
	#jira UE-25671

Change 3164219 on 2016/10/16 by Max.Chen

	Fix CDO Constructor errors

	Copy from Dev-Sequencer

	#jira UE-36787

Change 3164173 on 2016/10/16 by Zachary.Wilson

	Submitting testing content for Reduced Lightmap Mixing and updating TM-Reflections

	#jira UE-29618

Change 3164171 on 2016/10/16 by Benjamin.Hyder

	Re-Saving TM-Noise to update camera position

	#jira UE-29618

Change 3164169 on 2016/10/16 by Benjamin.Hyder

	Updating TM-Noise map to include VectorVoronoi noise material

	#jira UE-29618

Change 3164022 on 2016/10/15 by zachary.wilson

	Adding testing content for material optimizations, attribute blend node, and preskinned loc pos node

	#jira UE-29618

Change 3163970 on 2016/10/15 by Benjamin.Hyder

	updating shading model for skeletal mesh example in TM-SSS_Fullres

	#jira UE-29618

Change 3163961 on 2016/10/15 by Benjamin.Hyder

	adding animated skeletal mesh example to TM-SSS_Fullres

	#jira UE-29618

Change 3163958 on 2016/10/15 by Benjamin.Hyder

	adding diffuse example to TM-SSS_Fullres

	#jira UE-29618

Change 3163728 on 2016/10/14 by Tyler.Cole

	Prep build scripts for WEX MCP in UE4 Release-4.14 stream.

	#jira NONE-0

Change 3163718 on 2016/10/14 by Tyler.Cole

	Prep build scripts for Ocean MCP in UE4 Release-4.14 stream.

	#jira NONE-0

Change 3163715 on 2016/10/14 by Tyler.Cole

	Prep build scripts for Fortnite MCP in UE4 Release-4.14 stream.

	#jira NONE-0

Change 3163711 on 2016/10/14 by Tyler.Cole

	Prep build scripts for Orion MCP in UE4 Release-4.14 stream.

	#jira NONE-0

Change 3163698 on 2016/10/14 by Michael.Trepka

	Fixed a CoreAudio crash on unpause

	#jira UE-37126

Change 3163534 on 2016/10/14 by Matt.Kuhlenschmidt

	Disable versioning info in project badge by default

	#jira UE-37335

Change 3163485 on 2016/10/14 by Michael.Trepka

	Add one more RPATH entry on Mac to support launching staged builds

	#jira UE-36799

Change 3163479 on 2016/10/14 by Michael.Trepka

	A couple of changes to prevent Mac app bundles from modifying their content for compatibility with the Mac App Store

	#jira UE-25742

Change 3163465 on 2016/10/14 by Daniel.Lamb

	Fix issue with cook command from editor was trying to package also.
	#test Cook command in editor
	#jira UE-36796

Change 3163455 on 2016/10/14 by Matt.Kuhlenschmidt

	Fixed selected section highlight and vertex color view modes not working.

	#jira UE-37308

Change 3163450 on 2016/10/14 by Mike.Beach

	Fixing up more Fortnite CIS warnings that were exposed by recent Dev-BP fixes - removing unnecessary cast operation in Mission_Outpost.

	#jira UE-37055

Change 3163400 on 2016/10/14 by Benjamin.Hyder

	Updating Lighting setttings inTM-SSS_Fullres

	#jira UE-29618

Change 3163392 on 2016/10/14 by Benjamin.Hyder

	Creating TM-SSS_Fullres test map and importing 4k skin diffuse and bump materials

	#jira UE-29618

Change 3163336 on 2016/10/14 by Mike.Beach

	Fixing up more Fortnite CIS warnings that we're exposed by a recent change from Dev-BP - replacing deprecated ClearTimerByHandle calls with ClearAndInvalidateTimerByHandle.

	#jira UE-37055

Change 3163335 on 2016/10/14 by Max.Chen

	Sequence Recorder: Disable auto possess player for recorded pawns. This fixes a bug where if you record a third person template character, when you open the sequence, the recorded character will possess the viewport.

	Copy from Dev-Sequencer

	#jira UE-35342

Change 3163230 on 2016/10/14 by Richard.TalbotWatkin

	Duplicated from //UE4/Release-4.13, CL 3111897

	When doing a full geometry rebuild, force the level model's poly linkage to be reinitialized, so that coplanar surfaces can be correctly linked. This fixes a regression following the separation of FPoly::iLink and FPoly::iLinkSurface.
	#jira UE-35482 - Selecting a brush surface that is flush with other brush surfaces selects all of them after Building Geometry
	#jira UE-35999 - Additive BSP Selections Acting Grouped after Building Geometry
	#jira UE-37340 - Selecting Geometry objects selects multiple brushes after Building

Change 3163155 on 2016/10/14 by Benn.Gallagher

	Fixed crash when changing scene settings an hitting undo in Persona with complex cloth active
	#jira UE-37332

Change 3163146 on 2016/10/14 by Marc.Audy

	Properly add/remove wind sources when activated/deactivated
	#jira UE-37289

Change 3163135 on 2016/10/14 by Phillip.Kavan

	[UE-35259] Fix AddComponent node-instanced Blueprint components finding the wrong archetype (template basis) in some scenarios.

	Mirrored from CL# 3160052 (//UE4/Dev-Blueprints).

	Additional changes (for release branch):
	- Bumped ReleaseObjectVersion to limit fixup code to only BP assets that existed prior to this change.

	#jira UE-35259

Change 3162999 on 2016/10/14 by Ben.Marsh

	QFE: Fix writing output files if they don't already exist, and bump version number to 4.14.

Change 3162988 on 2016/10/14 by Thomas.Sarkanen

	Fix socket editing on meshes

	Feature was inadvertently removed with the Persona refactor.

	#jira UE-37313 - Create Mesh Socket is missing

Change 3162938 on 2016/10/14 by Ben.Zeigler

	Merging CL 3162934 to //UE4/Release-4.14
	#jira UE-37044 Fix crash when loading map that has null actors in the actor list

Change 3162900 on 2016/10/14 by Dmitriy.Dyomin

	Fixed: Android should use single channel texture for ShadowMaps instead of 4 channel
	#jira UE-37312

Change 3162864 on 2016/10/14 by Yannick.Lange

	VR Editor: - Fix Landscape Undo/Redo functions step-by-step #jira UE-37050
	- Fix Landscape is sculpting twice if both Motioncontrollers are aimed at landscape #jira UE-37272
	#jira UE-37050 #jira UE-37272

Change 3162761 on 2016/10/14 by Jack.Porter

	Fixed landscape Undo crash after using Move-To-Level tool and then selecting a landscape proxy in the sublevel

	#jira UE-36863

Change 3162724 on 2016/10/14 by Max.Chen

	Sequencer: Fix time dilation in level sequence player

	Copy from Dev-Sequencer

	#jira UE-37277

Change 3162617 on 2016/10/13 by Jeff.Campeau

	Fix Windows XP compilation issues.
	- Block Win10 SDK includes
	- Remove unused Win10 SDK path collecting
	- Fix extraneous includes
	- Add 32b atomic option for certain stats

	#jira UE-36909

Change 3162503 on 2016/10/13 by Max.Preussner

	MediaPlayerEditor: Fixed Media player selection is ignored if media specifies player overrides (UE-37248)
	Merged from Dev-Sequencer CL# 3160995

	#jira UE-37248

Change 3162470 on 2016/10/13 by Mitchell.Wilson

	Rebuilt lighting and saved levels in StrategyGame.
	#jira UE-36913

Change 3162466 on 2016/10/13 by Michael.Trepka

	By default, do not compile Mac OpenGL and Metal SM4 shaders while cooking

	#jira UE-37088

Change 3162458 on 2016/10/13 by Keli.Hlodversson

	When quitting from the SteamVR menu overlay, in addition to shutting down the VR subsystem, also exit the game (and preview when running inside the editor)
	#jira UE-37292 Game does not exit when exited through SteamVR UI

Change 3162421 on 2016/10/13 by Mitchell.Wilson

	Rebuilt lighting and resaved levels in SunTemple, Zen Garden, and Mobile Starter content.
	#jira UE-36913

Change 3162420 on 2016/10/13 by Marc.Audy

	Clear BlueprintCreatedComponents in PostEditUndo since it is non transactional and expected to be empty
	#jira UE-37071

Change 3162406 on 2016/10/13 by Ben.Marsh

	Simplygon: Disable compiling Simplygon for installed builds if the required headers aren't there. Fixes creating installed builds for licensees.

	#jira UE-37269

Change 3162382 on 2016/10/13 by Ben.Marsh

	UAT: Fix accessing uninitialized UBT variable at startup, causing build warnings.

Change 3162314 on 2016/10/13 by Ben.Marsh

	Add PhysX build job to 4.14 branch.

Change 3162311 on 2016/10/13 by Matt.Kuhlenschmidt

	Ensure FBX scene import data object is not garbage collected during import

	#jira UE-35606

Change 3162270 on 2016/10/13 by Ben.Marsh

	UBT/Editor: Improved integration for Visual Studio "15".

	* Added editor source code accessors for specific Visual Studio versions (2013, 2015, "15"), which call through to the default Visual Studio accessor but allow specifying a more specific setting for which IDE to use.
	* UBT reads this setting, and will generate project files for the preferred Visual Studio version if set.
	* Added a BuildConfiguration.xml setting to set which type of project files to generate - under the <ProjectFileGenerator> element, add a <Type> property taking values of Make/CMake/QMake/KDevelop/CodeLite/VisualStudio/VisualStudio2012/VisualStudio2013/VisualStudio2015/VisualStudio2017/XCode.
	* Added an separate editor setting for the Windows target platform controlling which compiler to use, separately from the IDE. This setting can also be set via <WindowsPlatform> <Compiler> element in BuildConfiguration.xml.
	* Removed compiler argument from generated project files (this should now persist via INI files or XML config)
	* Removed compiler argument being appended to UBT when doing hot reload (should pick this up from the build environment instead)
	* Added support for enums in UBT XML configs
	* Fixed a few version checks against exact compiler versions - MS plan is give VS '15' updates version numbers 1911, 1912, etc...

	#jira UE-37176
	#jira UE-36872

Change 3162236 on 2016/10/13 by Mike.Beach

	Fixing a GLEO that could occur after compiling a component Blueprint (preventing you from saving other Blueprints that use that component) - using the authratative class in AddComponent node reconstruction (for the output pin) so that it doesn't end up referencing the REINST class.

	#jira UE-37224

Change 3162225 on 2016/10/13 by Alex.Delesky

	#jira UE-36995 - Precise click should now work correctly with buttons that are children of a scroll list.

	Also addresses #jira UE-37250 and PR #2859 (#git author aarmbruster andrew.armbruster@gmail.com)

Change 3162107 on 2016/10/13 by Matt.Kuhlenschmidt

	Prevent perforce branch stuff from appearing in edtior project badge. This feature was meant for those compiling on perforce builds.

	#jira UE-37278

Change 3162060 on 2016/10/13 by Matt.Kuhlenschmidt

	Fix mac build

	#jira  UE-36885

Change 3162025 on 2016/10/13 by Daniel.Wright

	Compile fix
	#jira UE-37246

Change 3162009 on 2016/10/13 by Daniel.Wright

	[Copy] Fixed movable lights getting assigned a shadowmap channel
	#jira UE-37246

Change 3161963 on 2016/10/13 by Jon.Nabozny

	Enable PrimaryActorTick.bCanEverTick in necessary Samples.

	The seperation of GameMode caused different behavior, since GameModeBase has tick disabled by default (which is set in AInfo).

	#jira UE-36888

Change 3161896 on 2016/10/13 by Matt.Kuhlenschmidt

	Added guard and more logging for crash when reimporting textures

	#jira UE-37263

Change 3161865 on 2016/10/13 by mason.seay

	Making the name more user friendly for test asset

	#jira UE-29618

Change 3161855 on 2016/10/13 by Matt.Kuhlenschmidt

	Fixed keybindings not working with editor settings search and regressions where you could not import,export,or reset keybindings to default
	- Made the keybindings setting a proper developer settings object

	#jira  UE-36885

Change 3161854 on 2016/10/13 by Daniel.Wright

	[Copy] Fixed level getting added to the dirty list twice when legacy lightmaps are present
	#jira UE-37204

Change 3161743 on 2016/10/13 by Lauren.Ridge

	Setting RenderTarget in OculusRiftRender.cpp to fix ensure when entering VR editing mode on Oculus Rift

	#jira UE-37245

Change 3161694 on 2016/10/13 by Michael.Dupuis

	#jira UE-37001 Perform manual migration of UICurve to proper config category

Change 3161689 on 2016/10/13 by Thomas.Sarkanen

	Fixed failing detachment automation test

	The issue was not the attachment itself, but rather the test setup conditions being different to what was expected, give that setting an actor's rotation with a quaternion doesnt always return the same value as the one that is set.

	#jira UE-37160 - Detachment automation tests failing

Change 3161685 on 2016/10/13 by mason.seay

	Test content for retargeting animation

	#jira UE-29618

Change 3161423 on 2016/10/13 by Jamie.Dale

	Split localized package redirection out of FCoreDelegates::PackageNameResolvers

	They're different enough in behavior that the delegate resolution was breaking the localized package resolution by resolving in too many places and causing the localized package to be loaded with its real localized name as well as the fake non-localized name.

	#jira UE-37119

Change 3161394 on 2016/10/13 by Mitchell.Wilson

	Replaced deprecated blueprint node with GrabComponentAtLocation to resolve warnings.
	#jira UE-37256

Change 3161363 on 2016/10/13 by Jamie.Dale

	Fixing mangled English translations

	#jira UE-36128

Change 3161319 on 2016/10/13 by Benn.Gallagher

	Fixed crash when forcing ref pose during anim blueprint initialization when using sub anim instances
	#jira UE-37254

Change 3161310 on 2016/10/13 by Martin.Wilson

	Fix crash retargetting AnimBP with "Allow remapping to existing assets" enabled

	#jira UE-35149

Change 3161303 on 2016/10/13 by Jurre.deBaare

	Crash when using merge actor on static meshes that have been affected by simplygon
	#fix Set whether or not a LOD is eligible for exporting by determining if it contains valid LOD data
	#jira UE-36880

Change 3161166 on 2016/10/13 by Jack.Porter

	Prevent Launch On prompting to save a freshly-opened, non-modified map while still prompting the user to save never-saved maps

	#jira UE-37131

Change 3161161 on 2016/10/13 by Thomas.Sarkanen

	Fixed override materials hanging around when setting skeletal meshes

	#jira UE-37102 - On switching an anim blueprints preview mesh the skeletal mesh is not switched but the materials are

Change 3161160 on 2016/10/13 by Thomas.Sarkanen

	Fix crash changing preview skeletal mesh with bone selected

	Make sure to keep BonesOfInterest and the preview scene selected bone in sync.
	Also make sure to only use one so we wont suffer this again if we inteodiuce any inconsistencies in the future.

	#jira UE-37081 - If a bone is selected when switching preview skeletons the editor will crash

Change 3160882 on 2016/10/12 by Mike.Beach

	Mirroring CL 3158790 from Dev-BP

	Fixing an issue with ctrl pin dragging, where marco nodes' connections would disappear - the SGraph drag operation now references pins by handles (so it can account for reconstructed nodes during the operation).

	#jira UE-37033

Change 3160863 on 2016/10/12 by Lauren.Ridge

	Changing VR Editor delete function to go through the standard delete pathway so FEdModeMeshPaint has a chance to handle it

	#jira UE-35685

Change 3160855 on 2016/10/12 by Jeff.Campeau

	Fix WinXP compile issues caused by WebSocket, SteamVR, and Oculus changes.

	#jira UE-36909

Change 3160844 on 2016/10/12 by Marcus.Wassmer

	Duplicate PR #2855:  Ansel plugin fixes (Contributed by adamnv)
	#jira UE-37162

Change 3160749 on 2016/10/12 by Daniel.Wright

	[Copy] Legacy lightmaps are renamed with the world that uses them.  Fixes 'graph linked to external object' when renaming a map in the content browser.
	#jira UE-37231

Change 3160748 on 2016/10/12 by Daniel.Wright

	[Copy] Lightmap textures are now outered to UMapBuildDataRegistry so that the UMapBuildDataRegistry can be moved in the content browser
	#jira UE-37231

Change 3160747 on 2016/10/12 by Daniel.Wright

	[Copy] Legacy MapBuildDataRegistry objects are no longer public so they don't get shown in the content browser, prevents users trying to move them.
	#jira UE-37231

Change 3160727 on 2016/10/12 by Mitchell.Wilson

	Updating minimum iOS version to iOS 8 for all samples and templates
	#jira UE-37022

Change 3160655 on 2016/10/12 by Chad.Taylor

	Merging VR loading screen fixes from Dev-VR

	#jira UE-36741

Change 3160643 on 2016/10/12 by Keli.Hlodversson

	Ensure that the DebugConsoleObject's width is reset to the width of the left eye view before rendering the console when doing stereoscopic rendering.

	#jira UE-36440

Change 3160641 on 2016/10/12 by Mike.Beach

	Fixing up Fortnite CIS warnings that we're exposed by a recent change from Dev-BP - replacing deprecated ClearTimerByHandle calls with ClearAndInvalidateTimerByHandle.

	#jira UE-37055

Change 3160572 on 2016/10/12 by Matt.Kuhlenschmidt

	Missed change from CL 3159889

	#jira UE-35503

Change 3160518 on 2016/10/12 by Ryan.Gerleve

	Fix assert when adding a new sublevel.

	#jira UE-37148

Change 3160439 on 2016/10/12 by Ben.Marsh

	Fix support for Visual Studio "15" preview 5.

	#jira UE-37227

Change 3160363 on 2016/10/12 by Daniel.Lamb

	Fix for skip editor content flag being passed throught o UAT.
	#jira UE-37223

Change 3160277 on 2016/10/12 by Mieszko.Zielinski

	Manually recreated CL#3159909 #UE4

	Original comment:
	---
	Added sanity-checkes to access to UNavigationSystem::NavDataSet elements #UE4

	Lack of those test has been reported licencees as source of some crashes

	#jira UE-37209

Change 3160120 on 2016/10/12 by Chris.Babcock

	Fix x86 and x86_64 libpng libraries for Android
	#jira UE-37192
	#ue4
	#android

Change 3160080 on 2016/10/12 by Matthew.Griffin

	PR #2840: UE-36945: Set exe icon properly in packaged Windows games (Contributed by projectgheist)
	#jira UE-36945

Change 3160063 on 2016/10/12 by Gareth.Martin

	Fixed crash trying to edit landscape with r.LightPropagationVolume=1 enabled
	#jira UE-36933

Change 3160045 on 2016/10/12 by Ryan.Gerleve

	Fix some issues with manipulating sublevels in the editor.

	#jira UE-36901, UE-36932

Change 3160044 on 2016/10/12 by Gareth.Martin

	Fix condition on BuildTree in UHierarchicalInstancedStaticMeshComponent::Serialize
	- This should fix the crash that caused it to be commented out
	#jira UE-37152

Change 3160032 on 2016/10/12 by Matt.Kuhlenschmidt

	Fixed arrays inside structs, inside arrays not refreshing when an element is added or removed refresh

	#jira UE-36985

Change 3159965 on 2016/10/12 by Ben.Zeigler

	#jira UE-37170 Fix crash when spawning PlayerController with a null CheatClass, this now just skips spawning the cheat manager

Change 3159957 on 2016/10/12 by Robert.Manuszewski

	Making FindShaderResourceById and FindShaderById return a raw pointer instead of TRefCountPtr (basically undoing CL #2538774) to prevent creating temporary TRefCountPtrs. It's no longer necessary to use TRefCountPtrs as shader serialization has changed (CL #2989898) and shaders are no longer registered on the async loading thread.

	#jira UE-35570, UE-35511, UE-35570, UE-35924

Change 3159921 on 2016/10/12 by Matthew.Griffin

	Duplicating CL#3153485 from Dev-Build
		Removed GUBP from Automation Tool Mono solution

Change 3159919 on 2016/10/12 by Matthew.Griffin

	Duplicating CL#3150017 from Dev-Build
		Fixes for PS4 deployment suggested in UDN post: https://udn.unrealengine.com/questions/314055/issues-with-ps4platformautomationcs.html

Change 3159904 on 2016/10/12 by Matt.Kuhlenschmidt

	Fix regression where toggling Play/Pause in PIE would not give the mouse back to the game

	#jira UE-37112

Change 3159903 on 2016/10/12 by Ben.Zeigler

	#jira UE-37163 Activate auto activate components immediately when registering in an editor world, the initialize call will never actually happen

Change 3159890 on 2016/10/12 by Matt.Kuhlenschmidt

	Prevent crashes when a keybinding to start and stop PIE is toggled repeatedly.

	#jira UE-36814

Change 3159889 on 2016/10/12 by Matt.Kuhlenschmidt

	Fixed part of the details panel UI showing up when there is nothing in the  details panel.  This was causing crashes when clicking on those parts of the UI

	#jira UE-35503

Change 3159888 on 2016/10/12 by Ben.Zeigler

	#jira UE-36849 DataTable::LoadStructData allocating wrong size

	Fix cases that were using the PropertiesSize to malloc a UStruct to instead use GetStructureSize(). There is a difference because of alignment, so on some platforms it was corrupting memory

Change 3159887 on 2016/10/12 by Matt.Kuhlenschmidt

	Guard against crash in Fcanvas drawing

	#jira UE-36496

Change 3159886 on 2016/10/12 by Ben.Zeigler

	#jira UE-36884 Stop savepackage from making dependencies on PendingKill objects, because those will not actually be saved
	#jira UE-36876 Fix it so savepackage doesn't try to strip ClientOnly objects when cooking for a client+server config, we only want to strip if both flags are set. Re-enable warning I disabled
	Fix crashes when running EDL cooked builds. This is not a new bug, but fortnite content changes exposed it
	Fix it so pending kill component templates do not end up in import table, they will fail to import
	Fix it so when marking an inheritable component template as unnecessary it also marks it pending kill.
	This fixes it so if GetArchetype will not return an orphaned, non-saving component as the archetype for a grandchild blueprint

Change 3159885 on 2016/10/12 by Matthew.Griffin

	Duplicating CL#3149950 from Dev-Build to include .tps files in the installed build
	Including source for additional programs to Installed Build
	#jira UE-36668
	#jira UE-37072

Change 3159853 on 2016/10/12 by Matthew.Griffin

	Duplicating CL#3148611 from Dev-Build
		Added list of Dependant modules to EULA check
		#jira UE-29432

Change 3159385 on 2016/10/11 by Nick.Shin

	make emscripten for physx use gMask like windows and xbox does

	emsdk doesn't like:

	union {
	U32 u;
	F32 f;
	} bla;

	it seems, floats are 64 bits on browsers...

	stream: release-4.14
	#jira  UE-36916  //UE4/Main: Step 'Compile UE4Game HTML5' - 50 Warnings

Change 3159384 on 2016/10/11 by Nick.Shin

	manually submitting HTML5 PhysX libs

	recompiled to fix the NaN warnings

	stream: Release-4.14
	#jira  UE-36916  //UE4/Main: Step 'Compile UE4Game HTML5' - 50 Warnings

Change 3159210 on 2016/10/11 by Ben.Marsh

	Set the default for the BRANCH_NAME macro to the escaped 4.14 branch.

[CL 3175266 by Matthew Griffin in Main branch]
2016-10-26 14:33:35 -04:00

1048 lines
44 KiB
C#

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Xml.Linq;
namespace UnrealBuildTool
{
/// <summary>
/// Represents a folder within the master project (e.g. Visual Studio solution)
/// </summary>
public class VisualStudioSolutionFolder : MasterProjectFolder
{
/// <summary>
/// Constructor
/// </summary>
public VisualStudioSolutionFolder(ProjectFileGenerator InitOwnerProjectFileGenerator, string InitFolderName)
: base(InitOwnerProjectFileGenerator, InitFolderName)
{
// Generate a unique GUID for this folder
// NOTE: When saving generated project files, we ignore differences in GUIDs if every other part of the file
// matches identically with the pre-existing file
FolderGUID = Guid.NewGuid();
}
/// GUID for this folder
public Guid FolderGUID
{
get;
private set;
}
}
public enum VCProjectFileFormat
{
Default, // Default to the best installed version, but allow SDKs to override
VisualStudio2012, // Unsupported
VisualStudio2013,
VisualStudio2015,
VisualStudio2017, // "15"
}
/// <summary>
/// Visual C++ project file generator implementation
/// </summary>
public class VCProjectFileGenerator : ProjectFileGenerator
{
/// <summary>
/// Do not access this variable directly; it is used to read the default for config files only, and may be overridden by the actual project setting.
/// </summary>
[XmlConfig]
public static VCProjectFileFormat Version = VCProjectFileFormat.Default;
/// Default constructor
public VCProjectFileGenerator(FileReference InOnlyGameProject, VCProjectFileFormat InFormat)
: base(InOnlyGameProject)
{
ProjectFileFormat = InFormat;
}
/// File extension for project files we'll be generating (e.g. ".vcxproj")
override public string ProjectFileExtension
{
get
{
return ".vcxproj";
}
}
/// <summary>
/// </summary>
public override void CleanProjectFiles(DirectoryReference InMasterProjectDirectory, string InMasterProjectName, DirectoryReference InIntermediateProjectFilesDirectory)
{
FileReference MasterProjectFile = FileReference.Combine(InMasterProjectDirectory, InMasterProjectName);
FileReference MasterProjDeleteFilename = MasterProjectFile + ".sln";
if (MasterProjDeleteFilename.Exists())
{
MasterProjDeleteFilename.Delete();
}
MasterProjDeleteFilename = MasterProjectFile + ".sdf";
if (MasterProjDeleteFilename.Exists())
{
MasterProjDeleteFilename.Delete();
}
MasterProjDeleteFilename = MasterProjectFile + ".suo";
if (MasterProjDeleteFilename.Exists())
{
MasterProjDeleteFilename.Delete();
}
MasterProjDeleteFilename = MasterProjectFile + ".v11.suo";
if (MasterProjDeleteFilename.Exists())
{
MasterProjDeleteFilename.Delete();
}
MasterProjDeleteFilename = MasterProjectFile + ".v12.suo";
if (MasterProjDeleteFilename.Exists())
{
MasterProjDeleteFilename.Delete();
}
// Delete the project files folder
if (InIntermediateProjectFilesDirectory.Exists())
{
try
{
Directory.Delete(InIntermediateProjectFilesDirectory.FullName, true);
}
catch (Exception Ex)
{
Log.TraceInformation("Error while trying to clean project files path {0}. Ignored.", InIntermediateProjectFilesDirectory);
Log.TraceInformation("\t" + Ex.Message);
}
}
}
/// <summary>
/// Allocates a generator-specific project file object
/// </summary>
/// <param name="InitFilePath">Path to the project file</param>
/// <returns>The newly allocated project file object</returns>
protected override ProjectFile AllocateProjectFile(FileReference InitFilePath)
{
return new VCProjectFile(InitFilePath, OnlyGameProject, ProjectFileFormat);
}
/// ProjectFileGenerator interface
public override MasterProjectFolder AllocateMasterProjectFolder(ProjectFileGenerator InitOwnerProjectFileGenerator, string InitFolderName)
{
return new VisualStudioSolutionFolder(InitOwnerProjectFileGenerator, InitFolderName);
}
/// "4.0", "12.0", or "14.0", etc...
static public string GetProjectFileToolVersionString(VCProjectFileFormat ProjectFileFormat)
{
switch (ProjectFileFormat)
{
case VCProjectFileFormat.VisualStudio2012:
return "4.0";
case VCProjectFileFormat.VisualStudio2013:
return "12.0";
case VCProjectFileFormat.VisualStudio2015:
return "14.0";
case VCProjectFileFormat.VisualStudio2017:
return "15.0";
}
return string.Empty;
}
/// for instance: <PlatformToolset>v110</PlatformToolset>
static public string GetProjectFilePlatformToolsetVersionString(VCProjectFileFormat ProjectFileFormat)
{
switch (ProjectFileFormat)
{
case VCProjectFileFormat.VisualStudio2012:
return "v110";
case VCProjectFileFormat.VisualStudio2013:
return "v120";
case VCProjectFileFormat.VisualStudio2015:
return "v140";
case VCProjectFileFormat.VisualStudio2017:
return "v141";
}
return string.Empty;
}
/// Which version of Visual Studio we should generate project files for
VCProjectFileFormat ProjectFileFormat;
/// This is the platform name that Visual Studio is always guaranteed to support. We'll use this as
/// a platform for any project configurations where our actual platform is not supported by the
/// installed version of Visual Studio (e.g, "iOS")
public const string DefaultPlatformName = "Win32";
/// The platform name that must be used for .NET projects
public const string DotNetPlatformName = "AnyCPU";
/// <summary>
/// Configures project generator based on command-line options
/// </summary>
/// <param name="Arguments">Arguments passed into the program</param>
/// <param name="IncludeAllPlatforms">True if all platforms should be included</param>
protected override void ConfigureProjectFileGeneration(String[] Arguments, ref bool IncludeAllPlatforms)
{
// Call parent implementation first
base.ConfigureProjectFileGeneration(Arguments, ref IncludeAllPlatforms);
}
/// <summary>
/// Adds Extra files that are specific to Visual Studio projects
/// </summary>
/// <param name="EngineProject">Project to add files to</param>
protected override void AddEngineExtrasFiles(ProjectFile EngineProject)
{
base.AddEngineExtrasFiles(EngineProject);
// Add our UE4.natvis file
var NatvisFilePath = FileReference.Combine(UnrealBuildTool.EngineDirectory, "Extras", "VisualStudioDebugging", "UE4.natvis");
if (NatvisFilePath.Exists())
{
EngineProject.AddFileToProject(NatvisFilePath, UnrealBuildTool.EngineDirectory);
}
}
/// <summary>
/// Selects which platforms and build configurations we want in the project file
/// </summary>
/// <param name="IncludeAllPlatforms">True if we should include ALL platforms that are supported on this machine. Otherwise, only desktop platforms will be included.</param>
/// <param name="SupportedPlatformNames">Output string for supported platforms, returned as comma-separated values.</param>
protected override void SetupSupportedPlatformsAndConfigurations(bool IncludeAllPlatforms, out string SupportedPlatformNames)
{
// Call parent implementation to figure out the actual platforms
base.SetupSupportedPlatformsAndConfigurations(IncludeAllPlatforms, out SupportedPlatformNames);
// If we're generating project files for a specific game project, check the user's editor setting for preferred source code accessor - we can generate project files to match.
if (ProjectFileFormat == VCProjectFileFormat.Default && OnlyGameProject != null)
{
ConfigCacheIni Ini = ConfigCacheIni.CreateConfigCacheIni(UnrealTargetPlatform.Win64, "EditorPerProjectUserSettings", DirectoryReference.FromFile(OnlyGameProject));
string PreferredAccessor;
if (Ini.GetString("/Script/SourceCodeAccess.SourceCodeAccessSettings", "PreferredAccessor", out PreferredAccessor))
{
VCProjectFileFormat PreferredProjectFileFormat;
if (Enum.TryParse(PreferredAccessor, out PreferredProjectFileFormat))
{
// Get the corresponding compiler version
WindowsCompiler Compiler = WindowsCompiler.Default;
if(PreferredProjectFileFormat == VCProjectFileFormat.VisualStudio2013)
{
Compiler = WindowsCompiler.VisualStudio2013;
}
else if(PreferredProjectFileFormat == VCProjectFileFormat.VisualStudio2015)
{
Compiler = WindowsCompiler.VisualStudio2015;
}
else if(PreferredProjectFileFormat == VCProjectFileFormat.VisualStudio2017)
{
Compiler = WindowsCompiler.VisualStudio2017;
}
// Check the compiler is installed
if (Compiler != WindowsCompiler.Default)
{
DirectoryReference VCInstallDir;
if (WindowsPlatform.TryGetVCInstallDir(Compiler, out VCInstallDir))
{
ProjectFileFormat = PreferredProjectFileFormat;
}
else
{
Log.TraceWarning("Preferred Visual C++ installation ({0}) not found - ignoring.", PreferredProjectFileFormat);
}
}
}
}
}
// Certain platforms override the project file format because their debugger add-ins may not yet support the latest
// version of Visual Studio. This is their chance to override that.
// ...but only if the user didn't override this via the command-line.
if (ProjectFileFormat == VCProjectFileFormat.Default)
{
// Pick the best platform installed by default
DirectoryReference VCInstallDir;
if (WindowsPlatform.TryGetVCInstallDir(WindowsCompiler.VisualStudio2015, out VCInstallDir))
{
ProjectFileFormat = VCProjectFileFormat.VisualStudio2015;
}
else if (WindowsPlatform.TryGetVCInstallDir(WindowsCompiler.VisualStudio2013, out VCInstallDir))
{
ProjectFileFormat = VCProjectFileFormat.VisualStudio2013;
}
else if (WindowsPlatform.TryGetVCInstallDir(WindowsCompiler.VisualStudio2017, out VCInstallDir))
{
ProjectFileFormat = VCProjectFileFormat.VisualStudio2017;
}
// Allow the SDKs to override
foreach (UnrealTargetPlatform SupportedPlatform in SupportedPlatforms)
{
UEBuildPlatform BuildPlatform = UEBuildPlatform.GetBuildPlatform(SupportedPlatform, true);
if (BuildPlatform != null)
{
// Don't worry about platforms that we're missing SDKs for
if (BuildPlatform.HasRequiredSDKsInstalled() == SDKStatus.Valid)
{
VCProjectFileFormat ProposedFormat = ProjectFileFormat;
// Reduce the Visual Studio version to the max supported by each platform we plan to include.
if (ProjectFileFormat == VCProjectFileFormat.Default || ProposedFormat < ProjectFileFormat)
{
ProjectFileFormat = ProposedFormat;
}
}
}
}
}
}
/// <summary>
/// Used to sort VC solution config names along with the config and platform values
/// </summary>
class VCSolutionConfigCombination
{
/// Visual Studio solution configuration name for this config+platform
public string VCSolutionConfigAndPlatformName;
/// Configuration name
public UnrealTargetConfiguration Configuration;
/// Platform name
public UnrealTargetPlatform Platform;
/// The target configuration name
public string TargetConfigurationName;
public override string ToString()
{
return String.Format("{0}={1} {2} {3}", VCSolutionConfigAndPlatformName, Configuration, Platform, TargetConfigurationName);
}
}
/// <summary>
/// Composes a string to use for the Visual Studio solution configuration, given a build configuration and target rules configuration name
/// </summary>
/// <param name="Configuration">The build configuration</param>
/// <param name="TargetConfigurationName">The target rules configuration name</param>
/// <returns>The generated solution configuration name</returns>
string MakeSolutionConfigurationName(UnrealTargetConfiguration Configuration, string TargetConfigurationName)
{
string SolutionConfigName = Configuration.ToString();
// Don't bother postfixing "Game" or "Program" -- that will be the default when using "Debug", "Development", etc.
// Also don't postfix "RocketGame" when we're building Rocket game projects. That's the only type of game there is in that case!
if (!TargetConfigurationName.Equals(TargetRules.TargetType.Game.ToString(), StringComparison.InvariantCultureIgnoreCase) &&
!TargetConfigurationName.Equals(TargetRules.TargetType.Program.ToString(), StringComparison.InvariantCultureIgnoreCase))
{
SolutionConfigName += " " + TargetConfigurationName;
}
return SolutionConfigName;
}
/// <summary>
/// Writes the project files to disk
/// </summary>
/// <returns>True if successful</returns>
protected override bool WriteProjectFiles()
{
if(!base.WriteProjectFiles())
{
return false;
}
// Write AutomationReferences file
if (AutomationProjectFiles.Any())
{
XNamespace NS = XNamespace.Get("http://schemas.microsoft.com/developer/msbuild/2003");
DirectoryReference AutomationToolDir = DirectoryReference.Combine(UnrealBuildTool.EngineSourceDirectory, "Programs", "AutomationTool");
new XDocument(
new XElement(NS + "Project",
new XAttribute("ToolsVersion", VCProjectFileGenerator.GetProjectFileToolVersionString(ProjectFileFormat)),
new XAttribute("DefaultTargets", "Build"),
new XElement(NS + "ItemGroup",
from AutomationProject in AutomationProjectFiles
select new XElement(NS + "ProjectReference",
new XAttribute("Include", AutomationProject.ProjectFilePath.MakeRelativeTo(AutomationToolDir)),
new XElement(NS + "Project", (AutomationProject as VCSharpProjectFile).ProjectGUID.ToString("B")),
new XElement(NS + "Name", AutomationProject.ProjectFilePath.GetFileNameWithoutExtension()),
new XElement(NS + "Private", "false")
)
)
)
).Save(FileReference.Combine(AutomationToolDir, "AutomationTool.csproj.References").FullName);
}
return true;
}
protected override bool WriteMasterProjectFile(ProjectFile UBTProject)
{
bool bSuccess = true;
string SolutionFileName = MasterProjectName + ".sln";
// Setup solution file content
StringBuilder VCSolutionFileContent = new StringBuilder();
const string VersionTag = "# UnrealEngineGeneratedSolutionVersion=1.0";
// Solution file header
if (ProjectFileFormat == VCProjectFileFormat.VisualStudio2017)
{
VCSolutionFileContent.Append(
ProjectFileGenerator.NewLine +
"Microsoft Visual Studio Solution File, Format Version 12.00" + ProjectFileGenerator.NewLine +
"# Visual Studio 15" + ProjectFileGenerator.NewLine +
"VisualStudioVersion = 15.0.25807.0" + ProjectFileGenerator.NewLine +
"MinimumVisualStudioVersion = 10.0.40219.1" + ProjectFileGenerator.NewLine);
}
else if (ProjectFileFormat == VCProjectFileFormat.VisualStudio2015)
{
VCSolutionFileContent.Append(
ProjectFileGenerator.NewLine +
"Microsoft Visual Studio Solution File, Format Version 12.00" + ProjectFileGenerator.NewLine +
"# Visual Studio 14" + ProjectFileGenerator.NewLine +
"VisualStudioVersion = 14.0.22310.1" + ProjectFileGenerator.NewLine +
"MinimumVisualStudioVersion = 10.0.40219.1" + ProjectFileGenerator.NewLine);
}
else if (ProjectFileFormat == VCProjectFileFormat.VisualStudio2013)
{
VCSolutionFileContent.Append(
ProjectFileGenerator.NewLine +
"Microsoft Visual Studio Solution File, Format Version 12.00" + ProjectFileGenerator.NewLine +
"# Visual Studio 2013" + ProjectFileGenerator.NewLine +
VersionTag + ProjectFileGenerator.NewLine);
}
else if (ProjectFileFormat == VCProjectFileFormat.VisualStudio2012)
{
VCSolutionFileContent.Append(
ProjectFileGenerator.NewLine +
"Microsoft Visual Studio Solution File, Format Version 12.00" + ProjectFileGenerator.NewLine +
"# Visual Studio 2012" + ProjectFileGenerator.NewLine +
VersionTag + ProjectFileGenerator.NewLine);
}
else
{
throw new BuildException("Unexpected ProjectFileFormat");
}
// Find the projects for ShaderCompileWorker and UnrealLightmass
ProjectFile ShaderCompileWorkerProject = null;
ProjectFile UnrealLightmassProject = null;
foreach (ProjectFile Project in AllProjectFiles)
{
if (Project.ProjectTargets.Count == 1)
{
FileReference TargetFilePath = Project.ProjectTargets[0].TargetFilePath;
if (TargetFilePath != null)
{
string TargetFileName = TargetFilePath.GetFileNameWithoutAnyExtensions();
if (TargetFileName.Equals("ShaderCompileWorker", StringComparison.InvariantCultureIgnoreCase))
{
ShaderCompileWorkerProject = Project;
}
else if (TargetFileName.Equals("UnrealLightmass", StringComparison.InvariantCultureIgnoreCase))
{
UnrealLightmassProject = Project;
}
}
if (ShaderCompileWorkerProject != null
&& UnrealLightmassProject != null)
{
break;
}
}
}
// Solution folders, files and project entries
{
// This the GUID that Visual Studio uses to identify a solution folder
string SolutionFolderEntryGUID = "{2150E333-8FDC-42A3-9474-1A3956D46DE8}";
// Solution folders
{
List<MasterProjectFolder> AllSolutionFolders = new List<MasterProjectFolder>();
System.Action<List<MasterProjectFolder> /* Folders */ > GatherFoldersFunction = null;
GatherFoldersFunction = FolderList =>
{
AllSolutionFolders.AddRange(FolderList);
foreach (MasterProjectFolder CurSubFolder in FolderList)
{
GatherFoldersFunction(CurSubFolder.SubFolders);
}
};
GatherFoldersFunction(RootFolder.SubFolders);
foreach (VisualStudioSolutionFolder CurFolder in AllSolutionFolders)
{
string FolderGUIDString = CurFolder.FolderGUID.ToString("B").ToUpperInvariant();
VCSolutionFileContent.Append(
"Project(\"" + SolutionFolderEntryGUID + "\") = \"" + CurFolder.FolderName + "\", \"" + CurFolder.FolderName + "\", \"" + FolderGUIDString + "\"" + ProjectFileGenerator.NewLine);
// Add any files that are inlined right inside the solution folder
if (CurFolder.Files.Count > 0)
{
VCSolutionFileContent.Append(
" ProjectSection(SolutionItems) = preProject" + ProjectFileGenerator.NewLine);
foreach (string CurFile in CurFolder.Files)
{
// Syntax is: <relative file path> = <relative file path>
VCSolutionFileContent.Append(
" " + CurFile + " = " + CurFile + ProjectFileGenerator.NewLine);
}
VCSolutionFileContent.Append(
" EndProjectSection" + ProjectFileGenerator.NewLine);
}
VCSolutionFileContent.Append(
"EndProject" + ProjectFileGenerator.NewLine
);
}
}
// Project files
foreach (MSBuildProjectFile CurProject in AllProjectFiles)
{
// Visual Studio uses different GUID types depending on the project type
string ProjectTypeGUID = CurProject.ProjectTypeGUID;
// NOTE: The project name in the solution doesn't actually *have* to match the project file name on disk. However,
// we prefer it when it does match so we use the actual file name here.
string ProjectNameInSolution = CurProject.ProjectFilePath.GetFileNameWithoutExtension();
// Use the existing project's GUID that's already known to us
string ProjectGUID = CurProject.ProjectGUID.ToString("B").ToUpperInvariant();
VCSolutionFileContent.Append(
"Project(\"" + ProjectTypeGUID + "\") = \"" + ProjectNameInSolution + "\", \"" + CurProject.ProjectFilePath.MakeRelativeTo(ProjectFileGenerator.MasterProjectPath) + "\", \"" + ProjectGUID + "\"" + ProjectFileGenerator.NewLine);
// Setup dependency on UnrealBuildTool, if we need that. This makes sure that UnrealBuildTool is
// freshly compiled before kicking off any build operations on this target project
if (!CurProject.IsStubProject)
{
List<ProjectFile> Dependencies = new List<ProjectFile>();
if (CurProject.IsGeneratedProject && UBTProject != null && CurProject != UBTProject)
{
Dependencies.Add(UBTProject);
Dependencies.AddRange(UBTProject.DependsOnProjects);
}
if (UEBuildConfiguration.bEditorDependsOnShaderCompileWorker && CurProject.IsGeneratedProject && ShaderCompileWorkerProject != null && CurProject.ProjectTargets.Any(x => x.TargetRules != null && x.TargetRules.Type == TargetRules.TargetType.Editor))
{
Dependencies.Add(ShaderCompileWorkerProject);
}
Dependencies.AddRange(CurProject.DependsOnProjects);
if (Dependencies.Count > 0)
{
VCSolutionFileContent.Append("\tProjectSection(ProjectDependencies) = postProject" + ProjectFileGenerator.NewLine);
// Setup any addition dependencies this project has...
foreach (ProjectFile DependsOnProject in Dependencies)
{
string DependsOnProjectGUID = ((MSBuildProjectFile)DependsOnProject).ProjectGUID.ToString("B").ToUpperInvariant();
VCSolutionFileContent.Append("\t\t" + DependsOnProjectGUID + " = " + DependsOnProjectGUID + ProjectFileGenerator.NewLine);
}
VCSolutionFileContent.Append("\tEndProjectSection" + ProjectFileGenerator.NewLine);
}
}
VCSolutionFileContent.Append(
"EndProject" + ProjectFileGenerator.NewLine
);
}
}
// Solution configuration platforms. This is just a list of all of the platforms and configurations that
// appear in Visual Studio's build configuration selector.
List<VCSolutionConfigCombination> SolutionConfigCombinations = new List<VCSolutionConfigCombination>();
// The "Global" section has source control, solution configurations, project configurations,
// preferences, and project hierarchy data
{
VCSolutionFileContent.Append(
"Global" + ProjectFileGenerator.NewLine);
{
{
VCSolutionFileContent.Append(
" GlobalSection(SolutionConfigurationPlatforms) = preSolution" + ProjectFileGenerator.NewLine);
Dictionary<string, Tuple<UnrealTargetConfiguration, string>> SolutionConfigurationsValidForProjects = new Dictionary<string, Tuple<UnrealTargetConfiguration, string>>();
HashSet<UnrealTargetPlatform> PlatformsValidForProjects = new HashSet<UnrealTargetPlatform>();
foreach (UnrealTargetConfiguration CurConfiguration in SupportedConfigurations)
{
if (UnrealBuildTool.IsValidConfiguration(CurConfiguration))
{
foreach (UnrealTargetPlatform CurPlatform in SupportedPlatforms)
{
if (UnrealBuildTool.IsValidPlatform(CurPlatform))
{
foreach (ProjectFile CurProject in AllProjectFiles)
{
if (!CurProject.IsStubProject)
{
if (CurProject.ProjectTargets.Count == 0)
{
throw new BuildException("Expecting project '" + CurProject.ProjectFilePath + "' to have at least one ProjectTarget associated with it!");
}
// Figure out the set of valid target configuration names
foreach (ProjectTarget ProjectTarget in CurProject.ProjectTargets)
{
if (VCProjectFile.IsValidProjectPlatformAndConfiguration(ProjectTarget, CurPlatform, CurConfiguration))
{
PlatformsValidForProjects.Add(CurPlatform);
// Default to a target configuration name of "Game", since that will collapse down to an empty string
string TargetConfigurationName = TargetRules.TargetType.Game.ToString();
if (ProjectTarget.TargetRules != null)
{
TargetConfigurationName = ProjectTarget.TargetRules.ConfigurationName;
}
string SolutionConfigName = MakeSolutionConfigurationName(CurConfiguration, TargetConfigurationName);
SolutionConfigurationsValidForProjects[SolutionConfigName] = new Tuple<UnrealTargetConfiguration, string>(CurConfiguration, TargetConfigurationName);
}
}
}
}
}
}
}
}
foreach (UnrealTargetPlatform CurPlatform in PlatformsValidForProjects)
{
foreach (KeyValuePair<string, Tuple<UnrealTargetConfiguration, string>> SolutionConfigKeyValue in SolutionConfigurationsValidForProjects)
{
// e.g. "Development|Win64 = Development|Win64"
string SolutionConfigName = SolutionConfigKeyValue.Key;
UnrealTargetConfiguration Configuration = SolutionConfigKeyValue.Value.Item1;
string TargetConfigurationName = SolutionConfigKeyValue.Value.Item2;
string SolutionPlatformName = CurPlatform.ToString();
string SolutionConfigAndPlatformPair = SolutionConfigName + "|" + SolutionPlatformName;
SolutionConfigCombinations.Add(
new VCSolutionConfigCombination
{
VCSolutionConfigAndPlatformName = SolutionConfigAndPlatformPair,
Configuration = Configuration,
Platform = CurPlatform,
TargetConfigurationName = TargetConfigurationName
}
);
}
}
// Sort the list of solution platform strings alphabetically (Visual Studio prefers it)
SolutionConfigCombinations.Sort(
new Comparison<VCSolutionConfigCombination>(
(x, y) => { return String.Compare(x.VCSolutionConfigAndPlatformName, y.VCSolutionConfigAndPlatformName, StringComparison.InvariantCultureIgnoreCase); }
)
);
HashSet<string> AppendedSolutionConfigAndPlatformNames = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
foreach (VCSolutionConfigCombination SolutionConfigCombination in SolutionConfigCombinations)
{
// We alias "Game" and "Program" to both have the same solution configuration, so we're careful not to add the same combination twice.
if (!AppendedSolutionConfigAndPlatformNames.Contains(SolutionConfigCombination.VCSolutionConfigAndPlatformName))
{
VCSolutionFileContent.Append(
" " + SolutionConfigCombination.VCSolutionConfigAndPlatformName + " = " + SolutionConfigCombination.VCSolutionConfigAndPlatformName + ProjectFileGenerator.NewLine);
AppendedSolutionConfigAndPlatformNames.Add(SolutionConfigCombination.VCSolutionConfigAndPlatformName);
}
}
VCSolutionFileContent.Append(
" EndGlobalSection" + ProjectFileGenerator.NewLine);
}
// Assign each project's "project configuration" to our "solution platform + configuration" pairs. This
// also sets up which projects are actually built when building the solution.
{
VCSolutionFileContent.Append(
" GlobalSection(ProjectConfigurationPlatforms) = postSolution" + ProjectFileGenerator.NewLine);
List<VCSolutionConfigCombination> CombinationsThatWereMatchedToProjects = new List<VCSolutionConfigCombination>();
foreach (MSBuildProjectFile CurProject in AllProjectFiles)
{
// NOTE: We don't emit solution configuration entries for "stub" projects. Those projects are only
// built using UnrealBuildTool and don't require a presence in the solution project list
// NOTE: We also process projects that were "imported" here, hoping to match those to our solution
// configurations. In some cases this may not be successful though. Imported projects
// should always be carefully setup to match our project generator's solution configs.
if (!CurProject.IsStubProject)
{
if (CurProject.ProjectTargets.Count == 0)
{
throw new BuildException("Expecting project '" + CurProject.ProjectFilePath + "' to have at least one ProjectTarget associated with it!");
}
bool IsProgramProject = CurProject.ProjectTargets[0].TargetRules != null && CurProject.ProjectTargets[0].TargetRules.Type == TargetRules.TargetType.Program;
HashSet<string> GameOrProgramConfigsAlreadyMapped = new HashSet<string>();
foreach (VCSolutionConfigCombination SolutionConfigCombination in SolutionConfigCombinations)
{
// Handle aliasing of Program and Game target configuration names
if ((IsProgramProject && GameOrProgramConfigsAlreadyMapped.Add(SolutionConfigCombination.VCSolutionConfigAndPlatformName)) ||
IsProgramProject && SolutionConfigCombination.TargetConfigurationName != TargetRules.TargetType.Game.ToString() ||
!IsProgramProject && SolutionConfigCombination.TargetConfigurationName != TargetRules.TargetType.Program.ToString())
{
string TargetConfigurationName = SolutionConfigCombination.TargetConfigurationName;
if (IsProgramProject)
{
TargetConfigurationName = TargetRules.TargetType.Program.ToString();
}
// Now, we want to find a target in this project that maps to the current solution config combination. Only up to one target should
// and every solution config combination should map to at least one target in one project (otherwise we shouldn't have added it!).
ProjectTarget MatchingProjectTarget = null;
foreach (ProjectTarget ProjectTarget in CurProject.ProjectTargets)
{
bool IsMatchingCombination = VCProjectFile.IsValidProjectPlatformAndConfiguration(ProjectTarget, SolutionConfigCombination.Platform, SolutionConfigCombination.Configuration);
if (ProjectTarget.TargetRules != null)
{
if (TargetConfigurationName != ProjectTarget.TargetRules.ConfigurationName)
{
// Solution configuration name for this combination doesn't match this target's configuration name. It's not buildable.
IsMatchingCombination = false;
}
}
else
{
// UBT gets a pass because it is a dependency of every single configuration combination
if (CurProject != UBTProject &&
!CurProject.ShouldBuildForAllSolutionTargets &&
TargetConfigurationName != TargetRules.TargetType.Game.ToString())
{
// Can't build non-generated project in configurations except for the default (Game)
IsMatchingCombination = false;
}
}
if (IsMatchingCombination)
{
if (MatchingProjectTarget != null)
{
// Not expecting more than one target to match a single solution configuration per project!
throw new BuildException("Not expecting more than one target for project " + CurProject.ProjectFilePath + " to match solution configuration " + SolutionConfigCombination.VCSolutionConfigAndPlatformName);
}
MatchingProjectTarget = ProjectTarget;
// NOTE: For faster perf, we could "break" here and bail out early, but that would circumvent the error checking
// for multiple targets within a project that may map to a single solution configuration.
}
}
UnrealTargetConfiguration SolutionConfiguration = SolutionConfigCombination.Configuration;
UnrealTargetPlatform SolutionPlatform = SolutionConfigCombination.Platform;
if (MatchingProjectTarget == null)
{
// The current configuration/platform and target configuration name doesn't map to anything our project actually supports.
// We'll map it to a default config.
SolutionConfiguration = UnrealTargetConfiguration.Development;
// Prefer using Win64 as the default, but fall back to a platform the project file actually supports if needed. This is for
// projects that can never be compiled in Windows, such as UnrealLaunchDaemon which is an iOS-only program
SolutionPlatform = UnrealTargetPlatform.Win64;
if (CurProject.ProjectTargets[0].TargetRules != null)
{
List<UnrealTargetPlatform> ProjectSupportedPlatforms = new List<UnrealTargetPlatform>();
CurProject.ProjectTargets[0].TargetRules.GetSupportedPlatforms(ref ProjectSupportedPlatforms);
if (!ProjectSupportedPlatforms.Contains(SolutionPlatform))
{
SolutionPlatform = ProjectSupportedPlatforms[0];
}
}
if (IsProgramProject)
{
TargetConfigurationName = TargetRules.TargetType.Program.ToString();
}
else
{
TargetConfigurationName = TargetRules.TargetType.Game.ToString();
}
}
// If the project wants to always build in "Development", regardless of what the solution
// configuration is set to, then we'll do that here. This is used for projects like
// UnrealBuildTool and ShaderCompileWorker
if (MatchingProjectTarget != null)
{
if (MatchingProjectTarget.ForceDevelopmentConfiguration)
{
SolutionConfiguration = UnrealTargetConfiguration.Development;
}
}
// Always allow SCW and UnrealLighmass to build in editor configurations
if (MatchingProjectTarget == null && SolutionConfigCombination.TargetConfigurationName == TargetRules.TargetType.Editor.ToString() && SolutionConfigCombination.Platform == UnrealTargetPlatform.Win64)
{
if (CurProject == ShaderCompileWorkerProject)
{
MatchingProjectTarget = ShaderCompileWorkerProject.ProjectTargets[0];
}
else if (CurProject == UnrealLightmassProject)
{
MatchingProjectTarget = UnrealLightmassProject.ProjectTargets[0];
}
}
string ProjectConfigName;
string ProjectPlatformName;
if (CurProject.IsStubProject)
{
if (SolutionPlatform != UnrealTargetPlatform.Unknown || SolutionConfiguration != UnrealTargetConfiguration.Unknown)
{
throw new BuildException("Stub project was expecting platform and configuration type to be set to Unknown");
}
ProjectPlatformName = MSBuildProjectFile.StubProjectPlatformName;
ProjectConfigName = MSBuildProjectFile.StubProjectConfigurationName;
}
else
{
CurProject.MakeProjectPlatformAndConfigurationNames(SolutionPlatform, SolutionConfiguration, TargetConfigurationName, out ProjectPlatformName, out ProjectConfigName);
}
string ProjectConfigAndPlatformPair = ProjectConfigName.ToString() + "|" + ProjectPlatformName.ToString();
// e.g. "{4232C52C-680F-4850-8855-DC39419B5E9B}.Debug|iOS.ActiveCfg = iOS_Debug|Win32"
string CurProjectGUID = CurProject.ProjectGUID.ToString("B").ToUpperInvariant();
VCSolutionFileContent.Append(
" " + CurProjectGUID + "." + SolutionConfigCombination.VCSolutionConfigAndPlatformName + ".ActiveCfg = " + ProjectConfigAndPlatformPair + ProjectFileGenerator.NewLine);
// Set whether this project configuration should be built when the user initiates "build solution"
if (MatchingProjectTarget != null && CurProject.ShouldBuildByDefaultForSolutionTargets)
{
// Some targets are "dummy targets"; they only exist to show user friendly errors in VS. Weed them out here, and don't set them to build by default.
List<UnrealTargetPlatform> SupportedPlatforms = null;
if (MatchingProjectTarget.TargetRules != null)
{
SupportedPlatforms = new List<UnrealTargetPlatform>();
MatchingProjectTarget.TargetRules.GetSupportedPlatforms(ref SupportedPlatforms);
}
if (SupportedPlatforms == null || SupportedPlatforms.Contains(SolutionConfigCombination.Platform))
{
VCSolutionFileContent.Append(
" " + CurProjectGUID + "." + SolutionConfigCombination.VCSolutionConfigAndPlatformName + ".Build.0 = " + ProjectConfigAndPlatformPair + ProjectFileGenerator.NewLine);
UEPlatformProjectGenerator ProjGen = UEPlatformProjectGenerator.GetPlatformProjectGenerator(SolutionConfigCombination.Platform, true);
if (MatchingProjectTarget.ProjectDeploys ||
((ProjGen != null) && (ProjGen.GetVisualStudioDeploymentEnabled(SolutionPlatform, SolutionConfiguration) == true)))
{
VCSolutionFileContent.Append(
" " + CurProjectGUID + "." + SolutionConfigCombination.VCSolutionConfigAndPlatformName + ".Deploy.0 = " + ProjectConfigAndPlatformPair + ProjectFileGenerator.NewLine);
}
}
}
CombinationsThatWereMatchedToProjects.Add(SolutionConfigCombination);
}
}
}
}
// Check for problems
foreach (VCSolutionConfigCombination SolutionConfigCombination in SolutionConfigCombinations)
{
if (!CombinationsThatWereMatchedToProjects.Contains(SolutionConfigCombination))
{
throw new BuildException("Unable to find a ProjectTarget that matches the solution configuration/platform mapping: " + SolutionConfigCombination.Configuration.ToString() + ", " + SolutionConfigCombination.Platform.ToString() + ", " + SolutionConfigCombination.TargetConfigurationName);
}
}
VCSolutionFileContent.Append(
" EndGlobalSection" + ProjectFileGenerator.NewLine);
}
// Setup other solution properties
{
VCSolutionFileContent.Append(
" GlobalSection(SolutionProperties) = preSolution" + ProjectFileGenerator.NewLine);
// HideSolutionNode sets whether or not the top-level solution entry is completely hidden in the UI.
// We don't want that, as we need users to be able to right click on the solution tree item.
VCSolutionFileContent.Append(
" HideSolutionNode = FALSE" + ProjectFileGenerator.NewLine);
VCSolutionFileContent.Append(
" EndGlobalSection" + ProjectFileGenerator.NewLine);
}
// Solution directory hierarchy
{
VCSolutionFileContent.Append(
" GlobalSection(NestedProjects) = preSolution" + ProjectFileGenerator.NewLine);
// Every entry in this section is in the format "Guid1 = Guid2". Guid1 is the child project (or solution
// filter)'s GUID, and Guid2 is the solution filter directory to parent the child project (or solution
// filter) to. This sets up the hierarchical solution explorer tree for all solution folders and projects.
System.Action<StringBuilder /* VCSolutionFileContent */, List<MasterProjectFolder> /* Folders */ > FolderProcessorFunction = null;
FolderProcessorFunction = (LocalVCSolutionFileContent, LocalMasterProjectFolders) =>
{
foreach (VisualStudioSolutionFolder CurFolder in LocalMasterProjectFolders)
{
string CurFolderGUIDString = CurFolder.FolderGUID.ToString("B").ToUpperInvariant();
foreach (MSBuildProjectFile ChildProject in CurFolder.ChildProjects)
{
// e.g. "{BF6FB09F-A2A6-468F-BE6F-DEBE07EAD3EA} = {C43B6BB5-3EF0-4784-B896-4099753BCDA9}"
LocalVCSolutionFileContent.Append(
" " + ChildProject.ProjectGUID.ToString("B").ToUpperInvariant() + " = " + CurFolderGUIDString + ProjectFileGenerator.NewLine);
}
foreach (VisualStudioSolutionFolder SubFolder in CurFolder.SubFolders)
{
// e.g. "{BF6FB09F-A2A6-468F-BE6F-DEBE07EAD3EA} = {C43B6BB5-3EF0-4784-B896-4099753BCDA9}"
LocalVCSolutionFileContent.Append(
" " + SubFolder.FolderGUID.ToString("B").ToUpperInvariant() + " = " + CurFolderGUIDString + ProjectFileGenerator.NewLine);
}
// Recurse into subfolders
FolderProcessorFunction(LocalVCSolutionFileContent, CurFolder.SubFolders);
}
};
FolderProcessorFunction(VCSolutionFileContent, RootFolder.SubFolders);
VCSolutionFileContent.Append(
" EndGlobalSection" + ProjectFileGenerator.NewLine);
}
}
VCSolutionFileContent.Append(
"EndGlobal" + ProjectFileGenerator.NewLine);
}
// Save the solution file
if (bSuccess)
{
string SolutionFilePath = FileReference.Combine(MasterProjectPath, SolutionFileName).FullName;
bSuccess = WriteFileIfChanged(SolutionFilePath, VCSolutionFileContent.ToString());
}
// Save a solution config file which selects the development editor configuration by default.
if (bSuccess)
{
// Figure out the filename for the SUO file. VS will automatically import the options from earlier versions if necessary.
FileReference SolutionOptionsFileName;
switch (ProjectFileFormat)
{
case VCProjectFileFormat.VisualStudio2012:
SolutionOptionsFileName = FileReference.Combine(MasterProjectPath, Path.ChangeExtension(SolutionFileName, "v11.suo"));
break;
case VCProjectFileFormat.VisualStudio2013:
SolutionOptionsFileName = FileReference.Combine(MasterProjectPath, Path.ChangeExtension(SolutionFileName, "v12.suo"));
break;
case VCProjectFileFormat.VisualStudio2015:
SolutionOptionsFileName = FileReference.Combine(MasterProjectPath, ".vs", Path.GetFileNameWithoutExtension(SolutionFileName), "v14", ".suo");
break;
case VCProjectFileFormat.VisualStudio2017:
SolutionOptionsFileName = FileReference.Combine(MasterProjectPath, ".vs", Path.GetFileNameWithoutExtension(SolutionFileName), "v15", ".suo");
break;
default:
throw new BuildException("Unsupported Visual Studio version");
}
// Check it doesn't exist before overwriting it. Since these files store the user's preferences, it'd be bad form to overwrite them.
if (!SolutionOptionsFileName.Exists())
{
SolutionOptionsFileName.Directory.CreateDirectory();
VCSolutionOptions Options = new VCSolutionOptions();
// Set the default configuration and startup project
VCSolutionConfigCombination DefaultConfig = SolutionConfigCombinations.Find(x => x.Configuration == UnrealTargetConfiguration.Development && x.Platform == UnrealTargetPlatform.Win64 && x.TargetConfigurationName == "Editor");
if (DefaultConfig != null)
{
List<VCBinarySetting> Settings = new List<VCBinarySetting>();
Settings.Add(new VCBinarySetting("ActiveCfg", DefaultConfig.VCSolutionConfigAndPlatformName));
if (DefaultProject != null)
{
Settings.Add(new VCBinarySetting("StartupProject", ((MSBuildProjectFile)DefaultProject).ProjectGUID.ToString("B")));
}
Options.SetConfiguration(Settings);
}
// Mark all the projects as closed by default, apart from the startup project
VCSolutionExplorerState ExplorerState = new VCSolutionExplorerState();
foreach (ProjectFile ProjectFile in AllProjectFiles)
{
string ProjectName = ProjectFile.ProjectFilePath.GetFileNameWithoutExtension();
if (ProjectFile == DefaultProject)
{
ExplorerState.OpenProjects.Add(new Tuple<string, string[]>(ProjectName, new string[] { ProjectName }));
}
else
{
ExplorerState.OpenProjects.Add(new Tuple<string, string[]>(ProjectName, new string[] { }));
}
}
if (IncludeEnginePrograms)
{
ExplorerState.OpenProjects.Add(new Tuple<string, string[]>("Automation", new string[0]));
}
Options.SetExplorerState(ExplorerState);
// Write the file
if (Options.Sections.Count > 0)
{
Options.Write(SolutionOptionsFileName.FullName);
}
}
}
return bSuccess;
}
/// <summary>
/// Takes a string and "cleans it up" to make it parsable by the Visual Studio source control provider's file format
/// </summary>
/// <param name="Str">String to clean up</param>
/// <returns>The cleaned up string</returns>
public string CleanupStringForSCC(string Str)
{
string Cleaned = Str;
// SCC is expecting paths to contain only double-backslashes for path separators. It's a bit weird but we need to do it.
Cleaned = Cleaned.Replace(Path.DirectorySeparatorChar.ToString(), Path.DirectorySeparatorChar.ToString() + Path.DirectorySeparatorChar.ToString());
Cleaned = Cleaned.Replace(Path.AltDirectorySeparatorChar.ToString(), Path.DirectorySeparatorChar.ToString() + Path.DirectorySeparatorChar.ToString());
// SCC is expecting not to see spaces in these strings, so we'll replace spaces with "\u0020"
Cleaned = Cleaned.Replace(" ", "\\u0020");
return Cleaned;
}
}
}