You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb None
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3182087 on 2016/11/01 by Lina.Halper
PR #2328: fix morph target weight application order. (Contributed by tmiv)
- changed order of morphtarget application to be animation and THEN SetMorphTarget
- made sure you could clear the weight also if SetMorphTarget to be 0.f
#jira: UE-29999
Change 3182090 on 2016/11/01 by Lina.Halper
Fix issue where import doesn't display any message when import type hasn't been detected
Change 3182123 on 2016/11/01 by Wes.Hunt
ensure the EngineAnalytics singleton is not being held onto by someone else during engine shutdown.
Change 3182177 on 2016/11/01 by Lina.Halper
Fix not being able to modify Joint Target Location in detail panel
#jira: UE-30900
Change 3182181 on 2016/11/01 by Ben.Zeigler
Add UGameplayTagsManager::AddNativeGameplayTag to allow registering tags directly from native code. This stops them from being deleteable in the editor, and will register them even if they don't exist elsewhere
Change internal games to use this to register their native tags. The explicit call to be done adding native tags is not required, it happens on engine post init
Some header cleanup
Change 3182876 on 2016/11/02 by Danny.Bouimad
Moving files
Change 3182912 on 2016/11/02 by Thomas.Sarkanen
Added access to the viewport client from IPersonaViewport
Allows systems to hook into the state of the client.
#jira UE-36549 - Need to access the current viewmode in FPersonaMeshDetails
Change 3182927 on 2016/11/02 by Thomas.Sarkanen
Initially select current asset in the asset family shortcut bar dropdown
#jira UE-35532 - Animation dropdown submenu doesn't highlight currently selected object, where as the asset browser does
Change 3182970 on 2016/11/02 by Lukasz.Furman
CIS fix for gameplay debugger
copy of CL# 3165005
Change 3183123 on 2016/11/02 by Mieszko.Zielinski
Fixed changing AreaClass of NavLinkProxy point links not having any effect on navmesh generation #UE4
Change 3183310 on 2016/11/02 by Jurre.deBaare
Blendspace changes:
- Moved MarkerSync code from BlendSpaceBase.cpp to BlendSpaceUtilities.h/cpp
- Re-ordered blendspace.h/cpp
- const correctness where possible
- Removed unused code paths
- Wrapped non-runtime code paths in WITH_EDITOR
Blendspace editor refactor:
- Moved element generators into respective AnimationBlendSpaceHelpers.h/cpp
- New Grid Widget class
- Simplified Blendspace(1D) editors, most things are handled within SAnimationBlendSpaceBase
- SBlendSpaceGridWidget handles visualization and UI interaction (modifying blendspace is done through parent SAnimationBlendSpaceBase)
Change 3183344 on 2016/11/02 by James.Golding
UEFW-181 : Move PhysX vehicle support to a plugin
- Added FPhysicsDelegates for several useful global physics delegates (OnUpdatePhysXMaterial, OnPhysicsAssetChanged, OnPhysSceneInit, OnPhysSceneTerm)
- Added OnPhysScenePreTick and OnPhysSceneStep delegates to FPhysScene
- TireType is now deprecated, just kept in Engine for backwards compat. TireConfig in PhysXVehicles plugin is new structure
- Added 'ConvertTireTypes' editor console util which creates TireConfig's from TireTypes's (using asset registry) and PhysicalMaterials, and updates any VehicleWheel BPs
Change 3183351 on 2016/11/02 by Ben.Zeigler
Add utility functions to convert from export text versions of tag and container, which is useful when reading tags out of the asset registry
Change 3183354 on 2016/11/02 by Ben.Zeigler
Change fortnite to use new GameplayTag functions to parse tags in the asset registry to avoid bad stall while checking mission requirements. This only works once the mission infos have been resaved
Change 3183383 on 2016/11/02 by Thomas.Sarkanen
Persona camera fixes
Dont reset the camera all the time when setting skeletal meshes (we only do this the first time now).
Add shortcuts to focus the camera using 'F' key from the skeleton tree (or anywhere else that wants to). Also add a menu option to the viewport to make this more discoverable.
Shortcut is now handles by the viewport widget instead of the client (as this is how other viewports handle it).
#jira UE-36458 - Stop camera from resetting when doing undo or redo in persona animation editor
Change 3183409 on 2016/11/02 by Jon.Nabozny
#rn Allow MAX_ARRAY_SIZE and MAX_ARRAY_MEMORY from RepLayout to be user configurable.
#jira UE-35660
Change 3183625 on 2016/11/02 by James.Golding
Hopeful fix for Mac CIS issue in PhysXVehiclesEditor
Change 3183652 on 2016/11/02 by Ben.Zeigler
Fix issue where commonly replicated tags didn't work if load from ini was turned off.
Fix it so gameplay tag tree is always fully sorted alphabetically, instead of only the root tags being sorted.
Change 3183856 on 2016/11/02 by Richard.Hinckley
#jira UEDOC-4006
Editing GameMode and GameState documentation (in Framework branch).
Change 3183902 on 2016/11/02 by Mieszko.Zielinski
Fixed EQS debug drawing not showing item labels #UE4
Proper implementation of CL#3183899
#jira UE-38122
Change 3183996 on 2016/11/02 by Jon.Nabozny
Fix DefaultMaxRepArrayMemory value to be UINT16_MAX (65535). Was previously set to 64 * 1024 = 65536.
Change 3184129 on 2016/11/02 by Ben.Zeigler
#jira UE-38022 Move GameplayAbilities to a plugin.
Remove GameplayAbilitiesEditorEnabled ini setting, instead enable the "GameplayAbilities" plugin in your uproject if you want abilities, it's disabled by default
#jira UE-6947 Remove GameplayAbilityBlueprintGeneratedClass as it's not needed and was only being used half the time
#jira UE-19427 Fix incorrect usage of WorldContextObject in ability tasks to instead be OwningAbility, as it would crash if used on anything other than a gameplay ability object
Change 3184130 on 2016/11/02 by Ben.Zeigler
Internal game fixups for moving gameplayabilities to a plugin
Change 3184469 on 2016/11/02 by Ben.Zeigler
Change abilities plugin to be more obviously unsupported
Change 3184565 on 2016/11/02 by dan.reynolds
AEOverview update with HRTF test map
Change 3184800 on 2016/11/03 by Thomas.Sarkanen
Added "Show Selected and Parents" to bone display options
Also fixed mis-named menu section.
#jira UE-35375 - Add 'selected bone and parents' option to Persona viewport
Change 3184810 on 2016/11/03 by James.Golding
Remove WoflPlat PhysX 3.3 and Apex 1.3 files
Change 3184817 on 2016/11/03 by Thomas.Sarkanen
Added facial animation support
Added curve table to sound wave (internal or external). Added UI support for manipulating these.
Improved curve table editor.
- Editor can now display curves as well as tables.
- Sparse keys are now properly supported (where keys are not presnet at some times in some curves).
Added curve source interface.
Added external curve node. This allows any component or actor (BP or native) that implements ICurveSourceInterface to drive curves.
Added new audio component that can also provide curves. This handles the preroll delay (approx 0.4 seconds, depending on audio) so the mouth can open before audio is played.
Added bulk importer plugin.
This imports audio & FBX files and builds cuirve data into SoundWave assets.
- Adapted exisitng FBX curve import slightly to use FRichCurves rather than FFloatCurves.
- Added new support for importing curves to a curve table.
Added preview of audio to Persona.
- Added display, filtering and playback of sound waves from the anim sequence browser.
- Audio playback with curves routed to animation now works with anim blueprints and pose assets (as we need a pose asset to preview poses!)
- Persona now uses an Actor rather than disparate components.
- Added overrides for AddComponent and RemoveComponent to make sure actor is hooked up correctly.
- Preview scene can now be manipulated by plugins etc. using a delegate when it is created.
- Single anim instance has been slightly re-worked to do its update and evaluate logic inside of a local anim node. This allows derived classes to build functionality up component-wise by adding new nodes to the 'graph'.
#jira UEFW-7 - Routing Sound Curves to AnimBP
#jira UEFW-5 - Support importing curves
#jira UE-37950 - Spawn preview actor in animation editor
Change 3184837 on 2016/11/03 by James.Golding
PR #2896: Fix FVehicleAnimInstanceProxy::PreUpdate not calling FFAnimInstanceProxy's PreUpdate (Contributed by DenizPiri)
#jira UE-37978
Change 3184847 on 2016/11/03 by Thomas.Sarkanen
Fixed editor shutdown crash
Dont try to save config when UObjects are all gone.
Change 3184853 on 2016/11/03 by James.Golding
Stop Engine module linking against PhysX vehicle lib, link that into PhysXVehicles plugin instead.
Change 3184884 on 2016/11/03 by Thomas.Sarkanen
Anim Blueprint thread safety is now checked in the compiler
Added new metadata keys for classes and functions to describe their thread safety.
Added extra warnings in the anim BP compiler based around these new keys to help people catch suspect thread usage.
Expanded the compiler erorr reporting to allow for extra rich message tokens to be appended (for documentation etc.).
Improved BP error reporting: Now we display the actual node name instead of CallFunction_0 etc.
CVar forcing multithreaded update is now defaulted to off. Projects now by default enable it but can more easily opt-out.
#doc Added link to new section of AnimGraph page, which may benefit from images etc.
#jira UE-28283 - Look into expanding the system to determine what nodes we allow to run on worker threads.
Change 3184886 on 2016/11/03 by Thomas.Sarkanen
Content fixes for anim BP thread safety warnings
Ocean:
Random Float node is unsafe (uses rand() unde rthe hood) so replaced with Random Stream.
Odin:
Flying Bot accessed the character blueprint inside some transitions. Cached the value in the event graph instead.
Fortnite:
Disable threaded update for a number of anim BPs as they were using unsafe calls when using CopyPoseFromMesh
Change 3184894 on 2016/11/03 by Thomas.Sarkanen
Fix Mac CIS
Change 3184951 on 2016/11/03 by Thomas.Sarkanen
Fix CIS warning on clang platforms
Change 3185176 on 2016/11/03 by James.Golding
Hopeful fix for building PhysXVehicles plugin for mac
Change 3185289 on 2016/11/03 by Alex.Delesky
#jira UE-37773 - Updating the Gameplay Tags UI to allow for the following:
-Addition of a tag with comments and a specific INI location
-An "Add Subtag" button that will allow the user to create a tag underneath a specified parent that autofills most of the information (parent name and location) for the new tag
-A dropdown menu to allow for additional actions to be performed on a tag (rename, delete, search for references)
-Comments for gameplay tags now show up in the tooltip forthe tag rather than the tag name if one had been specified
-Shows a tree in the Project Settings window when viewing the gameplay tag list instead of an array
Change 3185331 on 2016/11/03 by Marc.Audy
Remove duplicated condition from if
Change 3185426 on 2016/11/03 by James.Golding
Another attempt at fixing mac builds of PhysXVehicles plugin
Change 3185487 on 2016/11/03 by James.Golding
- Remove TireType assets from templates/sample, add TireConfigs instead
- Make deprecated vehicle vars visible (but not editable), to help converting content
- Change icon for PhysX vehicle plugin
Change 3185520 on 2016/11/03 by James.Golding
Trying yet again to fix Mac CIS!
Change 3185542 on 2016/11/03 by Ben.Zeigler
#jira UE-34086
Commit modified version of PR #2665 to allow overriding crouch behavior in subclasses of CharacterMovementComponent
#jira UE-35652
Fix crouch behavior to not change capsule until after uncroach check, to avoid causing unnecessary physics side effects
Also had to set the TeleportPhysics flag in this case, so add code to remember if a teleport was attempted during a deferred movement, and then apply that flag during EndScopedMovementUpdate
Change 3185570 on 2016/11/03 by Marc.Audy
Protect against theoretical crash introduced in CL# 2049861 if CreatePackage returns null.
Remove some autos
Change 3185749 on 2016/11/03 by dan.reynolds
AEOverview test map addition: testing Virtual Voice
Change 3185946 on 2016/11/03 by dan.reynolds
AEOverview tweaks - clarified success conditions for Streaming Spam and Streaming Priority maps
Change 3185972 on 2016/11/03 by Lina.Halper
Fix issue with offset of attachment getting messed up because parent doesn't tick the animation correctly when opening level from Content Browser
#jira: UE-31890
#code review: Thomas.Sarkanen
Change 3186043 on 2016/11/03 by Alex.Delesky
#jira UE-37773 - Fixing some of the gameplay tags UI based on feedback
-Right-aligned input fields for the AddNewGameplayTag and RenameGameplayTag widgets
-Added a divider to the GameplayTag widget that will appear when the AddNewGameplayTag widget is visible
-Tags with comments will now display both their name and their comment in tooltips
Change 3186207 on 2016/11/03 by Alex.Delesky
#jira UE-37773 - The Gameplay Tags widget in the project browser will no longer display the disabled checkboxes and disabled text for the tag names
Change 3186321 on 2016/11/03 by Dan.Reynolds
Removed deprecated test asset (BP_ProceduralSoundWaveTest)
Change 3186740 on 2016/11/04 by Thomas.Sarkanen
Removed FPersona and supporting classes
Also removed UMorphTarget's asset type actions (as it was nearly empty and we dont use them as assets any more).
#jira UEFW-222 - Remove FPersona
Change 3186741 on 2016/11/04 by Thomas.Sarkanen
Fix non-unity builds
Change 3186755 on 2016/11/04 by Thomas.Sarkanen
Prevent adding keys to read-only curves in curve tables
Lock off the shift-LMB shortcut to add keys
#jira UE-38210 - Crash trying to add a key to a curve table in curve view
Change 3186798 on 2016/11/04 by James.Golding
UE-37503 - Add FHitResult output to K2_LineTraceComponent
Change 3186800 on 2016/11/04 by James.Golding
- Remove deprecated collision functions in KismetSystemLibrary
- Remove _NEW from collision function names, add redirectors
- Add debug draw options (TraceColor, TraceHitColor, DrawTime) to shape traces, to match line traces (UE-35941)
Change 3186989 on 2016/11/04 by James.Golding
Fix CIS fail in Fortnte
Change 3187081 on 2016/11/04 by Wes.Hunt
EngineAnalytics::Shutdown now checks to see if the Analytics pointer is null OR unique before ensuring. #jira UE-38125
Change 3187135 on 2016/11/04 by Jurre.deBaare
Fix for incorrect framework version in blendspace serialization code.
Change 3187682 on 2016/11/04 by Ben.Zeigler
#jira UE-38289 Fix crash when replicated tag array is empty
Change 3188113 on 2016/11/05 by Mieszko.Zielinski
Removed a bunch of deprecated AI module functions #UE4
Cut-off point at v4.10
Change 3188119 on 2016/11/05 by Mieszko.Zielinski
Deprecated AI functionality removal fallout fixes #UE4
Change 3188121 on 2016/11/05 by Mieszko.Zielinski
PR #2883: Added a Cone EQS Generator (Contributed by orfeasel)
Did some massaging on change.
#jira UE-37685
Change 3188122 on 2016/11/05 by Mieszko.Zielinski
Bumped EnvQueryGenerator_Cone.AlignedPointsDistance's default value up to 100, which makes a bit more sense #UE4
Change 3188442 on 2016/11/07 by James.Golding
Check in trace debug draw test map
Change 3188463 on 2016/11/07 by james.cobbett
Submitting Pose Snapshot test map and asset
Change 3188618 on 2016/11/07 by Thomas.Sarkanen
Expanded pose snapshot system
Allows poses to be stored in variables.
Split FPoseSnapshot from FAnimInstanceProxy and made it a BlueprintType USTRUCT.
Added modes to FAnimNode_PoseSnapshot so that we can either use the named pose or a FPoseSnapshot variable pin.
Moved pose snapshot code into USkeletalMeshComponent as it doesnt need to be on the proxy any more.
#jira UEFW-242 - Caching poses to a Blueprint variable (and an anim node to use it with)
Change 3188619 on 2016/11/07 by Thomas.Sarkanen
Moved "NoResetToDefaults" to the correct metadata section in ObjectMacros.h
Change 3188642 on 2016/11/07 by Thomas.Sarkanen
Added new test for pose variables
Change 3188716 on 2016/11/07 by Ben.Zeigler
#jira UE-38294 Fix bad error message when adding new DefaultGameplayTags.ini file
Change 3189020 on 2016/11/07 by dan.reynolds
Added a test map for Audio Volume Ambient Zone test for Play Sound at Location
AVOverviewAZPlaySoundAtLocation
Change 3189188 on 2016/11/07 by Jon.Nabozny
Fix edge cases / alternate IPv6 formats in IPAddressBSDIPv6::SetIp.
#jira UE-36607
Change 3189199 on 2016/11/07 by Jon.Nabozny
Flag UActorComponent, USceneComponent, and UPrimitiveComponent UFUNCTIONS as UnsafeDuringActorConstruction="true" if they
modify unreplicated properties, require use of the PhysScene, or otherwise indicate poor design.
#jira UE-33038
Change 3189271 on 2016/11/07 by Aaron.McLeran
UEFW-224 Refectoring UnrealEd code to move all audio related editing code to a new AudioEditor module
- Fixups for removals
- Several bug fixes for sound classes
Change 3189450 on 2016/11/07 by Aaron.McLeran
Fixes for facial animation playback progress
- Creating a per-source PlaybackTime which can be used to get a fairly accurate playback percentage function for all platforms.
- Allowing platforms to override to get a "sample accurate" playback time for platforms that are able.
Change 3189507 on 2016/11/07 by Wes.Hunt
* Deprecated GetUniqueDeviceId. Use GetDeviceId now instead. #jira AN-820
* Added warnings to each implementation of GetDeviceId as to what API it uses, and what cert requirements may be placed on it.
* Deprecated all platform independent usages of GetMacAddress and related functions. #jira AN-820 #jira AN-802
* Deprecated GetMachineId. Use GetLoginId now instead. #jira AN-811
* Update usages of MachineID throughout CrashReporter code. Left MachineId and LoginId as available attributes.
* Removed LocalPlayer requirement for setting the Analytics UserId in internal products. Removed fallbacks for seting UserId for internal products. #jira AN-814 #jira AN-808
* Removed GetUniqueDeviceId code from LauncherInstaller.
* Removed redundant MachineID and AccountID from Editor.ProgramStarted analytics event.
* Removed DeviceID from SessionStart analytics event.
#FYI: justin.sargent, Chris.Wood, Wes.Fudala
* Justin, reminder that FPortalRpcResponderFactory::Create will need to start using GetLoginID instead of MacAddress for IPC identifiers.
* Chris, look over CRP code to ensure that I didn't destroy some vital bit of necessary connection with the MachineId->LoginId name change. Both values are used, and for now, they both return the same thing.
* Wes, we didn't need GetUnqiueDeviceId attribute in BeginSession, as no one ever uses it, so I just removed it.
Change 3190032 on 2016/11/08 by Wes.Hunt
Fix a few places I forgot to deprecate regarding GetMacAddress.
Change 3190107 on 2016/11/08 by Wes.Hunt
Another attempt to remove deprecation warning in CIS. Apparently removing the warning for a const string initialized via a consrtuctor with a deprecated function is somewhat tricky. Still not sure why it works on my machine either way.
Change 3190326 on 2016/11/08 by Aaron.McLeran
Fixing CIS build warning
Change 3190495 on 2016/11/08 by Jon.Nabozny
Fix OSSNull server / session filtering to better match SessionSettings and online OSS. Make MCP, Steam, and Null LAN queries more consistent.
#jira UE-37512
Change 3190566 on 2016/11/08 by Martin.Wilson
Remove warning on Least Destructive (was incorrectly applied to least destructive due to legacy reasons)
#jira UE-27323
Change 3190631 on 2016/11/08 by Martin.Wilson
Fix notify validation not triggering when using set time/set frame context menu options
#jira UE-37857
Change 3190666 on 2016/11/08 by Martin.Wilson
Add info about anim instance to additive warning
#jira UE-35930
Change 3191290 on 2016/11/09 by Thomas.Sarkanen
Fix skeleton tree selection disappearing when filtering changes
Note: Copying //Tasks/UE4/Dev-UEFW132-PhATUpgrade to Dev-Framework (//UE4/Dev-Framework)
Split SSkeletonTree into multiple files
Items now derive from the common base class ISkeletonTreeItem.
New skeleton tree item RTTI added modlled on the drag/drop RTTI.
Filtering is now performed independently of tree building. Filtering and building are more extensible (more of this to come).
Item selection is now preserved on filter change.
Filtering now (optionally) keeps the hierarchy in place.
#jira UE-31017 - Skeleton Selection is Lost When Changing Filters
Change 3191325 on 2016/11/09 by Thomas.Sarkanen
Fix clang CIS
Change 3191344 on 2016/11/09 by Thomas.Sarkanen
More clang CIS fixes
Change 3191345 on 2016/11/09 by Thomas.Sarkanen
CIS fix: Missed another enum fwd declaration
Change 3191374 on 2016/11/09 by Thomas.Sarkanen
Remove 4.11 deprecated functions from animation systems
Also deprecate NativeUpdateAnimation_WorkerThread as users should no longer be calling this function (it is not run on worker threads anyways).
#jira UE-35748 - Clean up 4.11 Deprecated functions
Change 3191375 on 2016/11/09 by Thomas.Sarkanen
Fixup Orion hero instance after deprecation
Change 3191739 on 2016/11/09 by Marc.Audy
PhysX Vehicle plugin needs to be loaded with -game as well, so it must be Developer, not Editor.
Change 3191827 on 2016/11/09 by Marc.Audy
Raw Input plugin allowing support of steering wheels and flightsticks
#jira UEFW-237
Change 3191828 on 2016/11/09 by Ben.Zeigler
#jira UE-38384 Comment cleanup for gameplay tag library
Change 3191889 on 2016/11/09 by Ben.Zeigler
#jira UE-38294 Fix issues with trying to set not-yet-written settings files as writable and add them to source control
If a settings file does not yet exist on disk, also try adding to source control after writing it
Change 3191911 on 2016/11/09 by Marc.Audy
Enable raw input plugin and configure for use with the Logitech G920 all vehicle templates and vehicle game.
#jira UEFW-237
Change 3191915 on 2016/11/09 by Marc.Audy
Provide useful tooltips for raw input setting properties
#jira UEFW-237
Change 3192039 on 2016/11/09 by dan.reynolds
AEOverview Update
- Added a map for checking multi-channel file playback: AEOverviewMultichannel.umap
- Incorporated AVOverviewAZPlaySoundAtLocation test into the AEOverviewMain submap list temporarily for testing purposes
Change 3192059 on 2016/11/09 by Martin.Wilson
Fix montage thumbnail rendering with ref pose
#jira UE-35578
Change 3192065 on 2016/11/09 by Martin.Wilson
Widen bone reference widget to give a better view of the name and added full name to tooltip
#jira UE-36264
Change 3192217 on 2016/11/09 by Martin.Wilson
Auto selected current bone when opening bone reference tree
#Jira UE-36264
Change 3192332 on 2016/11/09 by Marc.Audy
Fix RawInput compiling when WITH_EDITOR is false
#jira UE-38433
Change 3193061 on 2016/11/10 by Thomas.Sarkanen
Marked facial animation plugin & component as experimental/beta
Change 3193072 on 2016/11/10 by Martin.Wilson
Correct reference skeleton fix up order
Change 3193112 on 2016/11/10 by Danny.Bouimad
Pesudo hair asset usintphat for testing
Change 3193243 on 2016/11/10 by Martin.Wilson
Fix removal of USkeleton bone tree entries
#Jira UE-37363
Change 3193249 on 2016/11/10 by Marc.Audy
Raw input compile fixes:
Fix additional not with_editor compile issues
Fix static analysis warnings
#jira UE-38433
Change 3193558 on 2016/11/10 by Martin.Wilson
Move "Number of Curves" label creation to attribute so that it updates dynamically
#jira UE-26767
Change 3193664 on 2016/11/10 by Marc.Audy
PR #2919: Fixed Comment Typo in ActorComponent.cpp (Contributed by KumaKing)
#jira UE-38436
Change 3193719 on 2016/11/10 by Lukasz.Furman
fixed vertical jitter in replicated NavWalking movement
#jira UE-33260
Change 3193802 on 2016/11/10 by Marc.Audy
Remove some autos, fix NULL to nullptr, call GetWorld just once
Change 3193809 on 2016/11/10 by Marc.Audy
Fix Mac CIS compile error
#jira UE-38501
Change 3194053 on 2016/11/10 by Aaron.McLeran
Fixed crash on shutdown when using audio mixer
- Switching audio mixer to use a runnable thread rather than async tasks
- Fixed issue where audio buffers weren't taking ownership of wave data
Change 3194057 on 2016/11/10 by Aaron.McLeran
Adjusting channel mapping code to better support standard down-mixing for 2D multi-channel files.
- Added support for 8 channel source files.
Change 3194070 on 2016/11/10 by Aaron.McLeran
Fixing stupid compile error
Change 3194779 on 2016/11/11 by Jon.Nabozny
Fixed UnsafeDuringActorConstruction tag on USceneComponent::GetPhysicsVolume.
Missed the '=true' portion.
Change 3194967 on 2016/11/11 by Mieszko.Zielinski
PR #2920: Bug Fix: fix pasting Behavior Tree nodes with decorators in wrong position (Contributed by BrettKercher)
#jira UE-38443
#jira UE-30906
Change 3195741 on 2016/11/11 by Ben.Zeigler
#UE-38539 Stop Orion from reinitializing it's native tag dictionary when reloading menu, this was just slow before but now ensures
Change 3196655 on 2016/11/14 by Marc.Audy
Remove pointless remove/adds from Odin DefaultEngine.ini.
This also fixes the duplicate redirector of AnimNode_WheelHandler as the version in BaseEngine.ini has been changed where it points to
#jira UE-38562
Change 3196678 on 2016/11/14 by Lukasz.Furman
pass on gameplay debugger's EQS category
copy of CL# 3195071, 3195152, 3196617 with local fixes
Change 3196700 on 2016/11/14 by Ben.Zeigler
#jira UE-38539 Move where orion tags are initialized to earlier in the startup for all loading flows
Change 3196719 on 2016/11/14 by Thomas.Sarkanen
Added extra output to anim BP compiler when a blueprint function call is used
This allows us to give more info to users when unsafe things (like blueprint functions) are used.
Change 3196799 on 2016/11/14 by Jurre.deBaare
Fix for blendspace tooltip crash
#fix Check before dereferencing animation ptr on samples :)
Change 3196971 on 2016/11/14 by Lukasz.Furman
replaced hardcoded value for pathfollowing's focal point distance with a parameter
#ue4
Change 3196994 on 2016/11/14 by Marc.Audy
Slightly improve performance of boolean check
Change 3197768 on 2016/11/14 by dan.reynolds
AEOverview Stage 2 WIP
- Added Command Line auto sub-level loading (-AELoadMap=MapName01,MapName02,etc.) or sub-level categories auto loading (-AELoadCat=AE,SC,STRM,AV,etc.)
- Added Categorization menu to Main staging map to help sorting maps by category
- Changed menu to be dynamically loaded from editable Data Structure Arrays, so all the menu information is loaded dynamically.
Change 3197782 on 2016/11/14 by dan.reynolds
AEOverview Stage 2 WIP - fixed misnamed sub-level reference, cleaned up some of the BP
Change 3197801 on 2016/11/14 by dan.reynolds
AEOverviewMain Stage 2 WIP:
- Added Select All Buttom to select all loaded menu items
Change 3197988 on 2016/11/15 by Thomas.Sarkanen
Add the ability to use incompatible meshes with snapshots
We now use a name-based mapping to copy local poses to the correct bones in the hierarchy, similar to CopyPoseFromMesh.
No access to UObjects (components or meshes) is performed on worker threads. Bone names are all cached on the game thread when needed and used on worker threads.
#jira UE-38413 - Pose snapshot cannot be used across meshes with different hierarchies
Change 3198062 on 2016/11/15 by Thomas.Sarkanen
Disabled threaded update on various anim blueprints to remove cook warnings
#jira UE-38537 - Cooking FortniteGame results in warnings
Change 3198071 on 2016/11/15 by Thomas.Sarkanen
Fix default values not being available to change post anim BP compilation
Make sure we re-select with force refresh on so the details panel is rebuilt even if the objects are the same (as the customization relies upon it).
#jira UE-38518 - Animation Blueprint: Default values cannot be changed after compiling if node is currently selected
Change 3198082 on 2016/11/15 by Jurre.deBaare
CRASH If the Vertical Axis of a blendspace is set to 0 segments when an animation is on the blendspace the editor crashes
#fix UI and ClampMin to 1
#jira UE-38587
Change 3198138 on 2016/11/15 by Thomas.Sarkanen
Expose montage functions to Blueprint
Made sure to flag appropriate functions as not thread safe.
Also const-corrected a few functions that should be.
Github #2918: Blueprint Callable Montage Set/Get Position
#jira UE-38391 - GitHub 2918 : Blueprint Callable Montage Set/Get Position
Change 3198141 on 2016/11/15 by Jurre.deBaare
Crash from generated Merged Actor with no created lightmap UV
#fix Always flag UV channel 0 to be occupied
#jira UE-38520
Change 3198420 on 2016/11/15 by Thomas.Sarkanen
Move thread-safety check flags to the UAnimBlueprint
Then have the compiler propogate the flags to the CDO. Prevents issues where the old CDO wasnt propgated during compile-on-load.
Also move blueprint usage warning flag into the UAnimBlueprint too, as these suffer from the same issues.
#jira UE-38537 - Cooking FortniteGame results in warnings
Change 3198485 on 2016/11/15 by Thomas.Sarkanen
Properly fix compile-on-load/cook warnings about anim blueprint thread safety
Content only re-save.
#jira UE-38537 - Cooking FortniteGame results in warnings
Change 3198622 on 2016/11/15 by Ben.Zeigler
#jira UE-38632 Fix blueprint warning, was calling SetActive from construction script which is no longer allowed. This was being used for an editor-only debug feature
[CL 3198987 by Marc Audy in Main branch]
1676 lines
58 KiB
C#
1676 lines
58 KiB
C#
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Linq;
|
|
|
|
namespace UnrealBuildTool
|
|
{
|
|
public enum SDKStatus
|
|
{
|
|
Valid, // Desired SDK is installed and set up.
|
|
Invalid, // Could not find the desired SDK, SDK setup failed, etc.
|
|
};
|
|
|
|
public abstract class UEBuildPlatformContext
|
|
{
|
|
private bool bInitializedProject = false;
|
|
|
|
/// <summary>
|
|
/// The specific platform that this context is for
|
|
/// </summary>
|
|
public readonly UnrealTargetPlatform Platform;
|
|
|
|
/// <summary>
|
|
/// The project file for the target being compiled
|
|
/// </summary>
|
|
public readonly FileReference ProjectFile;
|
|
|
|
/// <summary>
|
|
/// The current overall target configuration being worked on
|
|
/// </summary>
|
|
public UnrealTargetConfiguration TargetConfiguration;
|
|
|
|
/// <summary>
|
|
/// Constructor.
|
|
/// </summary>
|
|
/// <param name="InPlatform">The platform that this context is for</param>
|
|
/// <param name="InProjectFile">The project to read settings from, if any</param>
|
|
public UEBuildPlatformContext(UnrealTargetPlatform InPlatform, FileReference InProjectFile)
|
|
{
|
|
Platform = InPlatform;
|
|
ProjectFile = InProjectFile;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get a list of extra modules the platform requires.
|
|
/// This is to allow undisclosed platforms to add modules they need without exposing information about the platform.
|
|
/// </summary>
|
|
/// <param name="Target">The target being build</param>
|
|
/// <param name="ExtraModuleNames">List of extra modules the platform needs to add to the target</param>
|
|
public virtual void AddExtraModules(TargetInfo Target, List<string> ExtraModuleNames)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Modify the rules for a newly created module, in a target that's being built for this platform.
|
|
/// This is not required - but allows for hiding details of a particular platform.
|
|
/// </summary>
|
|
/// <param name="ModuleName">The name of the module</param>
|
|
/// <param name="Rules">The module rules</param>
|
|
/// <param name="Target">The target being build</param>
|
|
public virtual void ModifyModuleRulesForActivePlatform(string ModuleName, ModuleRules Rules, TargetInfo Target)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gives the platform a chance to 'override' the configuration settings that are overridden on calls to RunUBT.
|
|
/// </summary>
|
|
/// <param name="InConfiguration">The UnrealTargetConfiguration being built</param>
|
|
/// <returns>bool true if debug info should be generated, false if not</returns>
|
|
public virtual void ResetBuildConfiguration(UnrealTargetConfiguration InConfiguration)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Validate the UEBuildConfiguration for this platform
|
|
/// This is called BEFORE calling UEBuildConfiguration to allow setting
|
|
/// various fields used in that function such as CompileLeanAndMean...
|
|
/// </summary>
|
|
public virtual void ValidateUEBuildConfiguration()
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Validate configuration for this platform
|
|
/// NOTE: This function can/will modify BuildConfiguration!
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The CPPTargetPlatform being built</param>
|
|
/// <param name="InConfiguration"> The CPPTargetConfiguration being built</param>
|
|
/// <param name="bInCreateDebugInfo">true if debug info is getting create, false if not</param>
|
|
public virtual void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Setup the target environment for building
|
|
/// </summary>
|
|
/// <param name="InBuildTarget"> The target being built</param>
|
|
public abstract void SetUpEnvironment(UEBuildTarget InBuildTarget);
|
|
|
|
/// <summary>
|
|
/// Allow the platform to set an optional architecture
|
|
/// </summary>
|
|
public virtual string GetActiveArchitecture()
|
|
{
|
|
// by default, use an empty architecture (which is really just a modifer to the platform for some paths/names)
|
|
return "";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get name for architecture-specific directories (can be shorter than architecture name itself)
|
|
/// </summary>
|
|
public virtual string GetActiveArchitectureFolderName()
|
|
{
|
|
// by default, use the architecture name
|
|
return GetActiveArchitecture();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Setup the configuration environment for building
|
|
/// </summary>
|
|
/// <param name="InBuildTarget"> The target being built</param>
|
|
public virtual void SetUpConfigurationEnvironment(TargetInfo Target, CPPEnvironment GlobalCompileEnvironment, LinkEnvironment GlobalLinkEnvironment)
|
|
{
|
|
// Determine the C++ compile/link configuration based on the Unreal configuration.
|
|
CPPTargetConfiguration CompileConfiguration;
|
|
UnrealTargetConfiguration CheckConfig = Target.Configuration;
|
|
|
|
switch (CheckConfig)
|
|
{
|
|
default:
|
|
case UnrealTargetConfiguration.Debug:
|
|
CompileConfiguration = CPPTargetConfiguration.Debug;
|
|
if (BuildConfiguration.bDebugBuildsActuallyUseDebugCRT)
|
|
{
|
|
GlobalCompileEnvironment.Config.Definitions.Add("_DEBUG=1"); // the engine doesn't use this, but lots of 3rd party stuff does
|
|
}
|
|
else
|
|
{
|
|
GlobalCompileEnvironment.Config.Definitions.Add("NDEBUG=1"); // the engine doesn't use this, but lots of 3rd party stuff does
|
|
}
|
|
GlobalCompileEnvironment.Config.Definitions.Add("UE_BUILD_DEBUG=1");
|
|
break;
|
|
case UnrealTargetConfiguration.DebugGame:
|
|
// Individual game modules can be switched to be compiled in debug as necessary. By default, everything is compiled in development.
|
|
case UnrealTargetConfiguration.Development:
|
|
CompileConfiguration = CPPTargetConfiguration.Development;
|
|
GlobalCompileEnvironment.Config.Definitions.Add("NDEBUG=1"); // the engine doesn't use this, but lots of 3rd party stuff does
|
|
GlobalCompileEnvironment.Config.Definitions.Add("UE_BUILD_DEVELOPMENT=1");
|
|
break;
|
|
case UnrealTargetConfiguration.Shipping:
|
|
CompileConfiguration = CPPTargetConfiguration.Shipping;
|
|
GlobalCompileEnvironment.Config.Definitions.Add("NDEBUG=1"); // the engine doesn't use this, but lots of 3rd party stuff does
|
|
GlobalCompileEnvironment.Config.Definitions.Add("UE_BUILD_SHIPPING=1");
|
|
break;
|
|
case UnrealTargetConfiguration.Test:
|
|
CompileConfiguration = CPPTargetConfiguration.Shipping;
|
|
GlobalCompileEnvironment.Config.Definitions.Add("NDEBUG=1"); // the engine doesn't use this, but lots of 3rd party stuff does
|
|
GlobalCompileEnvironment.Config.Definitions.Add("UE_BUILD_TEST=1");
|
|
break;
|
|
}
|
|
|
|
// Set up the global C++ compilation and link environment.
|
|
GlobalCompileEnvironment.Config.Target.Configuration = CompileConfiguration;
|
|
GlobalLinkEnvironment.Config.Target.Configuration = CompileConfiguration;
|
|
|
|
// Create debug info based on the heuristics specified by the user.
|
|
GlobalCompileEnvironment.Config.bCreateDebugInfo =
|
|
!BuildConfiguration.bDisableDebugInfo && ShouldCreateDebugInfo(CheckConfig);
|
|
GlobalLinkEnvironment.Config.bCreateDebugInfo = GlobalCompileEnvironment.Config.bCreateDebugInfo;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Setup the project environment for building
|
|
/// </summary>
|
|
/// <param name="InBuildTarget"> The target being built</param>
|
|
public virtual void SetUpProjectEnvironment(UnrealTargetConfiguration Configuration, TargetInfo Target = null)
|
|
{
|
|
if (!bInitializedProject)
|
|
{
|
|
TargetConfiguration = Configuration;
|
|
|
|
string EngineIniPath = ProjectFile != null ? ProjectFile.Directory.FullName : null;
|
|
if (String.IsNullOrEmpty(EngineIniPath))
|
|
{
|
|
// If the project file hasn't been specified, try to get the path from -remoteini command line param
|
|
EngineIniPath = UnrealBuildTool.GetRemoteIniPath();
|
|
}
|
|
DirectoryReference EngineIniDir = !String.IsNullOrEmpty(EngineIniPath) ? new DirectoryReference(EngineIniPath) : null;
|
|
ConfigCacheIni Ini = ConfigCacheIni.CreateConfigCacheIni(Platform, "Engine", EngineIniDir);
|
|
|
|
bool bValue = UEBuildConfiguration.bCompileAPEX;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bCompileApex", out bValue))
|
|
{
|
|
UEBuildConfiguration.bCompileAPEX = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bCompileBox2D;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bCompileBox2D", out bValue))
|
|
{
|
|
UEBuildConfiguration.bCompileBox2D = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bCompileICU;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bCompileICU", out bValue))
|
|
{
|
|
UEBuildConfiguration.bCompileICU = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bCompileSimplygon;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bCompileSimplygon", out bValue))
|
|
{
|
|
UEBuildConfiguration.bCompileSimplygon = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bCompileSimplygonSSF;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bCompileSimplygonSSF", out bValue))
|
|
{
|
|
UEBuildConfiguration.bCompileSimplygonSSF = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bCompileLeanAndMeanUE;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bCompileLeanAndMeanUE", out bValue))
|
|
{
|
|
UEBuildConfiguration.bCompileLeanAndMeanUE = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bIncludeADO;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bIncludeADO", out bValue))
|
|
{
|
|
UEBuildConfiguration.bIncludeADO = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bCompileRecast;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bCompileRecast", out bValue))
|
|
{
|
|
UEBuildConfiguration.bCompileRecast = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bCompileSpeedTree;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bCompileSpeedTree", out bValue))
|
|
{
|
|
UEBuildConfiguration.bCompileSpeedTree = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bCompileWithPluginSupport;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bCompileWithPluginSupport", out bValue))
|
|
{
|
|
UEBuildConfiguration.bCompileWithPluginSupport = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bWithPerfCounters;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bWithPerfCounters", out bValue))
|
|
{
|
|
UEBuildConfiguration.bWithPerfCounters = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bCompileFreeType;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bCompileFreeType", out bValue))
|
|
{
|
|
UEBuildConfiguration.bCompileFreeType = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bCompileForSize;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bCompileForSize", out bValue))
|
|
{
|
|
UEBuildConfiguration.bCompileForSize = bValue;
|
|
}
|
|
|
|
bValue = UEBuildConfiguration.bCompileCEF3;
|
|
if (Ini.GetBool("/Script/BuildSettings.BuildSettings", "bCompileCEF3", out bValue))
|
|
{
|
|
UEBuildConfiguration.bCompileCEF3 = bValue;
|
|
}
|
|
|
|
if (Target != null && Target.IsCooked)
|
|
{
|
|
if (Ini.GetBool("/Script/Engine.StreamingSettings", "s.EventDrivenLoaderEnabled", out bValue))
|
|
{
|
|
UEBuildConfiguration.bEventDrivenLoader = bValue;
|
|
}
|
|
}
|
|
bInitializedProject = true;
|
|
}
|
|
else
|
|
{
|
|
if (TargetConfiguration != Configuration)
|
|
{
|
|
throw new BuildException("SetUpProjectEnvironment: Can not setup a project for a different target configuration");
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether this platform should create debug information or not
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The UnrealTargetPlatform being built</param>
|
|
/// <param name="InConfiguration"> The UnrealTargetConfiguration being built</param>
|
|
/// <returns>bool true if debug info should be generated, false if not</returns>
|
|
public abstract bool ShouldCreateDebugInfo(UnrealTargetConfiguration Configuration);
|
|
|
|
/// <summary>
|
|
/// Creates a toolchain instance for the default C++ platform.
|
|
/// </summary>
|
|
/// <returns>New toolchain instance.</returns>
|
|
public UEToolChain CreateToolChainForDefaultCppPlatform()
|
|
{
|
|
return CreateToolChain(UEBuildPlatform.GetBuildPlatform(Platform).DefaultCppPlatform);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates a toolchain instance for the given platform. There should be a single toolchain instance per-target, as their may be
|
|
/// state data and configuration cached between calls.
|
|
/// </summary>
|
|
/// <param name="Platform">The platform to create a toolchain for</param>
|
|
/// <returns>New toolchain instance.</returns>
|
|
public abstract UEToolChain CreateToolChain(CPPTargetPlatform Platform);
|
|
|
|
/// <summary>
|
|
/// Create a build deployment handler
|
|
/// </summary>
|
|
/// <param name="DeploymentHandler">The output deployment handler</param>
|
|
/// <returns>Deployment handler for this platform, or null if not required</returns>
|
|
public abstract UEBuildDeploy CreateDeploymentHandler();
|
|
}
|
|
|
|
public abstract class UEBuildPlatform
|
|
{
|
|
private static Dictionary<UnrealTargetPlatform, UEBuildPlatform> BuildPlatformDictionary = new Dictionary<UnrealTargetPlatform, UEBuildPlatform>();
|
|
|
|
// a mapping of a group to the platforms in the group (ie, Microsoft contains Win32 and Win64)
|
|
static Dictionary<UnrealPlatformGroup, List<UnrealTargetPlatform>> PlatformGroupDictionary = new Dictionary<UnrealPlatformGroup, List<UnrealTargetPlatform>>();
|
|
|
|
/// <summary>
|
|
/// The corresponding target platform enum
|
|
/// </summary>
|
|
public readonly UnrealTargetPlatform Platform;
|
|
|
|
/// <summary>
|
|
/// The default C++ target platform to use
|
|
/// </summary>
|
|
public readonly CPPTargetPlatform DefaultCppPlatform;
|
|
|
|
/// <summary>
|
|
/// Constructor.
|
|
/// </summary>
|
|
/// <param name="InPlatform">The enum value for this platform</param>
|
|
public UEBuildPlatform(UnrealTargetPlatform InPlatform, CPPTargetPlatform InDefaultCPPPlatform)
|
|
{
|
|
Platform = InPlatform;
|
|
DefaultCppPlatform = InDefaultCPPPlatform;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether the required external SDKs are installed for this platform. Could be either a manual install or an AutoSDK.
|
|
/// </summary>
|
|
public abstract SDKStatus HasRequiredSDKsInstalled();
|
|
|
|
/// <summary>
|
|
/// Gets all the registered platforms
|
|
/// </summary>
|
|
/// <returns>Sequence of registered platforms</returns>
|
|
public static IEnumerable<UnrealTargetPlatform> GetRegisteredPlatforms()
|
|
{
|
|
return BuildPlatformDictionary.Keys;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Attempt to convert a string to an UnrealTargetPlatform enum entry
|
|
/// </summary>
|
|
/// <returns>UnrealTargetPlatform.Unknown on failure (the platform didn't match the enum)</returns>
|
|
public static UnrealTargetPlatform ConvertStringToPlatform(string InPlatformName)
|
|
{
|
|
// special case x64, to not break anything
|
|
// @todo: Is it possible to remove this hack?
|
|
if (InPlatformName.Equals("X64", StringComparison.InvariantCultureIgnoreCase))
|
|
{
|
|
return UnrealTargetPlatform.Win64;
|
|
}
|
|
|
|
// we can't parse the string into an enum because Enum.Parse is case sensitive, so we loop over the enum
|
|
// looking for matches
|
|
foreach (string PlatformName in Enum.GetNames(typeof(UnrealTargetPlatform)))
|
|
{
|
|
if (InPlatformName.Equals(PlatformName, StringComparison.InvariantCultureIgnoreCase))
|
|
{
|
|
// convert the known good enum string back to the enum value
|
|
return (UnrealTargetPlatform)Enum.Parse(typeof(UnrealTargetPlatform), PlatformName);
|
|
}
|
|
}
|
|
return UnrealTargetPlatform.Unknown;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Determines whether a given platform is available
|
|
/// </summary>
|
|
/// <param name="Platform">The platform to check for</param>
|
|
/// <returns>True if it's available, false otherwise</returns>
|
|
public static bool IsPlatformAvailable(UnrealTargetPlatform Platform)
|
|
{
|
|
return BuildPlatformDictionary.ContainsKey(Platform);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Register the given platforms UEBuildPlatform instance
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The UnrealTargetPlatform to register with</param>
|
|
/// <param name="InBuildPlatform"> The UEBuildPlatform instance to use for the InPlatform</param>
|
|
public static void RegisterBuildPlatform(UEBuildPlatform InBuildPlatform)
|
|
{
|
|
if (BuildPlatformDictionary.ContainsKey(InBuildPlatform.Platform) == true)
|
|
{
|
|
Log.TraceWarning("RegisterBuildPlatform Warning: Registering build platform {0} for {1} when it is already set to {2}",
|
|
InBuildPlatform.ToString(), InBuildPlatform.Platform.ToString(), BuildPlatformDictionary[InBuildPlatform.Platform].ToString());
|
|
BuildPlatformDictionary[InBuildPlatform.Platform] = InBuildPlatform;
|
|
}
|
|
else
|
|
{
|
|
BuildPlatformDictionary.Add(InBuildPlatform.Platform, InBuildPlatform);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Assign a platform as a member of the given group
|
|
/// </summary>
|
|
public static void RegisterPlatformWithGroup(UnrealTargetPlatform InPlatform, UnrealPlatformGroup InGroup)
|
|
{
|
|
// find or add the list of groups for this platform
|
|
PlatformGroupDictionary.GetOrAddNew(InGroup).Add(InPlatform);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Retrieve the list of platforms in this group (if any)
|
|
/// </summary>
|
|
public static List<UnrealTargetPlatform> GetPlatformsInGroup(UnrealPlatformGroup InGroup)
|
|
{
|
|
List<UnrealTargetPlatform> PlatformList;
|
|
PlatformGroupDictionary.TryGetValue(InGroup, out PlatformList);
|
|
return PlatformList;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerates all the platform groups for a given platform
|
|
/// </summary>
|
|
/// <param name="InPlatform">The platform to look for</param>
|
|
/// <returns>List of platform groups that this platform is a member of</returns>
|
|
public static IEnumerable<UnrealPlatformGroup> GetPlatformGroups(UnrealTargetPlatform Platform)
|
|
{
|
|
return PlatformGroupDictionary.Where(x => x.Value.Contains(Platform)).Select(x => x.Key);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Retrieve the IUEBuildPlatform instance for the given TargetPlatform
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The UnrealTargetPlatform being built</param>
|
|
/// <param name="bInAllowFailure"> If true, do not throw an exception and return null</param>
|
|
/// <returns>UEBuildPlatform The instance of the build platform</returns>
|
|
public static UEBuildPlatform GetBuildPlatform(UnrealTargetPlatform InPlatform, bool bInAllowFailure = false)
|
|
{
|
|
if (BuildPlatformDictionary.ContainsKey(InPlatform) == true)
|
|
{
|
|
return BuildPlatformDictionary[InPlatform];
|
|
}
|
|
if (bInAllowFailure == true)
|
|
{
|
|
return null;
|
|
}
|
|
throw new BuildException("GetBuildPlatform: No BuildPlatform found for {0}", InPlatform.ToString());
|
|
}
|
|
|
|
/// <summary>
|
|
/// Retrieve the IUEBuildPlatform instance for the given CPPTargetPlatform
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The CPPTargetPlatform being built</param>
|
|
/// <param name="bInAllowFailure"> If true, do not throw an exception and return null</param>
|
|
/// <returns>UEBuildPlatform The instance of the build platform</returns>
|
|
public static UEBuildPlatform GetBuildPlatformForCPPTargetPlatform(CPPTargetPlatform InPlatform, bool bInAllowFailure = false)
|
|
{
|
|
UnrealTargetPlatform UTPlatform = UEBuildTarget.CPPTargetPlatformToUnrealTargetPlatform(InPlatform);
|
|
if (BuildPlatformDictionary.ContainsKey(UTPlatform) == true)
|
|
{
|
|
return BuildPlatformDictionary[UTPlatform];
|
|
}
|
|
if (bInAllowFailure == true)
|
|
{
|
|
return null;
|
|
}
|
|
throw new BuildException("UEBuildPlatform::GetBuildPlatformForCPPTargetPlatform: No BuildPlatform found for {0}", InPlatform.ToString());
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allow all registered build platforms to modify the newly created module
|
|
/// passed in for the given platform.
|
|
/// This is not required - but allows for hiding details of a particular platform.
|
|
/// </summary>
|
|
/// <param name="">Name The name of the module</param>
|
|
/// <param name="Module"> The module rules</param>
|
|
/// <param name="Target"> The target being build</param>
|
|
/// <param name="Only"> If this is not unknown, then only run that platform</param>
|
|
public static void PlatformModifyHostModuleRules(string ModuleName, ModuleRules Rules, TargetInfo Target, UnrealTargetPlatform Only = UnrealTargetPlatform.Unknown)
|
|
{
|
|
foreach (KeyValuePair<UnrealTargetPlatform, UEBuildPlatform> PlatformEntry in BuildPlatformDictionary)
|
|
{
|
|
if (Only == UnrealTargetPlatform.Unknown || PlatformEntry.Key == Only)
|
|
{
|
|
PlatformEntry.Value.ModifyModuleRulesForOtherPlatform(ModuleName, Rules, Target);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns the delimiter used to separate paths in the PATH environment variable for the platform we are executing on.
|
|
/// </summary>
|
|
public static String GetPathVarDelimiter()
|
|
{
|
|
switch (BuildHostPlatform.Current.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Linux:
|
|
case UnrealTargetPlatform.Mac:
|
|
return ":";
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
return ";";
|
|
default:
|
|
Log.TraceWarning("PATH var delimiter unknown for platform " + BuildHostPlatform.Current.Platform.ToString() + " using ';'");
|
|
return ";";
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns the name that should be returned in the output when doing -validateplatforms
|
|
/// </summary>
|
|
public virtual string GetPlatformValidationName()
|
|
{
|
|
return Platform.ToString();
|
|
}
|
|
|
|
/// <summary>
|
|
/// If this platform can be compiled with XGE
|
|
/// </summary>
|
|
public virtual bool CanUseXGE()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// If this platform can be compiled with DMUCS/Distcc
|
|
/// </summary>
|
|
public virtual bool CanUseDistcc()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// If this platform can be compiled with SN-DBS
|
|
/// </summary>
|
|
public virtual bool CanUseSNDBS()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return whether the given platform requires a monolithic build
|
|
/// </summary>
|
|
/// <param name="InPlatform">The platform of interest</param>
|
|
/// <param name="InConfiguration">The configuration of interest</param>
|
|
/// <returns></returns>
|
|
public static bool PlatformRequiresMonolithicBuilds(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration)
|
|
{
|
|
// Some platforms require monolithic builds...
|
|
UEBuildPlatform BuildPlatform = GetBuildPlatform(InPlatform, true);
|
|
if (BuildPlatform != null)
|
|
{
|
|
return BuildPlatform.ShouldCompileMonolithicBinary(InPlatform);
|
|
}
|
|
|
|
// We assume it does not
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the extension to use for the given binary type
|
|
/// </summary>
|
|
/// <param name="InBinaryType"> The binary type being built</param>
|
|
/// <returns>string The binary extension (i.e. 'exe' or 'dll')</returns>
|
|
public virtual string GetBinaryExtension(UEBuildBinaryType InBinaryType)
|
|
{
|
|
throw new BuildException("GetBinaryExtensiton for {0} not handled in {1}", InBinaryType.ToString(), this.ToString());
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the extension to use for debug info for the given binary type
|
|
/// </summary>
|
|
/// <param name="InBinaryType"> The binary type being built</param>
|
|
/// <returns>string The debug info extension (i.e. 'pdb')</returns>
|
|
public virtual string GetDebugInfoExtension(UEBuildBinaryType InBinaryType)
|
|
{
|
|
throw new BuildException("GetDebugInfoExtension for {0} not handled in {1}", InBinaryType.ToString(), this.ToString());
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether incremental linking should be used
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The CPPTargetPlatform being built</param>
|
|
/// <param name="InConfiguration"> The CPPTargetConfiguration being built</param>
|
|
/// <returns>bool true if incremental linking should be used, false if not</returns>
|
|
public virtual bool ShouldUseIncrementalLinking(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether PDB files should be used
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The CPPTargetPlatform being built</param>
|
|
/// <param name="InConfiguration"> The CPPTargetConfiguration being built</param>
|
|
/// <param name="bInCreateDebugInfo">true if debug info is getting create, false if not</param>
|
|
/// <returns>bool true if PDB files should be used, false if not</returns>
|
|
public virtual bool ShouldUsePDBFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, bool bCreateDebugInfo)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether PCH files should be used
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The CPPTargetPlatform being built</param>
|
|
/// <param name="InConfiguration"> The CPPTargetConfiguration being built</param>
|
|
/// <returns>bool true if PCH files should be used, false if not</returns>
|
|
public virtual bool ShouldUsePCHFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration)
|
|
{
|
|
return BuildConfiguration.bUsePCHFiles;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether the editor should be built for this platform or not
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The UnrealTargetPlatform being built</param>
|
|
/// <param name="InConfiguration">The UnrealTargetConfiguration being built</param>
|
|
/// <returns>bool true if the editor should be built, false if not</returns>
|
|
public virtual bool ShouldNotBuildEditor(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether this build should support ONLY cooked data or not
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The UnrealTargetPlatform being built</param>
|
|
/// <param name="InConfiguration">The UnrealTargetConfiguration being built</param>
|
|
/// <returns>bool true if the editor should be built, false if not</returns>
|
|
public virtual bool BuildRequiresCookedData(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether the platform requires the extra UnityCPPWriter
|
|
/// This is used to add an extra file for UBT to get the #include dependencies from
|
|
/// </summary>
|
|
/// <returns>bool true if it is required, false if not</returns>
|
|
public virtual bool RequiresExtraUnityCPPWriter()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether this platform should build a monolithic binary
|
|
/// </summary>
|
|
public virtual bool ShouldCompileMonolithicBinary(UnrealTargetPlatform InPlatform)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Modify the rules for a newly created module, where the target is a different host platform.
|
|
/// This is not required - but allows for hiding details of a particular platform.
|
|
/// </summary>
|
|
/// <param name="ModuleName">The name of the module</param>
|
|
/// <param name="Rules">The module rules</param>
|
|
/// <param name="Target">The target being build</param>
|
|
public virtual void ModifyModuleRulesForOtherPlatform(string ModuleName, ModuleRules Rules, TargetInfo Target)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allow the platform to override the NMake output name
|
|
/// </summary>
|
|
public virtual FileReference ModifyNMakeOutput(FileReference ExeName)
|
|
{
|
|
// by default, use original
|
|
return ExeName;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allows the platform to override whether the architecture name should be appended to the name of binaries.
|
|
/// </summary>
|
|
/// <returns>True if the architecture name should be appended to the binary</returns>
|
|
public virtual bool RequiresArchitectureSuffix()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// For platforms that need to output multiple files per binary (ie Android "fat" binaries)
|
|
/// this will emit multiple paths. By default, it simply makes an array from the input
|
|
/// </summary>
|
|
public virtual List<FileReference> FinalizeBinaryPaths(FileReference BinaryName, FileReference ProjectFile)
|
|
{
|
|
List<FileReference> TempList = new List<FileReference>() { BinaryName };
|
|
return TempList;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return whether this platform has uniquely named binaries across multiple games
|
|
/// </summary>
|
|
public virtual bool HasUniqueBinaries()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return whether we wish to have this platform's binaries in our builds
|
|
/// </summary>
|
|
public virtual bool IsBuildRequired()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return whether we wish to have this platform's binaries in our CIS tests
|
|
/// </summary>
|
|
public virtual bool IsCISRequired()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether the build platform requires deployment prep
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public virtual bool RequiresDeployPrepAfterCompile()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return all valid configurations for this platform
|
|
/// Typically, this is always Debug, Development, and Shipping - but Test is a likely future addition for some platforms
|
|
/// </summary>
|
|
public virtual List<UnrealTargetConfiguration> GetConfigurations(UnrealTargetPlatform InUnrealTargetPlatform, bool bIncludeDebug)
|
|
{
|
|
List<UnrealTargetConfiguration> Configurations = new List<UnrealTargetConfiguration>()
|
|
{
|
|
UnrealTargetConfiguration.Development,
|
|
};
|
|
|
|
if (bIncludeDebug)
|
|
{
|
|
Configurations.Insert(0, UnrealTargetConfiguration.Debug);
|
|
}
|
|
|
|
return Configurations;
|
|
}
|
|
|
|
protected static bool DoProjectSettingsMatchDefault(UnrealTargetPlatform Platform, DirectoryReference ProjectDirectoryName, string Section, string[] BoolKeys, string[] IntKeys, string[] StringKeys)
|
|
{
|
|
ConfigCacheIni ProjIni = ConfigCacheIni.CreateConfigCacheIni(Platform, "Engine", ProjectDirectoryName);
|
|
ConfigCacheIni DefaultIni = ConfigCacheIni.CreateConfigCacheIni(Platform, "Engine", (DirectoryReference)null);
|
|
|
|
// look at all bool values
|
|
if (BoolKeys != null) foreach (string Key in BoolKeys)
|
|
{
|
|
bool Default = false, Project = false;
|
|
DefaultIni.GetBool(Section, Key, out Default);
|
|
ProjIni.GetBool(Section, Key, out Project);
|
|
if (Default != Project)
|
|
{
|
|
Console.WriteLine(Key + " is not set to default. (" + Default + " vs. " + Project + ")");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// look at all int values
|
|
if (IntKeys != null) foreach (string Key in IntKeys)
|
|
{
|
|
int Default = 0, Project = 0;
|
|
DefaultIni.GetInt32(Section, Key, out Default);
|
|
ProjIni.GetInt32(Section, Key, out Project);
|
|
if (Default != Project)
|
|
{
|
|
Console.WriteLine(Key + " is not set to default. (" + Default + " vs. " + Project + ")");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// look for all string values
|
|
if (StringKeys != null) foreach (string Key in StringKeys)
|
|
{
|
|
string Default = "", Project = "";
|
|
DefaultIni.GetString(Section, Key, out Default);
|
|
ProjIni.GetString(Section, Key, out Project);
|
|
if (Default != Project)
|
|
{
|
|
Console.WriteLine(Key + " is not set to default. (" + Default + " vs. " + Project + ")");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// if we get here, we match all important settings
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Check for the default configuration
|
|
/// return true if the project uses the default build config
|
|
/// </summary>
|
|
public virtual bool HasDefaultBuildConfig(UnrealTargetPlatform Platform, DirectoryReference ProjectDirectoryName)
|
|
{
|
|
string[] BoolKeys = new string[] {
|
|
"bCompileApex", "bCompileBox2D", "bCompileICU", "bCompileSimplygon", "bCompileSimplygonSSF",
|
|
"bCompileLeanAndMeanUE", "bIncludeADO", "bCompileRecast", "bCompileSpeedTree",
|
|
"bCompileWithPluginSupport", "bCompilePhysXVehicle", "bCompileFreeType",
|
|
"bCompileForSize", "bCompileCEF3"
|
|
};
|
|
|
|
return DoProjectSettingsMatchDefault(Platform, ProjectDirectoryName, "/Script/BuildSettings.BuildSettings",
|
|
BoolKeys, null, null);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates a context for the given project on the current platform.
|
|
/// </summary>
|
|
/// <param name="ProjectFile">The project file for the current target</param>
|
|
/// <returns>New platform context object</returns>
|
|
public abstract UEBuildPlatformContext CreateContext(FileReference ProjectFile);
|
|
}
|
|
|
|
public abstract class UEBuildPlatformSDK
|
|
{
|
|
// AutoSDKs handling portion
|
|
|
|
#region protected AutoSDKs Utility
|
|
|
|
/// <summary>
|
|
/// Name of the file that holds currently install SDK version string
|
|
/// </summary>
|
|
protected static string CurrentlyInstalledSDKStringManifest = "CurrentlyInstalled.txt";
|
|
|
|
/// <summary>
|
|
/// name of the file that holds the last succesfully run SDK setup script version
|
|
/// </summary>
|
|
protected static string LastRunScriptVersionManifest = "CurrentlyInstalled.Version.txt";
|
|
|
|
/// <summary>
|
|
/// Name of the file that holds environment variables of current SDK
|
|
/// </summary>
|
|
protected static string SDKEnvironmentVarsFile = "OutputEnvVars.txt";
|
|
|
|
protected static readonly string SDKRootEnvVar = "UE_SDKS_ROOT";
|
|
|
|
protected static string AutoSetupEnvVar = "AutoSDKSetup";
|
|
|
|
public static bool bShouldLogInfo = false;
|
|
|
|
/// <summary>
|
|
/// Whether platform supports switching SDKs during runtime
|
|
/// </summary>
|
|
/// <returns>true if supports</returns>
|
|
protected virtual bool PlatformSupportsAutoSDKs()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static private bool bCheckedAutoSDKRootEnvVar = false;
|
|
static private bool bAutoSDKSystemEnabled = false;
|
|
static private bool HasAutoSDKSystemEnabled()
|
|
{
|
|
if (!bCheckedAutoSDKRootEnvVar)
|
|
{
|
|
string SDKRoot = Environment.GetEnvironmentVariable(SDKRootEnvVar);
|
|
if (SDKRoot != null)
|
|
{
|
|
bAutoSDKSystemEnabled = true;
|
|
}
|
|
bCheckedAutoSDKRootEnvVar = true;
|
|
}
|
|
return bAutoSDKSystemEnabled;
|
|
}
|
|
|
|
// Whether AutoSDK setup is safe. AutoSDKs will damage manual installs on some platforms.
|
|
protected bool IsAutoSDKSafe()
|
|
{
|
|
return !IsAutoSDKDestructive() || !HasAnyManualInstall();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns SDK string as required by the platform
|
|
/// </summary>
|
|
/// <returns>Valid SDK string</returns>
|
|
protected virtual string GetRequiredSDKString()
|
|
{
|
|
return "";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the version number of the SDK setup script itself. The version in the base should ALWAYS be the master revision from the last refactor.
|
|
/// If you need to force a rebuild for a given platform, override this for the given platform.
|
|
/// </summary>
|
|
/// <returns>Setup script version</returns>
|
|
protected virtual String GetRequiredScriptVersionString()
|
|
{
|
|
return "3.0";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns path to platform SDKs
|
|
/// </summary>
|
|
/// <returns>Valid SDK string</returns>
|
|
protected string GetPathToPlatformAutoSDKs()
|
|
{
|
|
string SDKPath = "";
|
|
string SDKRoot = Environment.GetEnvironmentVariable(SDKRootEnvVar);
|
|
if (SDKRoot != null)
|
|
{
|
|
if (SDKRoot != "")
|
|
{
|
|
SDKPath = Path.Combine(SDKRoot, "Host" + BuildHostPlatform.Current.Platform, GetSDKTargetPlatformName());
|
|
}
|
|
}
|
|
return SDKPath;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Because most ManualSDK determination depends on reading env vars, if this process is spawned by a process that ALREADY set up
|
|
/// AutoSDKs then all the SDK env vars will exist, and we will spuriously detect a Manual SDK. (children inherit the environment of the parent process).
|
|
/// Therefore we write out an env var to set in the command file (OutputEnvVars.txt) such that child processes can determine if their manual SDK detection
|
|
/// is bogus. Make it platform specific so that platforms can be in different states.
|
|
/// </summary>
|
|
protected string GetPlatformAutoSDKSetupEnvVar()
|
|
{
|
|
return GetSDKTargetPlatformName() + AutoSetupEnvVar;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets currently installed version
|
|
/// </summary>
|
|
/// <param name="PlatformSDKRoot">absolute path to platform SDK root</param>
|
|
/// <param name="OutInstalledSDKVersionString">version string as currently installed</param>
|
|
/// <returns>true if was able to read it</returns>
|
|
protected bool GetCurrentlyInstalledSDKString(string PlatformSDKRoot, out string OutInstalledSDKVersionString)
|
|
{
|
|
if (Directory.Exists(PlatformSDKRoot))
|
|
{
|
|
string VersionFilename = Path.Combine(PlatformSDKRoot, CurrentlyInstalledSDKStringManifest);
|
|
if (File.Exists(VersionFilename))
|
|
{
|
|
using (StreamReader Reader = new StreamReader(VersionFilename))
|
|
{
|
|
string Version = Reader.ReadLine();
|
|
string Type = Reader.ReadLine();
|
|
|
|
// don't allow ManualSDK installs to count as an AutoSDK install version.
|
|
if (Type != null && Type == "AutoSDK")
|
|
{
|
|
if (Version != null)
|
|
{
|
|
OutInstalledSDKVersionString = Version;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
OutInstalledSDKVersionString = "";
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the version of the last successfully run setup script.
|
|
/// </summary>
|
|
/// <param name="PlatformSDKRoot">absolute path to platform SDK root</param>
|
|
/// <param name="OutLastRunScriptVersion">version string</param>
|
|
/// <returns>true if was able to read it</returns>
|
|
protected bool GetLastRunScriptVersionString(string PlatformSDKRoot, out string OutLastRunScriptVersion)
|
|
{
|
|
if (Directory.Exists(PlatformSDKRoot))
|
|
{
|
|
string VersionFilename = Path.Combine(PlatformSDKRoot, LastRunScriptVersionManifest);
|
|
if (File.Exists(VersionFilename))
|
|
{
|
|
using (StreamReader Reader = new StreamReader(VersionFilename))
|
|
{
|
|
string Version = Reader.ReadLine();
|
|
if (Version != null)
|
|
{
|
|
OutLastRunScriptVersion = Version;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
OutLastRunScriptVersion = "";
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sets currently installed version
|
|
/// </summary>
|
|
/// <param name="PlatformSDKRoot">absolute path to platform SDK root</param>
|
|
/// <param name="InstalledSDKVersionString">SDK version string to set</param>
|
|
/// <returns>true if was able to set it</returns>
|
|
protected bool SetCurrentlyInstalledAutoSDKString(String InstalledSDKVersionString)
|
|
{
|
|
String PlatformSDKRoot = GetPathToPlatformAutoSDKs();
|
|
if (Directory.Exists(PlatformSDKRoot))
|
|
{
|
|
string VersionFilename = Path.Combine(PlatformSDKRoot, CurrentlyInstalledSDKStringManifest);
|
|
if (File.Exists(VersionFilename))
|
|
{
|
|
File.Delete(VersionFilename);
|
|
}
|
|
|
|
using (StreamWriter Writer = File.CreateText(VersionFilename))
|
|
{
|
|
Writer.WriteLine(InstalledSDKVersionString);
|
|
Writer.WriteLine("AutoSDK");
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
protected void SetupManualSDK()
|
|
{
|
|
if (PlatformSupportsAutoSDKs() && HasAutoSDKSystemEnabled())
|
|
{
|
|
String InstalledSDKVersionString = GetRequiredSDKString();
|
|
String PlatformSDKRoot = GetPathToPlatformAutoSDKs();
|
|
if (!Directory.Exists(PlatformSDKRoot))
|
|
{
|
|
Directory.CreateDirectory(PlatformSDKRoot);
|
|
}
|
|
|
|
{
|
|
string VersionFilename = Path.Combine(PlatformSDKRoot, CurrentlyInstalledSDKStringManifest);
|
|
if (File.Exists(VersionFilename))
|
|
{
|
|
File.Delete(VersionFilename);
|
|
}
|
|
|
|
string EnvVarFile = Path.Combine(PlatformSDKRoot, SDKEnvironmentVarsFile);
|
|
if (File.Exists(EnvVarFile))
|
|
{
|
|
File.Delete(EnvVarFile);
|
|
}
|
|
|
|
using (StreamWriter Writer = File.CreateText(VersionFilename))
|
|
{
|
|
Writer.WriteLine(InstalledSDKVersionString);
|
|
Writer.WriteLine("ManualSDK");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
protected bool SetLastRunAutoSDKScriptVersion(string LastRunScriptVersion)
|
|
{
|
|
String PlatformSDKRoot = GetPathToPlatformAutoSDKs();
|
|
if (Directory.Exists(PlatformSDKRoot))
|
|
{
|
|
string VersionFilename = Path.Combine(PlatformSDKRoot, LastRunScriptVersionManifest);
|
|
if (File.Exists(VersionFilename))
|
|
{
|
|
File.Delete(VersionFilename);
|
|
}
|
|
|
|
using (StreamWriter Writer = File.CreateText(VersionFilename))
|
|
{
|
|
Writer.WriteLine(LastRunScriptVersion);
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns Hook names as needed by the platform
|
|
/// (e.g. can be overridden with custom executables or scripts)
|
|
/// </summary>
|
|
/// <param name="Hook">Hook type</param>
|
|
protected virtual string GetHookExecutableName(SDKHookType Hook)
|
|
{
|
|
if (Hook == SDKHookType.Uninstall)
|
|
{
|
|
return "unsetup.bat";
|
|
}
|
|
|
|
return "setup.bat";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Runs install/uninstall hooks for SDK
|
|
/// </summary>
|
|
/// <param name="PlatformSDKRoot">absolute path to platform SDK root</param>
|
|
/// <param name="SDKVersionString">version string to run for (can be empty!)</param>
|
|
/// <param name="Hook">which one of hooks to run</param>
|
|
/// <param name="bHookCanBeNonExistent">whether a non-existing hook means failure</param>
|
|
/// <returns>true if succeeded</returns>
|
|
protected virtual bool RunAutoSDKHooks(string PlatformSDKRoot, string SDKVersionString, SDKHookType Hook, bool bHookCanBeNonExistent = true)
|
|
{
|
|
if (!IsAutoSDKSafe())
|
|
{
|
|
Console.ForegroundColor = ConsoleColor.Red;
|
|
LogAutoSDK(GetSDKTargetPlatformName() + " attempted to run SDK hook which could have damaged manual SDK install!");
|
|
Console.ResetColor();
|
|
|
|
return false;
|
|
}
|
|
if (SDKVersionString != "")
|
|
{
|
|
string SDKDirectory = Path.Combine(PlatformSDKRoot, SDKVersionString);
|
|
string HookExe = Path.Combine(SDKDirectory, GetHookExecutableName(Hook));
|
|
|
|
if (File.Exists(HookExe))
|
|
{
|
|
LogAutoSDK("Running {0} hook {1}", Hook, HookExe);
|
|
|
|
// run it
|
|
Process HookProcess = new Process();
|
|
HookProcess.StartInfo.WorkingDirectory = SDKDirectory;
|
|
HookProcess.StartInfo.FileName = HookExe;
|
|
HookProcess.StartInfo.Arguments = "";
|
|
HookProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
|
|
|
// seems to break the build machines?
|
|
//HookProcess.StartInfo.UseShellExecute = false;
|
|
//HookProcess.StartInfo.RedirectStandardOutput = true;
|
|
//HookProcess.StartInfo.RedirectStandardError = true;
|
|
|
|
using (ScopedTimer HookTimer = new ScopedTimer("Time to run hook: ", bShouldLogInfo ? LogEventType.Log : LogEventType.Verbose))
|
|
{
|
|
//installers may require administrator access to succeed. so run as an admmin.
|
|
HookProcess.StartInfo.Verb = "runas";
|
|
HookProcess.Start();
|
|
HookProcess.WaitForExit();
|
|
}
|
|
|
|
//LogAutoSDK(HookProcess.StandardOutput.ReadToEnd());
|
|
//LogAutoSDK(HookProcess.StandardError.ReadToEnd());
|
|
if (HookProcess.ExitCode != 0)
|
|
{
|
|
LogAutoSDK("Hook exited uncleanly (returned {0}), considering it failed.", HookProcess.ExitCode);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
LogAutoSDK("File {0} does not exist", HookExe);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
LogAutoSDK("Version string is blank for {0}. Can't determine {1} hook.", PlatformSDKRoot, Hook.ToString());
|
|
}
|
|
|
|
return bHookCanBeNonExistent;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Loads environment variables from SDK
|
|
/// If any commands are added or removed the handling needs to be duplicated in
|
|
/// TargetPlatformManagerModule.cpp
|
|
/// </summary>
|
|
/// <param name="PlatformSDKRoot">absolute path to platform SDK</param>
|
|
/// <returns>true if succeeded</returns>
|
|
protected bool SetupEnvironmentFromAutoSDK(string PlatformSDKRoot)
|
|
{
|
|
string EnvVarFile = Path.Combine(PlatformSDKRoot, SDKEnvironmentVarsFile);
|
|
if (File.Exists(EnvVarFile))
|
|
{
|
|
using (StreamReader Reader = new StreamReader(EnvVarFile))
|
|
{
|
|
List<string> PathAdds = new List<string>();
|
|
List<string> PathRemoves = new List<string>();
|
|
|
|
List<string> EnvVarNames = new List<string>();
|
|
List<string> EnvVarValues = new List<string>();
|
|
|
|
bool bNeedsToWriteAutoSetupEnvVar = true;
|
|
String PlatformSetupEnvVar = GetPlatformAutoSDKSetupEnvVar();
|
|
for (; ; )
|
|
{
|
|
string VariableString = Reader.ReadLine();
|
|
if (VariableString == null)
|
|
{
|
|
break;
|
|
}
|
|
|
|
string[] Parts = VariableString.Split('=');
|
|
if (Parts.Length != 2)
|
|
{
|
|
LogAutoSDK("Incorrect environment variable declaration:");
|
|
LogAutoSDK(VariableString);
|
|
return false;
|
|
}
|
|
|
|
if (String.Compare(Parts[0], "strippath", true) == 0)
|
|
{
|
|
PathRemoves.Add(Parts[1]);
|
|
}
|
|
else if (String.Compare(Parts[0], "addpath", true) == 0)
|
|
{
|
|
PathAdds.Add(Parts[1]);
|
|
}
|
|
else
|
|
{
|
|
if (String.Compare(Parts[0], PlatformSetupEnvVar) == 0)
|
|
{
|
|
bNeedsToWriteAutoSetupEnvVar = false;
|
|
}
|
|
// convenience for setup.bat writers. Trim any accidental whitespace from var names/values.
|
|
EnvVarNames.Add(Parts[0].Trim());
|
|
EnvVarValues.Add(Parts[1].Trim());
|
|
}
|
|
}
|
|
|
|
// don't actually set anything until we successfully validate and read all values in.
|
|
// we don't want to set a few vars, return a failure, and then have a platform try to
|
|
// build against a manually installed SDK with half-set env vars.
|
|
for (int i = 0; i < EnvVarNames.Count; ++i)
|
|
{
|
|
string EnvVarName = EnvVarNames[i];
|
|
string EnvVarValue = EnvVarValues[i];
|
|
if (BuildConfiguration.bPrintDebugInfo)
|
|
{
|
|
LogAutoSDK("Setting variable '{0}' to '{1}'", EnvVarName, EnvVarValue);
|
|
}
|
|
Environment.SetEnvironmentVariable(EnvVarName, EnvVarValue);
|
|
}
|
|
|
|
|
|
// actually perform the PATH stripping / adding.
|
|
String OrigPathVar = Environment.GetEnvironmentVariable("PATH");
|
|
String PathDelimiter = UEBuildPlatform.GetPathVarDelimiter();
|
|
String[] PathVars = { };
|
|
if (!String.IsNullOrEmpty(OrigPathVar))
|
|
{
|
|
PathVars = OrigPathVar.Split(PathDelimiter.ToCharArray());
|
|
}
|
|
else
|
|
{
|
|
LogAutoSDK("Path environment variable is null during AutoSDK");
|
|
}
|
|
|
|
List<String> ModifiedPathVars = new List<string>();
|
|
ModifiedPathVars.AddRange(PathVars);
|
|
|
|
// perform removes first, in case they overlap with any adds.
|
|
foreach (String PathRemove in PathRemoves)
|
|
{
|
|
foreach (String PathVar in PathVars)
|
|
{
|
|
if (PathVar.IndexOf(PathRemove, StringComparison.OrdinalIgnoreCase) >= 0)
|
|
{
|
|
LogAutoSDK("Removing Path: '{0}'", PathVar);
|
|
ModifiedPathVars.Remove(PathVar);
|
|
}
|
|
}
|
|
}
|
|
|
|
// remove all the of ADDs so that if this function is executed multiple times, the paths will be guaranteed to be in the same order after each run.
|
|
// If we did not do this, a 'remove' that matched some, but not all, of our 'adds' would cause the order to change.
|
|
foreach (String PathAdd in PathAdds)
|
|
{
|
|
foreach (String PathVar in PathVars)
|
|
{
|
|
if (String.Compare(PathAdd, PathVar, true) == 0)
|
|
{
|
|
LogAutoSDK("Removing Path: '{0}'", PathVar);
|
|
ModifiedPathVars.Remove(PathVar);
|
|
}
|
|
}
|
|
}
|
|
|
|
// perform adds, but don't add duplicates
|
|
foreach (String PathAdd in PathAdds)
|
|
{
|
|
if (!ModifiedPathVars.Contains(PathAdd))
|
|
{
|
|
LogAutoSDK("Adding Path: '{0}'", PathAdd);
|
|
ModifiedPathVars.Add(PathAdd);
|
|
}
|
|
}
|
|
|
|
String ModifiedPath = String.Join(PathDelimiter, ModifiedPathVars);
|
|
Environment.SetEnvironmentVariable("PATH", ModifiedPath);
|
|
|
|
Reader.Close();
|
|
|
|
// write out env var command so any process using this commandfile will mark itself as having had autosdks set up.
|
|
// avoids child processes spuriously detecting manualsdks.
|
|
if (bNeedsToWriteAutoSetupEnvVar)
|
|
{
|
|
using (StreamWriter Writer = File.AppendText(EnvVarFile))
|
|
{
|
|
Writer.WriteLine("{0}=1", PlatformSetupEnvVar);
|
|
}
|
|
// set the var in the local environment in case this process spawns any others.
|
|
Environment.SetEnvironmentVariable(PlatformSetupEnvVar, "1");
|
|
}
|
|
|
|
// make sure we know that we've modified the local environment, invalidating manual installs for this run.
|
|
bLocalProcessSetupAutoSDK = true;
|
|
|
|
return true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
LogAutoSDK("Cannot set up environment for {1} because command file {1} does not exist.", PlatformSDKRoot, EnvVarFile);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
protected void InvalidateCurrentlyInstalledAutoSDK()
|
|
{
|
|
String PlatformSDKRoot = GetPathToPlatformAutoSDKs();
|
|
if (Directory.Exists(PlatformSDKRoot))
|
|
{
|
|
string SDKFilename = Path.Combine(PlatformSDKRoot, CurrentlyInstalledSDKStringManifest);
|
|
if (File.Exists(SDKFilename))
|
|
{
|
|
File.Delete(SDKFilename);
|
|
}
|
|
|
|
string VersionFilename = Path.Combine(PlatformSDKRoot, LastRunScriptVersionManifest);
|
|
if (File.Exists(VersionFilename))
|
|
{
|
|
File.Delete(VersionFilename);
|
|
}
|
|
|
|
string EnvVarFile = Path.Combine(PlatformSDKRoot, SDKEnvironmentVarsFile);
|
|
if (File.Exists(EnvVarFile))
|
|
{
|
|
File.Delete(EnvVarFile);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Currently installed AutoSDK is written out to a text file in a known location.
|
|
/// This function just compares the file's contents with the current requirements.
|
|
/// </summary>
|
|
protected SDKStatus HasRequiredAutoSDKInstalled()
|
|
{
|
|
if (PlatformSupportsAutoSDKs() && HasAutoSDKSystemEnabled())
|
|
{
|
|
string AutoSDKRoot = GetPathToPlatformAutoSDKs();
|
|
if (AutoSDKRoot != "")
|
|
{
|
|
// check script version so script fixes can be propagated without touching every build machine's CurrentlyInstalled file manually.
|
|
bool bScriptVersionMatches = false;
|
|
string CurrentScriptVersionString;
|
|
if (GetLastRunScriptVersionString(AutoSDKRoot, out CurrentScriptVersionString) && CurrentScriptVersionString == GetRequiredScriptVersionString())
|
|
{
|
|
bScriptVersionMatches = true;
|
|
}
|
|
|
|
// check to make sure OutputEnvVars doesn't need regenerating
|
|
string EnvVarFile = Path.Combine(AutoSDKRoot, SDKEnvironmentVarsFile);
|
|
bool bEnvVarFileExists = File.Exists(EnvVarFile);
|
|
|
|
string CurrentSDKString;
|
|
if (bEnvVarFileExists && GetCurrentlyInstalledSDKString(AutoSDKRoot, out CurrentSDKString) && CurrentSDKString == GetRequiredSDKString() && bScriptVersionMatches)
|
|
{
|
|
return SDKStatus.Valid;
|
|
}
|
|
return SDKStatus.Invalid;
|
|
}
|
|
}
|
|
return SDKStatus.Invalid;
|
|
}
|
|
|
|
// This tracks if we have already checked the sdk installation.
|
|
private Int32 SDKCheckStatus = -1;
|
|
|
|
// true if we've ever overridden the process's environment with AutoSDK data. After that, manual installs cannot be considered valid ever again.
|
|
private bool bLocalProcessSetupAutoSDK = false;
|
|
|
|
protected bool HasSetupAutoSDK()
|
|
{
|
|
return bLocalProcessSetupAutoSDK || HasParentProcessSetupAutoSDK();
|
|
}
|
|
|
|
protected bool HasParentProcessSetupAutoSDK()
|
|
{
|
|
bool bParentProcessSetupAutoSDK = false;
|
|
String AutoSDKSetupVarName = GetPlatformAutoSDKSetupEnvVar();
|
|
String AutoSDKSetupVar = Environment.GetEnvironmentVariable(AutoSDKSetupVarName);
|
|
if (!String.IsNullOrEmpty(AutoSDKSetupVar))
|
|
{
|
|
bParentProcessSetupAutoSDK = true;
|
|
}
|
|
return bParentProcessSetupAutoSDK;
|
|
}
|
|
|
|
protected SDKStatus HasRequiredManualSDK()
|
|
{
|
|
if (HasSetupAutoSDK())
|
|
{
|
|
return SDKStatus.Invalid;
|
|
}
|
|
|
|
// manual installs are always invalid if we have modified the process's environment for AutoSDKs
|
|
return HasRequiredManualSDKInternal();
|
|
}
|
|
|
|
// for platforms with destructive AutoSDK. Report if any manual sdk is installed that may be damaged by an autosdk.
|
|
protected virtual bool HasAnyManualInstall()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
// tells us if the user has a valid manual install.
|
|
protected abstract SDKStatus HasRequiredManualSDKInternal();
|
|
|
|
// some platforms will fail if there is a manual install that is the WRONG manual install.
|
|
protected virtual bool AllowInvalidManualInstall()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// platforms can choose if they prefer a correct the the AutoSDK install over the manual install.
|
|
protected virtual bool PreferAutoSDK()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// some platforms don't support parallel SDK installs. AutoSDK on these platforms will
|
|
// actively damage an existing manual install by overwriting files in it. AutoSDK must NOT
|
|
// run any setup if a manual install exists in this case.
|
|
protected virtual bool IsAutoSDKDestructive()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Runs batch files if necessary to set up required AutoSDK.
|
|
/// AutoSDKs are SDKs that have not been setup through a formal installer, but rather come from
|
|
/// a source control directory, or other local copy.
|
|
/// </summary>
|
|
private void SetupAutoSDK()
|
|
{
|
|
if (IsAutoSDKSafe() && PlatformSupportsAutoSDKs() && HasAutoSDKSystemEnabled())
|
|
{
|
|
// run installation for autosdk if necessary.
|
|
if (HasRequiredAutoSDKInstalled() == SDKStatus.Invalid)
|
|
{
|
|
//reset check status so any checking sdk status after the attempted setup will do a real check again.
|
|
SDKCheckStatus = -1;
|
|
|
|
string AutoSDKRoot = GetPathToPlatformAutoSDKs();
|
|
string CurrentSDKString;
|
|
GetCurrentlyInstalledSDKString(AutoSDKRoot, out CurrentSDKString);
|
|
|
|
// switch over (note that version string can be empty)
|
|
if (!RunAutoSDKHooks(AutoSDKRoot, CurrentSDKString, SDKHookType.Uninstall))
|
|
{
|
|
LogAutoSDK("Failed to uninstall currently installed SDK {0}", CurrentSDKString);
|
|
InvalidateCurrentlyInstalledAutoSDK();
|
|
return;
|
|
}
|
|
// delete Manifest file to avoid multiple uninstalls
|
|
InvalidateCurrentlyInstalledAutoSDK();
|
|
|
|
if (!RunAutoSDKHooks(AutoSDKRoot, GetRequiredSDKString(), SDKHookType.Install, false))
|
|
{
|
|
LogAutoSDK("Failed to install required SDK {0}. Attemping to uninstall", GetRequiredSDKString());
|
|
RunAutoSDKHooks(AutoSDKRoot, GetRequiredSDKString(), SDKHookType.Uninstall, false);
|
|
return;
|
|
}
|
|
|
|
string EnvVarFile = Path.Combine(AutoSDKRoot, SDKEnvironmentVarsFile);
|
|
if (!File.Exists(EnvVarFile))
|
|
{
|
|
LogAutoSDK("Installation of required SDK {0}. Did not generate Environment file {1}", GetRequiredSDKString(), EnvVarFile);
|
|
RunAutoSDKHooks(AutoSDKRoot, GetRequiredSDKString(), SDKHookType.Uninstall, false);
|
|
return;
|
|
}
|
|
|
|
SetCurrentlyInstalledAutoSDKString(GetRequiredSDKString());
|
|
SetLastRunAutoSDKScriptVersion(GetRequiredScriptVersionString());
|
|
}
|
|
|
|
// fixup process environment to match autosdk
|
|
SetupEnvironmentFromAutoSDK();
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region public AutoSDKs Utility
|
|
|
|
/// <summary>
|
|
/// Enum describing types of hooks a platform SDK can have
|
|
/// </summary>
|
|
public enum SDKHookType
|
|
{
|
|
Install,
|
|
Uninstall
|
|
};
|
|
|
|
/// <summary>
|
|
/// Returns platform-specific name used in SDK repository
|
|
/// </summary>
|
|
/// <returns>path to SDK Repository</returns>
|
|
public virtual string GetSDKTargetPlatformName()
|
|
{
|
|
return "";
|
|
}
|
|
|
|
/* Whether or not we should try to automatically switch SDKs when asked to validate the platform's SDK state. */
|
|
public static bool bAllowAutoSDKSwitching = true;
|
|
|
|
public SDKStatus SetupEnvironmentFromAutoSDK()
|
|
{
|
|
string PlatformSDKRoot = GetPathToPlatformAutoSDKs();
|
|
|
|
// load environment variables from current SDK
|
|
if (!SetupEnvironmentFromAutoSDK(PlatformSDKRoot))
|
|
{
|
|
LogAutoSDK("Failed to load environment from required SDK {0}", GetRequiredSDKString());
|
|
InvalidateCurrentlyInstalledAutoSDK();
|
|
return SDKStatus.Invalid;
|
|
}
|
|
return SDKStatus.Valid;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether the required external SDKs are installed for this platform.
|
|
/// Could be either a manual install or an AutoSDK.
|
|
/// </summary>
|
|
public SDKStatus HasRequiredSDKsInstalled()
|
|
{
|
|
// avoid redundant potentially expensive SDK checks.
|
|
if (SDKCheckStatus == -1)
|
|
{
|
|
bool bHasManualSDK = HasRequiredManualSDK() == SDKStatus.Valid;
|
|
bool bHasAutoSDK = HasRequiredAutoSDKInstalled() == SDKStatus.Valid;
|
|
|
|
// Per-Platform implementations can choose how to handle non-Auto SDK detection / handling.
|
|
SDKCheckStatus = (bHasManualSDK || bHasAutoSDK) ? 1 : 0;
|
|
}
|
|
return SDKCheckStatus == 1 ? SDKStatus.Valid : SDKStatus.Invalid;
|
|
}
|
|
|
|
// Arbitrates between manual SDKs and setting up AutoSDK based on program options and platform preferences.
|
|
public void ManageAndValidateSDK()
|
|
{
|
|
bShouldLogInfo = BuildConfiguration.bPrintDebugInfo || Environment.GetEnvironmentVariable("IsBuildMachine") == "1";
|
|
|
|
// do not modify installed manifests if parent process has already set everything up.
|
|
// this avoids problems with determining IsAutoSDKSafe and doing an incorrect invalidate.
|
|
if (bAllowAutoSDKSwitching && !HasParentProcessSetupAutoSDK())
|
|
{
|
|
bool bSetSomeSDK = false;
|
|
bool bHasRequiredManualSDK = HasRequiredManualSDK() == SDKStatus.Valid;
|
|
if (IsAutoSDKSafe() && (PreferAutoSDK() || !bHasRequiredManualSDK))
|
|
{
|
|
SetupAutoSDK();
|
|
bSetSomeSDK = true;
|
|
}
|
|
|
|
//Setup manual SDK if autoSDK setup was skipped or failed for whatever reason.
|
|
if (bHasRequiredManualSDK && (HasRequiredAutoSDKInstalled() != SDKStatus.Valid))
|
|
{
|
|
SetupManualSDK();
|
|
bSetSomeSDK = true;
|
|
}
|
|
|
|
if (!bSetSomeSDK)
|
|
{
|
|
InvalidateCurrentlyInstalledAutoSDK();
|
|
}
|
|
}
|
|
|
|
|
|
if (bShouldLogInfo)
|
|
{
|
|
PrintSDKInfo();
|
|
}
|
|
}
|
|
|
|
public void PrintSDKInfo()
|
|
{
|
|
if (HasRequiredSDKsInstalled() == SDKStatus.Valid)
|
|
{
|
|
bool bHasRequiredManualSDK = HasRequiredManualSDK() == SDKStatus.Valid;
|
|
if (HasSetupAutoSDK())
|
|
{
|
|
string PlatformSDKRoot = GetPathToPlatformAutoSDKs();
|
|
LogAutoSDK(GetSDKTargetPlatformName() + " using SDK from: " + Path.Combine(PlatformSDKRoot, GetRequiredSDKString()));
|
|
}
|
|
else if (bHasRequiredManualSDK)
|
|
{
|
|
LogAutoSDK(this.ToString() + " using manually installed SDK " + GetRequiredSDKString());
|
|
}
|
|
else
|
|
{
|
|
LogAutoSDK(this.ToString() + " setup error. Inform platform team.");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
LogAutoSDK(this.ToString() + " has no valid SDK");
|
|
}
|
|
}
|
|
|
|
protected static void LogAutoSDK(string Format, params object[] Args)
|
|
{
|
|
if (bShouldLogInfo)
|
|
{
|
|
Log.WriteLine(LogEventType.Log, Format, Args);
|
|
}
|
|
}
|
|
|
|
protected static void LogAutoSDK(String Message)
|
|
{
|
|
if (bShouldLogInfo)
|
|
{
|
|
Log.WriteLine(LogEventType.Log, Message);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
public abstract class UEBuildPlatformFactory
|
|
{
|
|
/// <summary>
|
|
/// Attempt to register a build platform, checking whether it is a valid platform in installed builds
|
|
/// </summary>
|
|
public void TryRegisterBuildPlatforms(bool bValidatingPlatforms)
|
|
{
|
|
// We need all platforms to be registered when we run -validateplatform command to check SDK status of each
|
|
if (bValidatingPlatforms || InstalledPlatformInfo.Current.IsValidPlatform(TargetPlatform))
|
|
{
|
|
RegisterBuildPlatforms();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the target platform for an individual factory
|
|
/// </summary>
|
|
protected abstract UnrealTargetPlatform TargetPlatform
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Register the platform with the UEBuildPlatform class
|
|
/// </summary>
|
|
protected abstract void RegisterBuildPlatforms();
|
|
}
|
|
}
|