You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 3358702 on 2017/03/22 by Marc.Audy Always mark child actors pending kill when in PostLoad as often the World is too early to have a WorldContext which causes issues in DestroyActor #jira UE-42679 Change 3358737 on 2017/03/22 by Mieszko.Zielinski Exposed UBrainComponent::IsRunning() and UBrainComponent::IsPaused() to Blueprint #UE4 Change 3359062 on 2017/03/22 by Michael.Noland Blueprints: Show the Save and Find in CB buttons when working with level script blueprints (they will save/show the map package) #jira UE-30748 Change 3359066 on 2017/03/22 by Michael.Noland PR #3348: Make fields of FAttributeMetaData editable (Contributed by hoelzl) #jira UE-42620 Change 3359069 on 2017/03/22 by Michael.Noland PR #3288: InverseLerp Blueprint Tooltips Clarification (Contributed by wunawuna) #jira UE-42250 Change 3359108 on 2017/03/22 by Michael.Noland Blueprints: Fix an issue where running the editor in a different culture could break pins on nodes that have optional arrays of pins (e.g., animation graph nodes like blend by layer) #jira UE-36232 Change 3359235 on 2017/03/22 by Marc.Audy Expose bShouldPerformFullTickWhenPaused to blueprints and details panel #jira UE-17286 Change 3359324 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Disable collision on NavModifierVolumes. Previously they had an OverlapAll response and generated overlap events. They are only supposed to be used for preventing nav mesh generation, but overlap events could affect gameplay, and also are bad for performance. (Integrate CL 3249525 from Odin). Change 3359326 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Optimization during attachment to check bool before expensive casts and body instance fetching. (Integrate CL 3261262 from Odin). Change 3359327 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Make bSkipAgentHeightCheckWhenPickingNavData actually ignore height when picking data. (Integrate CL 3231908 from Odin) Change 3359328 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Make a static FName in UMovementComponent::OverlapTest const and move it to a namespace. (Integrate CL 3259985 from Odin) Change 3359329 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Fix ProjectileMovementComponent continuing to simulate (and generate hit events) after it is deactivated during simulation. HasStoppedSimulation() should check if bIsActive is false. (Integrate CL 3260001 from Odin) Change 3359330 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Fix accumulated forces in CharacterMovement when movement mode or activation changes. - Added CharacterMovementComponent::ClearAccumulatedForces() - AddForce() and related functions now avoid adding the force if in MovementMode "None". When ticking in "None", forces are cleared so they don't pile up until the next valid movement mode. Forces are also cleared if the updated component changes or when the capsule simulates physics. - CharacterMovementComponent::Deactivate() implemented to stop movement and call ClearAccumulatedForces(). - ClearAccumulatedForces() now also clears pending launch velocity. - Exposed ClearAccumulatedForces() to blueprints. - AddForce() and AddImpulse() now also check that character movement is active (not deactivated, able to tick). - ApplyAccumulatedForces() does not call ClearAccumulatedForces(), since that would prevent pending launch. - SimulateMovement() handles pending launch and clears forces regardless of whether it's simulated proxy. Added note to investigate using ApplyAccumulatedForces() in SimulateMovement(). - Inlined ActorComponent::IsActive(). (Integrate CLs3259933, 3266018 from Odin) Change 3359338 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) TickCharacterPose() and clear root motion before abandoning tick in UCharacterMovementComponent::PerformMovement() when movement mode is None. Prevents root motion building up until next valid movement mode. (Integrate CL 3271928 from Odin) Change 3359345 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Fix characters sliding when landing on slanted surfaces or stairs, when aggressive "Perch" settings could cause a line trace (from the center of a capsule) instead of capsule trace and thereby screw up the floor distance checks. (Integrate CL 3273026 from Odin) Change 3359381 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Performance tweak to ApplyRadialDamageWithFalloff(). Don't rebuild FRadialDamageEvent each loop over hit actors. Added stats for BreakHitResult()/MakeHitResult() under "stat game". (Integrate CLs 3275415, 3276810 from Odin). Change 3359422 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Fix build (CollisionProfile included). Change 3359442 on 2017/03/22 by Michael.Noland Blueprints: Prevent comment boxes from clipping the last letter of some words at the edge by increasing the padding on the wrap-at position Change 3359445 on 2017/03/22 by Michael.Noland PR #2989: Improved BP comment nodes (Contributed by projectgheist) #jira UE-36788 #jira UE-39118 Change 3359446 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Add support for FScopedMovementUpdate to be able to queue up overlaps that do not require reflexive bGenerateOverlapEvents. This allows custom inspection or processing of overlaps within a scoped move. Overlap events from the move will still only trigger in UpdateOverlaps() if bGenerateOverlapEvents is enabled on both components, as before. (Integrate CL 3278307 from Odin) Change 3359494 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Make some data in FScopedMovementUpdate protected rather than private so it can easily be subclassed, and expose a new helper SetWorldLocationAndRotation(). (Integrated CL 3280775 from Odin). Change 3359506 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) MovementComponent::Deactivate() calls StopMovement() to clear cached velocity. It's silly that reactivation many seconds or frames later would restore that velocity. Some special handling in CharacterMovement to keep it acting as before (it cleared velocity, but did not clear the path request, leaving that alone). (Integrate CL 3287026 from Odin). Change 3359514 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Collision.ListComponentsWithResponseToProfile command includes pending kill objects. (Integrate CL 3293322 from Odin) Change 3359553 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Optimization in CharacterMovement tick to not extract transform values twice. (Integrate CL 3299098 from Odin). Change 3359554 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Perf: optimize UKismetMathLibrary::GetForwardVector() (converts Rotator to forward direction). This way we avoid building a matrix, and avoids 1 more SinCos call. (Integrate CL 3296254 from Odin). Change 3359555 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Add OnComponentCollisionSettingsChangedEvent delegate to PrimitiveComponent. Fixed SkeletalMeshComponent not calling Super implementation. (Integrate CL 3295744 from Odin) Change 3359561 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Perf: AActor::GetComponents() with generic type should *not* assume the output array needs space for the entire contents of OwnedComponents. If OwnedComponents.Num() > the array reserve size, this forces an allocation, even if few or no components of the requested type are found. (Integrate CL 3299111 from Odin) Change 3359573 on 2017/03/22 by dan.reynolds Added BP log to the Passive Mix Modifier test platform BP Change 3359593 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Perf: avoid allocations during creation in AAIController::PostInitializeComponents() (in development builds). (Integrate CL 3299118 from Odin) Change 3359595 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Perf: HasActiveCameraComponent() and HasActivePawnControlCameraComponent() don't need to fill in an array while searching for a certain component. Also see CL 3359561, which could cause each of these functions to always cause an allocation when filling in the array when num components > 24. (Integrate CL 3299116 from Odin) Change 3359602 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Clean up some of the new fast overlap code in PrimitiveComponent. Mostly some variable renaming, and CVar access optimization. (Integrate CL 3340622 from Odin) Change 3359616 on 2017/03/22 by Zak.Middleton #ue4 - (Merge) Added support for bIgnoreTouches to FCollisionQueryParams. MoveComponent uses this to avoid PhysX collision queries for overlaps in GeomSweepMulti when bGenerateOverlapEvents is off. (Integrate CL 3340635 from Odin) Change 3359864 on 2017/03/23 by Mieszko.Zielinski Added a safeguard to prevent crashes resulting from people trying to name their BB keys things longer than 1024 characters #UE4 #jira UE-43120 Change 3360884 on 2017/03/23 by Zak.Middleton #ue4 - (Merge) Audio: AUDIO_MIXER_ENABLE_DEBUG_MODE turned off in Test builds. Shipping already had it off. (Integrate CL 3310724 from Odin) Change 3361045 on 2017/03/23 by Zak.Middleton #ue4 - (Merge) Audio: new cvars to help with optimization: - au.DisableReverbSubmix - au.DisableEQSubmix - au.DisableParallelSourceProcessing - au.SetAudioChannelCount Also checked in some code to cut down on the amount of parameter setting in EQ (Integrate of CL3303165in Odin by Aaron.Mcleran) Change 3361172 on 2017/03/23 by Zak.Middleton #ue4 - (Merge) Audio: added stat for HRTF. (Integrate CL 3310728 from Odin) Change 3361189 on 2017/03/23 by Zak.Middleton #ue4 - (Merge) CVar to toggle HRTF for perf settings. Default is on. (Integrate CL 3310926 from Odin). Change 3361914 on 2017/03/23 by Aaron.McLeran UE-42649 Fixing crash in cleaning up active sound in sound concurrency -Handling edge case of an active sound not have a sound base ptr, which is possible. Change 3361924 on 2017/03/23 by Aaron.McLeran UE-41378 Fixing passive mix modifier bug Change 3361978 on 2017/03/23 by Aaron.McLeran UE-42627 Fix for when audio device is removed and getting a deadlock in computing audio clock Change 3361989 on 2017/03/23 by Aaron.McLeran PR #3010: Check for null GEngine on sound processing Change 3362053 on 2017/03/23 by Zak.Middleton #ue4 - (Merge) Audio: Perf: Avoid thousands of Array.Add() calls during processing, which on shipping still does checks to see if the allocator has to grow, and updates ArrayCount. (Integrate CL 3311120 from Odin) Change 3362102 on 2017/03/23 by Aaron.McLeran PR #3182: Enabled SwitchOnEnum nodes for EAttenuationShape and EAttenuationDistanceModel Change 3362153 on 2017/03/23 by Aaron.McLeran UE-43286 Oculus audio plugin not working/available Change 3362162 on 2017/03/23 by Aaron.McLeran UE-42252 Frequent ensure in FLevelEditorViewportClient::UpdateAudioListener Change 3362206 on 2017/03/23 by Aaron.McLeran UE-43287 Fixing HRTF spatialization in editor viewport - Steam Audio doesn't support multiple audio devices at the moment - Instead of hard-coding all audio plugins to not work in main audio device (GDC temp fix), I allow audio plugins to specify if they should be used on main audio device Change 3362775 on 2017/03/24 by mason.seay Replaced deprecated node Change 3363024 on 2017/03/24 by Ben.Zeigler Fix regression in behavior of streamable manager where loading both a valid and null asset used to work but now fails. Instead added a warning for that case, but if only null are requested it still fails with an error Change 3363030 on 2017/03/24 by Zak.Middleton #ue4 - Lower default max sendrate for clients to 60Hz from 90Hz when net speed is high and player count is low. Throttled rate remains at 45Hz. This value has been tested in Paragon with no ill effect, and saves on bandwidth and server CPU when clients run at high framerate. Change 3363036 on 2017/03/24 by Zak.Middleton #ue4 - (Merge) Audio: Perf: turned a float divide into a multiply. It happens at least 32k times per audio update. (Integrate CL 3311158 from Odin) Change 3363541 on 2017/03/24 by Zak.Middleton #ue4 - (Merge) Audio: Perf: remove pointer indirection, and successive TArray Add()s in GetChannelMap(). (Integrate CL 3311169 from Odin) Change 3363642 on 2017/03/24 by Zak.Middleton #ue4 - (Merge) Audio: Perf: Save ~5% total audio update time. Savings in "Source Output Buffers". - Removed function call overhead to updating channel map. 64,000 function calls... - Simplified FSourceParam::Update() to reduce branching and have 1 return site. - Added alternative to GetChannelMap() called UpdateChannelMap() that avoids copying out values to an array. The values can then be fetched from the channel data directly. (Integrate CL 3311235 from Odin) Change 3364441 on 2017/03/24 by Ben.Zeigler Fix issue where calling LoadLocalIniFile on a plugin file would result in an empty file. It was assuming engine/game dirs, now it instead pulls it out of GConfig if available. This fixes issue where iterative cooking would fail on plugin config files Add FindConfigFileWithBaseName to GConfig Change 3364652 on 2017/03/25 by Phillip.Kavan #jira UE-43210 - Fix a runtime VM crash upon removing an element from a set after consecutive add/remove iterations. Change summary: - Fixed FScriptSet::Add() to initialize the HashIndex member of the new element when the HashSize does not change. Change 3365609 on 2017/03/27 by Richard.Hinckley #jira UEDOC-4720 Fixed global enums being dropped from documentation after being extracted by Doxygen. Change 3365737 on 2017/03/27 by Marc.Audy Move setting of the ParentComponent property on an actor to PostRepNotifies instead of having a separate OnRep function. Change 3365795 on 2017/03/27 by Marc.Audy Fix compile error Change 3365894 on 2017/03/27 by Phillip.Kavan #jira UE-35507 - Fix for a GLEO when choosing an LSBP class as the default value for a class input pin in a non-LSBP graph. Change summary: - Modified FGraphPinFilter::IsClassAllowed() to disallow a given class if the type is contained within a map package that does not match the current graph context. Change 3366067 on 2017/03/27 by Marc.Audy Add UWorld* to PostLoadMap indicating which world has been loaded. Null if an error has occurred. #jira UE-40228 Change 3366097 on 2017/03/27 by Marc.Audy Fixed missed deprecation disable pairing for PostLadMap Change 3366170 on 2017/03/27 by Aaron.McLeran Fixing div by zero Change 3366221 on 2017/03/27 by Aaron.McLeran UE-43240 Removing dependency on component visualizers in runtime Phonon module. Change 3366698 on 2017/03/27 by Marc.Audy Fix Orion compile errors Change 3366782 on 2017/03/27 by Aaron.McLeran Bringing over optimizations from Odin to Dev-framework. Original CL3311435Change 3366818 on 2017/03/27 by Aaron.McLeran Bringing fix from Odin to Dev-Framework from CL 3304533 Fix for rare condition that stomps memory during source recycling. Change 3366984 on 2017/03/27 by Michael.Noland Blueprints: Downgraded a warning in the connection drawing policy to verbose to suppress it. It does no good to a typical user. #jira UE-41638 Change 3367085 on 2017/03/27 by Brent.Pease - Improve AudioMixer buffering so that only two buffers are needed instead of three, buffer submission and buffer processing are ovelapped, and a warning is issued if the audio processing thread can not keep up. - Added time critical thread priority so that audio processing is not starved which would produce clicks and popping - Allow the audio thread to not be created if a platform implements its own BeginGeneratingAudio() call (as happens on Android) Change 3367434 on 2017/03/28 by Marc.Audy Fix UT compile error Change 3368587 on 2017/03/28 by Mike.Beach Adding a "CookedOnly" plugin type (now used by the nativized Blueprint plugin). Change 3368724 on 2017/03/28 by Zak.Middleton #ue4 - MovementComponent does not ignore initial blocking overlaps when moving from SafeMoveUpdatedComponent(). Set "p.MoveIgnoreFirstBlockingOverlap" back to zero and add a new flag that prevents the depenetration test from generating hit events (to prevent the problem discovered in UE-39387). #jira UE-41613, UE-28610 Change 3368748 on 2017/03/28 by Dan.Oconnor Provide &FUObjectThreadContext::Get().ObjLoaded when using the compilation manager, add validation functions for finding REINST/TRASH references Change 3368852 on 2017/03/28 by Mike.Beach Fixing a CIS error before it happens - wrapping implementation in preprocessor defines to match declaration in header. Change 3368873 on 2017/03/28 by Dan.Oconnor Rather than collecting script object references, just use the ScriptObjectReferences array. This allows reference replacing archives to update ScriptObjectReferences. Change 3368998 on 2017/03/28 by Dan.Oconnor Setting CLASS_Interface early in the compilation process Change 3369494 on 2017/03/29 by Marc.Audy Fix UAT compile error Change 3369924 on 2017/03/29 by Zak.Middleton #ue4 - Allow CharacterMovement AdjustFloorHeight() to adjust using the line trace if in penetration. Force next floor check so it will check after it depenetrates. #jira UE-36973 Change 3369932 on 2017/03/29 by Ben.Zeigler #jira UE-19494 Finish asset auditing work by allowing reading back a cooked asset registry in the editor Split off FAssetRegistryState as the struct to hold serialization and accessors, to allow loading multiple platform states at once. Optimized runtime asset registry serialization to be around 1/3 as large as before. Dependencies are disabled by default for the runtime registry, you can re-enable with bSerializeDependencies in Engine.ini Add FAssetPackageData which is explicitly per-package and only updated on save/load time. File size is stored in here and is computed for both editor and cooked data Add code to AssetManagerEditorModule to allow loading pre-cooked asset registry files and reading cooked sizes. The Asset Audit window now has a platform drop down that allows reading from cooked data Rename ChunkManifestGenerator to AssetRegistryGenerator and change it to directly hold an FAssetRegistryState internally Add new experimental AssetRegistry mode for iterative cooking. This mode is much faster as it does not need to do it's own internal dependency checking and it can be enabled with bUseAssetRegistryForIteration Change it so during cooking it doesn't directly load string asset references, but instead cues them for cook and uses the asset registry to find and add redirector mappings that are used during save time Change3370028on 2017/03/29 by Ben.Zeigler CIS fix Change 3370360 on 2017/03/29 by Mike.Beach Adding an extra field to FPlatformInfo; a 'UBTTarget' identifier intended to sync up with UBT's UnrealTargetPlatform enum (needed for programatically generating plugin platform whitelists). Change 3370363 on 2017/03/29 by Ben.Zeigler Fix issue where loading out of date editor asset registry cache would throw pointless errors Change 3370414 on 2017/03/29 by Marc.Audy Remove autos Change 3370428 on 2017/03/29 by Ben.Zeigler Fix linux CIS issue, remove implicit conversion from FSavePackageResultStruct back to enum result as it was creating ambiguous operators Change 3370453 on 2017/03/29 by Marc.Audy CIS fix Change 3370548 on 2017/03/29 by Marc.Audy #rn Fix issues with seamless travel in PIE and shared sub levels between different parents. Change 3370564 on 2017/03/29 by Mieszko.Zielinski PR #3429: fix comment typo (Contributed by kayama-shift) Change 3370602 on 2017/03/29 by Mieszko.Zielinski Fixed FRecastTileGenerator::Modifiers being erroneously counted twice when stating memory #UE4 Change 3370615 on 2017/03/29 by Phillip.Kavan #jira UE-35515 - No longer crash when creating a new BP class from one or more selected Actors in which the root component is not Blueprint-spawnable. Change summary: - Modified FKismetEditorUtilities::AddComponentsToBlueprint() to handle deferred SceneComponent SCS node adds when the parent component was not also added (due to not being BP-spawnable). Change 3370693 on 2017/03/29 by Michael.Noland Fixing some bad indentation #rnx Change 3370740 on 2017/03/29 by Ben.Zeigler DLC/Mod Cooking fixes, the list of packages from release build as in uncooked filename format so fixed code and made this more obvious Fix Asset Registry to allow loading multiple source asset registries into the same state, by keeping a list of preallocated buffers Change 3370792 on 2017/03/29 by Michael.Noland Blueprints: Deleted some unversioned backwards compat. code that would only matter for assets older than VER_UE4_OLDEST_LOADABLE_PACKAGE Change 3370794 on 2017/03/29 by Michael.Noland PR #3190: Reduce some output logging - Reduced an Oculus log from Log to Verbose because it spams quite a bit - Corrected the spelling and the meaning of a blueprint warning when an invalid breakpoint is encountered - Treat UInputComponent::GetAxisValue(None) as not a warning - Switch FGenericSaveGameSystem::LoadGame to silently attempt to load the file, it returns success/failure and it isn't necessary to have a separate warning at the file i/o layer #jira UE-41446 Change 3370831 on 2017/03/29 by Dan.Oconnor Iteration on compilation manager - Fix Skeleton class compilation order - Pass ObjLoaded array to compilation manager to ensure all objects get PostLoaded - Make sure data only classes get reinstanced, so that UpdateCustomPropertyListForPostConstruction is run correctly Change 3370923 on 2017/03/29 by Michael.Noland Blueprints: Added an icon to indicate whether or not a macro contains latent actions - Note: The state of the icon is cached for performance reasons on request, with the cache being cleared when the BP containing the macro is modified or a macro graph is removed - This does mean that editing the inner macro of a nested macro to add/remove a latent action will not show up in visualization for the outer node until the editor is restarted or the outer macro is modified Change 3371039 on 2017/03/29 by Dan.Oconnor Hacky fix for dropping return params when a function's return node is culled Change 3371750 on 2017/03/30 by Richard.Hinckley Stencil write mask exposed. Adds nine new options (all bits, plus each bit individually - write on pass or depth fail). This allows stencil overlaps to be detected by mixing masks. Change 3372513 on 2017/03/30 by Ben.Zeigler #jira UE-43475 Fix cooker issues with string asset references to null packages. Fix redirector detection to follow recursive chains, and correctly strip object class from redirected string asset references. Change 3372565 on 2017/03/30 by Richard.Hinckley Rolling back stencil change, will be moved to Dev-Rendering. Change 3372764 on 2017/03/30 by Marc.Audy Do not create a duplicate sub object that is not in the annotation if a sub object of the same name and class already exists. #jira UE-43328 #rn Fixed cases where the blueprint of a class used as a child actor could be dirtied when compiling the owning blueprint. Change 3372847 on 2017/03/30 by Marc.Audy Fix missing include Change 3372994 on 2017/03/30 by Zak.Middleton #ue4 - Fix build in Debug (checkSlow using incorrect function params). Change 3373195 on 2017/03/30 by Mike.Beach For nativization, changing it so we key off of the target platform-info struct instead of the platform (in preparation for defining the nativized plugin's platform whitelist). Change 3373320 on 2017/03/30 by mason.seay Basic for TM-Gameplay map (WIP) Change 3373448 on 2017/03/30 by Ben.Zeigler Fix recursive size display in audit window Improve asset manager comments Change 3373576 on 2017/03/30 by dan.reynolds AEOverview Update: Updated Passive Mix Modifier Test based on recent changes in behavior Also added Initial Delay Time timer to test Change 3373589 on 2017/03/30 by dan.reynolds AEOverview Passive Mix Mod Test Map update Change 3373624 on 2017/03/30 by Zak.Middleton #ue4 - Increase Pawn location replication precision to 2 decimal places from 0. Prevents replicated pawns from being inside geometry by a large amount. Removed CVars controlling CharacterMovement proxy shrink amount and made those instanced properties on the component. #jira UE-40420 Change 3374271 on 2017/03/31 by Marc.Audy Fix deprecation warning in new UT code Change 3374320 on 2017/03/31 by Marc.Audy Fix HTML5 compile. Change 3374413 on 2017/03/31 by Jeff.Farris Added ENGINE_API to 2 functions in PlanarReflection, so projects can subclass it. (Copied CL3276454from Robo Recall to Dev-Framework) Change 3374414 on 2017/03/31 by Jeff.Farris Added support for setting UNavigationSystem::bUpdateNavOctreeOnComponentChange (Copied CL 3267903 from RoboRecall to Dev-Framework) Change 3374616 on 2017/03/31 by Ben.Zeigler Copy of Fortnite CL #3312058 to add a missing redirector. I do not understand why this is not erroring on Main, I guess my minor cook changes somehow exposed this Change 3374664 on 2017/03/31 by Jeff.Farris Consted AIController::GetBrainComponent() (Copied 3239101 from Robo Recall to Dev-Framework) Change 3374665 on 2017/03/31 by Jeff.Farris PrimitiveComponent bIgnoreRadialImpulse and bIgnoreRadialForce are now exposed to BPs. bIgnoreRadialImpulse now respected when applying impulse to relevant movement components. (Coped CL 3242355 from Robo Recall to Dev-Framework) Change 3374779 on 2017/03/31 by Jeff.Farris Exposed SetAllPhysicsAngularVelocity to blueprints (Copied CL 3228390 from Robo Recall to Dev-Framework) Change 3374792 on 2017/03/31 by Ben.Zeigler #jira UE-42618 PR #3347: Improve support for FGameplayAttributeData properties in attribute sets (Contributed by hoelzl) Change 3374844 on 2017/03/31 by Ben.Zeigler #jira UE-42587 Fix issue where supressed gameplay effects that granted abilities would only work the first time, it now clears out of date ability handles Change 3374925 on 2017/03/31 by Marc.Audy Don't throw warning about missing world context for inactive worlds. #jira UE-42679 Change 3374927 on 2017/03/31 by Michael.Noland Editor: Added options for configuring the editor window background color and texture, which can be useful to visually distinguish the editor when switching between different branches or projects Change 3374995 on 2017/03/31 by Michael.Noland Editor: Rewrote CallInEditor support and promoted it so it can be used on functions in any class, not just blueprints derived from AActor: - CallInEditor used on native UFUNCTION() declarations will now show up without having to make a BP subclass - CallInEditor can now be used as a top-level keyword in the UFUNCTION() declaration (e.g., UFUNCTION(Category=CoolCommands, CallInEditor)) - Now shows each function as a separate button, placed in the category associated with the function - The button strip entry is now searchable by function name or tooltip - Prevented operating on functions that have parameters or return values, which would crash before - Removed the duplicate copies of properties placed in the Blutility section - Added a scoped transaction around CallInEditor execution - Allowed functions to be marked as CallInEditor in addition to custom events (currently we don't allow editing category or tooltip on custom events...) Editor: Moved Experimental/EarlyAccessPreview details customizations up to UObject so it can be used on any class, not just actors/components Upgrade Note: Behavior has changed so that CallInEditor can be called on CDOs as well, this will probably be walked back in a subsequent update, at least for actors and components. Change 3375005 on 2017/03/31 by Michael.Noland Fixing incremental compilation error due to missing include #rnx Change 3375015 on 2017/03/31 by Michael.Noland Fixing incremental compilation error due to missing include (for real) #rnx Change 3375045 on 2017/03/31 by Marc.Audy Only calculate the streaming levels prefix during seamless travel if it is a PIE world #jira UE-43485 Change 3375053 on 2017/03/31 by Ben.Zeigler #jira UE-41988 Fix it so leaving PIE while gameplay debugger is active will disable HUD extensions properly, restoring ability to print messages to screen Change 3375057 on 2017/03/31 by Ben.Zeigler #jira UE-39226 Don't add to DrawDebug list for player controllers with no local player Change 3375121 on 2017/03/31 by Michael.Noland Added missing include for FScopedTransaction #rnx Change 3375222 on 2017/03/31 by mason.seay Submitting work done to TM-Gameplay. Still WIP Change 3375308 on 2017/03/31 by Michael.Noland Editor: Added back CDO filtering to CallInEditor, it's too easy to explode in the BP editor. May consider allowing opt-in behavior when we revisit Blutilities Change 3375321 on 2017/03/31 by Ben.Zeigler #jira UE-39062 Fix issue where using the level editor toolbar to modify blueprints was not properly marking the blueprints as modified, so the constructor links weren't being updated until manually compiling or resaving Always recompute post constructor links when calling MarkBlueprintAsModified, as it can be called from native and other places where we modified CDOs but don't have a property changed event Change 3375372 on 2017/03/31 by Ben.Zeigler #jira UE-39568 Change Components to specifically update LatentActions the same as Actors do, so they update properly if bUpdateWhilePaused is set Change 3375380 on 2017/03/31 by Marc.Audy Modify IsMainAudioDevice to deal with the case where no audio device has been created. Change 3375402 on 2017/03/31 by Marc.Audy Fix DuplicateWorldForPIE in the case that the OwningWorld is null. Change 3376037 on 2017/04/02 by Phillip.Kavan #jira UE-35332 - Preserve the least common ancestor pin type on object array function node inputs after a node refresh. Change summary: - Added UK2Node_CallArrayFunction::GetDynamicallyTypedPins() to consolidate the code that retrieves type-dependent parameter pins. - Added FBlueprintEditorUtils::FindLinkedPinWithAuthoritativePinType() to consolidate the code that considers other linked pins when choosing which type to propagate to type-dependent parameter pins. - Added FBlueprintEditorUtils::PropagatePinTypeInfo() to consolidate the common code from UK2Node_CallArrayFunction::PropagateArrayTypeInfo(); this eliminated a redundant retrieval of the target pin set. - Refactored UK2Node_CallArrayFunction::PropagateArrayTypeInfo() to now call FBlueprintEditorUtils::PropagatePinTypeInfo() after retrieving the set of dynamically-typed pins. - Refactored UK2Node_CallArrayFunction::NotifyPinConnectionListChanged() to remove some unnecessary iteration passes and to ensure that we propagate the authoritative (least common ancestor) pin type for object- and struct-based types. Change 3376364 on 2017/04/03 by Richard.Hinckley UE-40920 Fix to Paper2D flipbook timeline editor. Previously, the timeline shown was one frame shorter than the animation. Now, the timeline shows the correct frame count. Change 3376366 on 2017/04/03 by Richard.Hinckley UE-40920 Bugfix to Paper2D flipbook editor. The red line indicating the current frame now adjusts properly if the timeline is longer than the editor window and the scroll bar is moved to the right. Change 3376517 on 2017/04/03 by Marc.Audy PR #3195: Added support for GamePad on RawInput Plugin (Contributed by katze7514) #jira UE-41499 Change 3376708 on 2017/04/03 by Mike.Beach Moving nativized plugins into a centralized folder (so we can use it as an additional plugin lookup dir) - this is so we can ultimately keep the generated code around for debugging purposes. Summary of changes: - nativized plugins now moved to ...\Intermediate\Plugins\<PLATFORM>\NativizedAssets - corresponding manifest files get saved inside the module and named to match the platform - nativized modules now whitelisted only for the platform they were generated for - cleanup on how we generate paths (now piping in platform name) and pass multi-cook process ids (for building manifest filenames) - extending the 'NativizeAssets' command line, so you can use it to specify the target plugin path (utilized by UAT to coordinate the plugin path between cook & build - was previously hardcoded in multiple places). Change 3376826 on 2017/04/03 by Phillip.Kavan #jira UE-43330 - Fix a crash when adding an input parameter to a Custom Event node after deleting a Function Graph containing a Create Event node. Change summary: - Modified UK2Node_CreateDelegate::HandleAnyChangeWithoutNotifying() to check for a valid blueprint before accessing it (since the accessor is now a checked operation). - Modified UK2Node_CreateDelegate::GetScopeClass() to also check for a valid blueprint before accessing it. - Switched 'NULL' to 'nullptr' in a few spots. Change 3376831 on 2017/04/03 by Ben.Zeigler #jira UE-43500, clean up UPackage when EDL/async loading fails. This restores EDL LoadPackage to work the same as non EDL and return NULL instead of an invalid empty package Change 3376846 on 2017/04/03 by Ben.Zeigler #jira UE-38760 Properly refresh exec pins when removing pin from a Switch on Int node Change 3376850 on 2017/04/03 by Dan.Oconnor Use authoritative class to mitigate compilation order issues Change 3376961 on 2017/04/03 by Ben.Zeigler #jira UE-43127 Add struct ops implementations for FIntVector and FBox2d, any blueprint type needs struct ops to avoid crashes Fix Box2d variable name in NoExportTypes Change 3376985 on 2017/04/03 by Ben.Zeigler #jira UE-43582 Remove Xbox-specific code from AssetRegistry because it won't work after my refactor. The serialization is much faster now and neither Bob nor I can conceive of a way this would take long enough to stall the main thread. If it it is somehow a problem, it should be wrapped in a slow task instead Change 3377009 on 2017/04/03 by Ben.Zeigler #jira UE-43036 Fix crash when right clicking blueprint with no parent class. Ensures are fine but crashes should be avoided so people can try to copy data out of them Change 3377054 on 2017/04/03 by Zak.Middleton #ue4 - Fix CharacterMovementComponent updated with very high delta time on server when initially joining. Make sure the ServerTimeStamp is initialized to current world time rather than zero to prevent large delta. #jira UE-40344 #udn https://udn.unrealengine.com/questions/310497/large-delta-time-for-first-player-movement-update.html Change 3377061 on 2017/04/03 by Dan.Oconnor Fixes for issues exposed by cooking with compilation manager. When cooking we end up with more blueprints compiling at a single time, which highlighted issues reading from generated classes while they were actively regenerating. Note that EInternalCompilerFlags::PostponeLocalsGenerationUntilPhaseTwo has only been added to mitigate risk - there is no known reason that existing compilation flows can't postpone generatation of local variables. Change 3377073 on 2017/04/03 by Mike.Beach CIS fix - proper initialization ordering. Change 3377371 on 2017/04/03 by Ben.Zeigler #jira UE-43144 Disallow creating map of FText, like bool it is not hashable Change 3377395 on 2017/04/03 by Dan.Oconnor Build fix - make order in source match initialization order in artifact Change 3377417 on 2017/04/03 by Dan.Oconnor Speculative SA fix Change 3377496 on 2017/04/03 by Aaron.McLeran #jira UE-43558 Cleaning up shutdown code with audio plugins. Change 3377608 on 2017/04/03 by Zak.Middleton #ue4 - Added function ACharacter::CacheInitialMeshOffset() to cache initial mesh offset, used as the target for network smoothing. Added a call to this function from BeginPlay() in addition to the existing call from PostInitializeComponents(), and exposed this to blueprints as well. This fixes the case of people moving the mesh in BeginPlay rather than in the editor or construction script and not having the mesh offset reflected correctly in network games. #jira UE-38966 Change 3377880 on 2017/04/03 by Aaron.McLeran Audio bug fixes #jira UE-43600 Fixing sounds played by playsoundatlocation for audio volume calculations #jira UE-43601 Fixing listener volume interpolation #jida UE-43602 Fixing reverb/eq interpolation Change 3377908 on 2017/04/03 by Phillip.Kavan #jira UE-43565 - Fix a regression on type-dependent array function node pins that have more than one link. Change summary: - Added FBlueprintEditorUtils::FindLinkedPinWithMostDerivedPinType() - Modified FBlueprintEditorUtils::FindLinkedPinWithAuthoritativePinType() to properly handle pins that have multiple links. Change 3377912 on 2017/04/03 by Dan.Oconnor Fix for missing SUBINSTANCE variables on anim BP skeletons. I elected to force SUBINSTANCE variable creation for the compilation manager codepath Change 3377946 on 2017/04/03 by Ben.Zeigler #jira UE-43594 Fix issue with streamable manager where a failed load would leave bAsyncLoadRequestOutstanding, which would confuse later calls to stream the same asset Lower some error verbosity now that I believe I have tracked down the issue Change 3377950 on 2017/04/03 by Michael.Noland Blueprints: Prevent merge tool from crashing in SVN when looking at a file with gaps in the revision history (May still not work correctly, but it won't crash; full fix covered by UE-43603) #jira UE-22428 Change 3377981 on 2017/04/03 by Michael.Noland PR #3416: UE-43005: Prevent crash due to too long name (Contributed by projectgheist) #jira UE-43291 #jira UE-43005 Change 3378039 on 2017/04/04 by Michael.Noland PhysX: Allowed the editor to compile when bRuntimePhysicsCooking is disabled (WITH_EDITOR is used in every place in C++ to force it in already) Change 3378041 on 2017/04/04 by Michael.Noland Paper2D: Adjusted under what circumstances CreatePhysicsMeshes is called on various Paper2D types to match UProceduralMeshComponent Change 3378081 on 2017/04/04 by Dan.Oconnor Fix Blueprint Context nodes so that they don't rely on Ar.IsBeingSaved() call before compilation 3x because of copy/paste Change 3378094 on 2017/04/04 by Dan.Oconnor Add missing preload call for compilation manager Change 3378917 on 2017/04/04 by Marc.Audy Fix static analysis (which is very dumb) Change 3378986 on 2017/04/04 by Dan.Oconnor Fix bad merge Change 3379100 on 2017/04/04 by Dan.Oconnor Fix missing CPF_ConstParm/CPF_ReferenceParm/CPF_OutParm logic in 'fast' skeleton path #jira UE-43629 Change 3379102 on 2017/04/04 by Ben.Zeigler Actually fix StreamableManager issues with cancelling a request messing up things in the future. We now always queue a request, even if it failed before or there is one in progress. This has to be done to avoid issues with cancelling the existing request or mounting new files after it's failed once Now that StreamableManager will retry missing files, add failed load packages to the known missing list so it won't spam errors over and over Change 3379147 on 2017/04/04 by Zak.Middleton #ue4 - Improve on CL 3377608: Made Character::CacheInitialMeshOffset() take location and rotation params so you can be explicit on the values, in case you try to change these during network smoothing, where reading the relative offsets would have been skewed. Change 3379254 on 2017/04/04 by Aaron.McLeran Fixing sounds in audio mixer when no EQ has been set. Change 3379760 on 2017/04/04 by Ben.Zeigler #jira UE-43647 Don't delete failed async packages that are rooted [CL 3380073 by Dan Oconnor in Main branch]
1124 lines
44 KiB
C#
1124 lines
44 KiB
C#
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Text.RegularExpressions;
|
|
using System.Reflection;
|
|
using System.Runtime.InteropServices;
|
|
using System.Runtime.Serialization;
|
|
|
|
namespace UnrealBuildTool
|
|
{
|
|
// This enum has to be compatible with the one defined in the
|
|
// UE4\Engine\Source\Runtime\Core\Public\Misc\ComplilationResult.h
|
|
// to keep communication between UHT, UBT and Editor compiling
|
|
// processes valid.
|
|
enum ECompilationResult
|
|
{
|
|
/// <summary>
|
|
/// Compilation succeeded
|
|
/// </summary>
|
|
Succeeded = 0,
|
|
|
|
/// <summary>
|
|
/// Build was canceled, this is used on the engine side only
|
|
/// </summary>
|
|
Canceled = 1,
|
|
|
|
/// <summary>
|
|
/// All targets were up to date, used only with -canskiplink
|
|
/// </summary>
|
|
UpToDate = 2,
|
|
|
|
/// <summary>
|
|
/// The process has most likely crashed. This is what UE returns in case of an assert
|
|
/// </summary>
|
|
CrashOrAssert = 3,
|
|
|
|
/// <summary>
|
|
/// Compilation failed because generated code changed which was not supported
|
|
/// </summary>
|
|
FailedDueToHeaderChange = 4,
|
|
|
|
/// <summary>
|
|
/// Compilation failed due to compilation errors
|
|
/// </summary>
|
|
OtherCompilationError = 5,
|
|
|
|
/// <summary>
|
|
/// Compilation is not supported in the current build
|
|
/// </summary>
|
|
Unsupported,
|
|
|
|
/// <summary>
|
|
/// Unknown error
|
|
/// </summary>
|
|
Unknown
|
|
}
|
|
static class CompilationResultExtensions
|
|
{
|
|
public static bool Succeeded(this ECompilationResult Result)
|
|
{
|
|
return Result == ECompilationResult.Succeeded || Result == ECompilationResult.UpToDate;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Type of module. Mirrored in UHT as EBuildModuleType.
|
|
/// This should be sorted by the order in which we expect modules to be built.
|
|
/// </summary>
|
|
enum UHTModuleType
|
|
{
|
|
Program,
|
|
EngineRuntime,
|
|
EngineDeveloper,
|
|
EngineEditor,
|
|
EngineThirdParty,
|
|
GameRuntime,
|
|
GameDeveloper,
|
|
GameEditor,
|
|
GameThirdParty,
|
|
}
|
|
static class UHTModuleTypeExtensions
|
|
{
|
|
public static bool IsProgramModule(this UHTModuleType ModuleType)
|
|
{
|
|
return ModuleType == UHTModuleType.Program;
|
|
}
|
|
public static bool IsEngineModule(this UHTModuleType ModuleType)
|
|
{
|
|
return ModuleType == UHTModuleType.EngineRuntime || ModuleType == UHTModuleType.EngineDeveloper || ModuleType == UHTModuleType.EngineEditor || ModuleType == UHTModuleType.EngineThirdParty;
|
|
}
|
|
public static bool IsGameModule(this UHTModuleType ModuleType)
|
|
{
|
|
return ModuleType == UHTModuleType.GameRuntime || ModuleType == UHTModuleType.GameDeveloper || ModuleType == UHTModuleType.GameEditor || ModuleType == UHTModuleType.GameThirdParty;
|
|
}
|
|
public static UHTModuleType? EngineModuleTypeFromHostType(ModuleHostType ModuleType)
|
|
{
|
|
switch (ModuleType)
|
|
{
|
|
case ModuleHostType.Runtime:
|
|
case ModuleHostType.RuntimeNoCommandlet:
|
|
case ModuleHostType.RuntimeAndProgram:
|
|
case ModuleHostType.CookedOnly:
|
|
case ModuleHostType.ServerOnly:
|
|
case ModuleHostType.ClientOnly:
|
|
return UHTModuleType.EngineRuntime;
|
|
case ModuleHostType.Developer:
|
|
return UHTModuleType.EngineDeveloper;
|
|
case ModuleHostType.Editor:
|
|
case ModuleHostType.EditorNoCommandlet:
|
|
return UHTModuleType.EngineEditor;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
public static UHTModuleType? GameModuleTypeFromHostType(ModuleHostType ModuleType)
|
|
{
|
|
switch (ModuleType)
|
|
{
|
|
case ModuleHostType.Runtime:
|
|
case ModuleHostType.RuntimeNoCommandlet:
|
|
case ModuleHostType.RuntimeAndProgram:
|
|
case ModuleHostType.CookedOnly:
|
|
case ModuleHostType.ServerOnly:
|
|
case ModuleHostType.ClientOnly:
|
|
return UHTModuleType.GameRuntime;
|
|
case ModuleHostType.Developer:
|
|
return UHTModuleType.GameDeveloper;
|
|
case ModuleHostType.Editor:
|
|
case ModuleHostType.EditorNoCommandlet:
|
|
return UHTModuleType.GameEditor;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Information about a module that needs to be passed to UnrealHeaderTool for code generation
|
|
/// </summary>
|
|
[Serializable]
|
|
class UHTModuleInfo : ISerializable
|
|
{
|
|
/// <summary>
|
|
/// Module name
|
|
/// </summary>
|
|
public string ModuleName;
|
|
|
|
/// <summary>
|
|
/// Module base directory
|
|
/// </summary>
|
|
public DirectoryReference ModuleDirectory;
|
|
|
|
/// <summary>
|
|
/// Module type
|
|
/// </summary>
|
|
public string ModuleType;
|
|
|
|
/// <summary>
|
|
/// Public UObject headers found in the Classes directory (legacy)
|
|
/// </summary>
|
|
public List<FileItem> PublicUObjectClassesHeaders;
|
|
|
|
/// <summary>
|
|
/// Public headers with UObjects
|
|
/// </summary>
|
|
public List<FileItem> PublicUObjectHeaders;
|
|
|
|
/// <summary>
|
|
/// Private headers with UObjects
|
|
/// </summary>
|
|
public List<FileItem> PrivateUObjectHeaders;
|
|
|
|
/// <summary>
|
|
/// Module PCH absolute path
|
|
/// </summary>
|
|
public string PCH;
|
|
|
|
/// <summary>
|
|
/// Base (i.e. extensionless) path+filename of the .generated files
|
|
/// </summary>
|
|
public string GeneratedCPPFilenameBase;
|
|
|
|
/// <summary>
|
|
/// Version of code generated by UHT
|
|
/// </summary>
|
|
public EGeneratedCodeVersion GeneratedCodeVersion;
|
|
|
|
public UHTModuleInfo()
|
|
{
|
|
}
|
|
|
|
public UHTModuleInfo(SerializationInfo Info, StreamingContext Context)
|
|
{
|
|
ModuleName = Info.GetString("mn");
|
|
ModuleDirectory = (DirectoryReference)Info.GetValue("md", typeof(DirectoryReference));
|
|
ModuleType = Info.GetString("mt");
|
|
PublicUObjectClassesHeaders = (List<FileItem>)Info.GetValue("cl", typeof(List<FileItem>));
|
|
PublicUObjectHeaders = (List<FileItem>)Info.GetValue("pu", typeof(List<FileItem>));
|
|
PrivateUObjectHeaders = (List<FileItem>)Info.GetValue("pr", typeof(List<FileItem>));
|
|
PCH = Info.GetString("pc");
|
|
GeneratedCPPFilenameBase = Info.GetString("ge");
|
|
GeneratedCodeVersion = (EGeneratedCodeVersion)Info.GetInt32("gv");
|
|
}
|
|
|
|
public void GetObjectData(SerializationInfo Info, StreamingContext Context)
|
|
{
|
|
Info.AddValue("mn", ModuleName);
|
|
Info.AddValue("md", ModuleDirectory);
|
|
Info.AddValue("mt", ModuleType);
|
|
Info.AddValue("cl", PublicUObjectClassesHeaders);
|
|
Info.AddValue("pu", PublicUObjectHeaders);
|
|
Info.AddValue("pr", PrivateUObjectHeaders);
|
|
Info.AddValue("pc", PCH);
|
|
Info.AddValue("ge", GeneratedCPPFilenameBase);
|
|
Info.AddValue("gv", (int)GeneratedCodeVersion);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return ModuleName;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// This MUST be kept in sync with EGeneratedBodyVersion enum and
|
|
/// ToGeneratedBodyVersion function in UHT defined in GeneratedCodeVersion.h.
|
|
/// </summary>
|
|
public enum EGeneratedCodeVersion
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
None,
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
V1,
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
V2,
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
VLatest = V2
|
|
};
|
|
|
|
struct UHTManifest
|
|
{
|
|
public struct Module
|
|
{
|
|
public string Name;
|
|
public string ModuleType;
|
|
public string BaseDirectory;
|
|
public string IncludeBase; // The include path which all UHT-generated includes should be relative to
|
|
public string OutputDirectory;
|
|
public List<string> ClassesHeaders;
|
|
public List<string> PublicHeaders;
|
|
public List<string> PrivateHeaders;
|
|
public string PCH;
|
|
public string GeneratedCPPFilenameBase;
|
|
public bool SaveExportedHeaders;
|
|
public EGeneratedCodeVersion UHTGeneratedCodeVersion;
|
|
|
|
public override string ToString()
|
|
{
|
|
return Name;
|
|
}
|
|
}
|
|
|
|
public UHTManifest(UEBuildTarget Target, string InRootLocalPath, string InRootBuildPath, IEnumerable<UHTModuleInfo> ModuleInfo, bool bUsePrecompiled)
|
|
{
|
|
IsGameTarget = (Target.TargetType != TargetType.Program);
|
|
RootLocalPath = InRootLocalPath;
|
|
RootBuildPath = InRootBuildPath;
|
|
TargetName = Target.GetTargetName();
|
|
|
|
Modules = ModuleInfo.Select(Info => new Module
|
|
{
|
|
Name = Info.ModuleName,
|
|
ModuleType = Info.ModuleType,
|
|
BaseDirectory = Info.ModuleDirectory.FullName,
|
|
IncludeBase = Info.ModuleDirectory.FullName,
|
|
OutputDirectory = Path.GetDirectoryName(Info.GeneratedCPPFilenameBase),
|
|
ClassesHeaders = Info.PublicUObjectClassesHeaders.Select((Header) => Header.AbsolutePath).ToList(),
|
|
PublicHeaders = Info.PublicUObjectHeaders.Select((Header) => Header.AbsolutePath).ToList(),
|
|
PrivateHeaders = Info.PrivateUObjectHeaders.Select((Header) => Header.AbsolutePath).ToList(),
|
|
PCH = Info.PCH,
|
|
GeneratedCPPFilenameBase = Info.GeneratedCPPFilenameBase,
|
|
SaveExportedHeaders = !bUsePrecompiled || !Info.ModuleDirectory.IsUnderDirectory(UnrealBuildTool.EngineDirectory),
|
|
UHTGeneratedCodeVersion = Info.GeneratedCodeVersion,
|
|
}).ToList();
|
|
}
|
|
|
|
public bool IsGameTarget; // True if the current target is a game target
|
|
public string RootLocalPath; // The engine path on the local machine
|
|
public string RootBuildPath; // The engine path on the build machine, if different (e.g. Mac/iOS builds)
|
|
public string TargetName; // Name of the target currently being compiled
|
|
public List<Module> Modules;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// This handles all running of the UnrealHeaderTool
|
|
/// </summary>
|
|
class ExternalExecution
|
|
{
|
|
/// <summary>
|
|
/// Generates a UHTModuleInfo for a particular named module under a directory.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static UHTModuleInfo CreateUHTModuleInfo(IEnumerable<string> HeaderFilenames, string ModuleName, DirectoryReference ModuleDirectory, UHTModuleType ModuleType, EGeneratedCodeVersion GeneratedCodeVersion)
|
|
{
|
|
DirectoryReference ClassesFolder = DirectoryReference.Combine(ModuleDirectory, "Classes");
|
|
DirectoryReference PublicFolder = DirectoryReference.Combine(ModuleDirectory, "Public");
|
|
|
|
List<FileItem> AllClassesHeaders = new List<FileItem>();
|
|
List<FileItem> PublicUObjectHeaders = new List<FileItem>();
|
|
List<FileItem> PrivateUObjectHeaders = new List<FileItem>();
|
|
|
|
foreach (string Header in HeaderFilenames)
|
|
{
|
|
// Check to see if we know anything about this file. If we have up-to-date cached information about whether it has
|
|
// UObjects or not, we can skip doing a test here.
|
|
FileItem UObjectHeaderFileItem = FileItem.GetExistingItemByPath(Header);
|
|
|
|
if (CPPHeaders.DoesFileContainUObjects(UObjectHeaderFileItem.AbsolutePath))
|
|
{
|
|
if (new FileReference(UObjectHeaderFileItem.AbsolutePath).IsUnderDirectory(ClassesFolder))
|
|
{
|
|
AllClassesHeaders.Add(UObjectHeaderFileItem);
|
|
}
|
|
else if (new FileReference(UObjectHeaderFileItem.AbsolutePath).IsUnderDirectory(PublicFolder))
|
|
{
|
|
PublicUObjectHeaders.Add(UObjectHeaderFileItem);
|
|
}
|
|
else
|
|
{
|
|
PrivateUObjectHeaders.Add(UObjectHeaderFileItem);
|
|
}
|
|
}
|
|
}
|
|
|
|
UHTModuleInfo Result = new UHTModuleInfo
|
|
{
|
|
ModuleName = ModuleName,
|
|
ModuleDirectory = ModuleDirectory,
|
|
ModuleType = ModuleType.ToString(),
|
|
PublicUObjectClassesHeaders = AllClassesHeaders,
|
|
PublicUObjectHeaders = PublicUObjectHeaders,
|
|
PrivateUObjectHeaders = PrivateUObjectHeaders,
|
|
GeneratedCodeVersion = GeneratedCodeVersion
|
|
};
|
|
|
|
return Result;
|
|
}
|
|
|
|
static ExternalExecution()
|
|
{
|
|
}
|
|
|
|
public static UHTModuleType GetEngineModuleTypeFromDescriptor(ModuleDescriptor Module)
|
|
{
|
|
UHTModuleType? Type = UHTModuleTypeExtensions.EngineModuleTypeFromHostType(Module.Type);
|
|
if (Type == null)
|
|
{
|
|
throw new BuildException("Unhandled engine module type {0}", Module.Type.ToString());
|
|
}
|
|
return Type.GetValueOrDefault();
|
|
}
|
|
|
|
public static UHTModuleType GetGameModuleTypeFromDescriptor(ModuleDescriptor Module)
|
|
{
|
|
UHTModuleType? Type = UHTModuleTypeExtensions.GameModuleTypeFromHostType(Module.Type);
|
|
if (Type == null)
|
|
{
|
|
throw new BuildException("Unhandled game module type {0}", Module.Type.ToString());
|
|
}
|
|
return Type.GetValueOrDefault();
|
|
}
|
|
|
|
public static UHTModuleType? GetEngineModuleTypeBasedOnLocation(FileReference ModuleFileName)
|
|
{
|
|
if (ModuleFileName.IsUnderDirectory(UnrealBuildTool.EngineSourceRuntimeDirectory))
|
|
{
|
|
return UHTModuleType.EngineRuntime;
|
|
}
|
|
|
|
if (ModuleFileName.IsUnderDirectory(UnrealBuildTool.EngineSourceDeveloperDirectory))
|
|
{
|
|
return UHTModuleType.EngineDeveloper;
|
|
}
|
|
|
|
if (ModuleFileName.IsUnderDirectory(UnrealBuildTool.EngineSourceEditorDirectory))
|
|
{
|
|
return UHTModuleType.EngineEditor;
|
|
}
|
|
|
|
if (ModuleFileName.IsUnderDirectory(UnrealBuildTool.EngineSourceProgramsDirectory))
|
|
{
|
|
return UHTModuleType.Program;
|
|
}
|
|
|
|
if (ModuleFileName.IsUnderDirectory(UnrealBuildTool.EngineSourceThirdPartyDirectory))
|
|
{
|
|
return UHTModuleType.EngineThirdParty;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns a copy of Nodes sorted by dependency. Independent or circularly-dependent nodes should
|
|
/// remain in their same relative order within the original Nodes sequence.
|
|
/// </summary>
|
|
/// <param name="NodeList">The list of nodes to sort.</param>
|
|
public static void StableTopologicalSort(List<UEBuildModuleCPP> NodeList)
|
|
{
|
|
int NodeCount = NodeList.Count;
|
|
|
|
Dictionary<UEBuildModule, HashSet<UEBuildModule>> Cache = new Dictionary<UEBuildModule, HashSet<UEBuildModule>>();
|
|
|
|
for (int Index1 = 0; Index1 != NodeCount; ++Index1)
|
|
{
|
|
UEBuildModuleCPP Node1 = NodeList[Index1];
|
|
|
|
for (int Index2 = 0; Index2 != Index1; ++Index2)
|
|
{
|
|
UEBuildModuleCPP Node2 = NodeList[Index2];
|
|
|
|
if (IsDependency(Node2, Node1, Cache) && !IsDependency(Node1, Node2, Cache))
|
|
{
|
|
// Rotate element at Index1 into position at Index2
|
|
for (int Index3 = Index1; Index3 != Index2; )
|
|
{
|
|
--Index3;
|
|
NodeList[Index3 + 1] = NodeList[Index3];
|
|
}
|
|
NodeList[Index2] = Node1;
|
|
|
|
// Break out of this loop, because this iteration must have covered all existing cases
|
|
// involving the node formerly at position Index1
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests whether one module has a dependency on another
|
|
/// </summary>
|
|
/// <param name="FromModule">The module to test</param>
|
|
/// <param name="ToModule">The module to look for a dependency</param>
|
|
/// <param name="Cache">Cache mapping module to all its dependencies</param>
|
|
/// <returns>True if ToModule is a dependency of FromModule, false otherwise</returns>
|
|
static bool IsDependency(UEBuildModuleCPP FromModule, UEBuildModuleCPP ToModule, Dictionary<UEBuildModule, HashSet<UEBuildModule>> Cache)
|
|
{
|
|
HashSet<UEBuildModule> Dependencies;
|
|
if(!Cache.TryGetValue(FromModule, out Dependencies))
|
|
{
|
|
Dependencies = new HashSet<UEBuildModule>();
|
|
FromModule.GetAllDependencyModules(new List<UEBuildModule>(), Dependencies, true, true, false);
|
|
Cache.Add(FromModule, Dependencies);
|
|
}
|
|
return Dependencies.Contains(ToModule);
|
|
}
|
|
|
|
public static void SetupUObjectModules(IEnumerable<UEBuildModuleCPP> ModulesToGenerateHeadersFor, ReadOnlyTargetRules Target, CppCompileEnvironment GlobalCompileEnvironment, List<UHTModuleInfo> UObjectModules, Dictionary<string, FlatModuleCsDataType> FlatModuleCsData, EGeneratedCodeVersion GeneratedCodeVersion)
|
|
{
|
|
DateTime UObjectDiscoveryStartTime = DateTime.UtcNow;
|
|
|
|
// Sort modules by type, then by dependency
|
|
List<UEBuildModuleCPP> ModulesSortedByType = ModulesToGenerateHeadersFor.OrderBy(c => c.Type).ToList();
|
|
StableTopologicalSort(ModulesSortedByType);
|
|
|
|
foreach (UEBuildModuleCPP Module in ModulesSortedByType)
|
|
{
|
|
UEBuildModuleCPP.UHTModuleInfoCacheType UHTModuleInfo = Module.GetCachedUHTModuleInfo(GeneratedCodeVersion);
|
|
if (UHTModuleInfo.Info.PublicUObjectClassesHeaders.Count > 0 || UHTModuleInfo.Info.PrivateUObjectHeaders.Count > 0 || UHTModuleInfo.Info.PublicUObjectHeaders.Count > 0)
|
|
{
|
|
// If we've got this far and there are no source files then it's likely we're installed and ignoring
|
|
// engine files, so we don't need a .generated.cpp either
|
|
UEBuildModuleCPP.AutoGenerateCppInfoClass.BuildInfoClass BuildInfo = null;
|
|
UHTModuleInfo.Info.GeneratedCPPFilenameBase = Path.Combine(Module.GeneratedCodeDirectory.FullName, UHTModuleInfo.Info.ModuleName) + ".generated";
|
|
if (Module.SourceFilesToBuild.Count != 0)
|
|
{
|
|
BuildInfo = new UEBuildModuleCPP.AutoGenerateCppInfoClass.BuildInfoClass(UHTModuleInfo.Info.GeneratedCPPFilenameBase + "*.cpp");
|
|
}
|
|
|
|
Module.AutoGenerateCppInfo = new UEBuildModuleCPP.AutoGenerateCppInfoClass(BuildInfo);
|
|
|
|
// If we're running in "gather" mode only, we'll go ahead and cache PCH information for each module right now, so that we don't
|
|
// have to do it in the assembling phase. It's OK for gathering to take a bit longer, even if UObject headers are not out of
|
|
// date in order to save a lot of time in the assembling runs.
|
|
UHTModuleInfo.Info.PCH = "";
|
|
if (UnrealBuildTool.IsGatheringBuild && !UnrealBuildTool.IsAssemblingBuild)
|
|
{
|
|
// We need to figure out which PCH header this module is including, so that UHT can inject an include statement for it into any .cpp files it is synthesizing
|
|
CppCompileEnvironment ModuleCompileEnvironment = Module.CreateModuleCompileEnvironment(Target, GlobalCompileEnvironment);
|
|
Module.CachePCHUsageForModuleSourceFiles(Target, ModuleCompileEnvironment);
|
|
if (Module.ProcessedDependencies.UniquePCHHeaderFile != null)
|
|
{
|
|
UHTModuleInfo.Info.PCH = Module.ProcessedDependencies.UniquePCHHeaderFile.AbsolutePath;
|
|
}
|
|
}
|
|
|
|
UObjectModules.Add(UHTModuleInfo.Info);
|
|
FlatModuleCsData[Module.Name].ModuleSourceFolder = Module.ModuleDirectory;
|
|
FlatModuleCsData[Module.Name].UHTHeaderNames = UHTModuleInfo.HeaderFilenames.ToList();
|
|
Log.TraceVerbose("Detected UObject module: " + UHTModuleInfo.Info.ModuleName);
|
|
}
|
|
else
|
|
{
|
|
// Remove any stale generated code directory
|
|
if(Module.GeneratedCodeDirectory != null && (!UnrealBuildTool.IsEngineInstalled() || !Module.GeneratedCodeDirectory.IsUnderDirectory(UnrealBuildTool.EngineDirectory)))
|
|
{
|
|
if (DirectoryReference.Exists(Module.GeneratedCodeDirectory))
|
|
{
|
|
Log.TraceVerbose("Deleting stale generated code directory: " + Module.GeneratedCodeDirectory.ToString());
|
|
Directory.Delete(Module.GeneratedCodeDirectory.FullName, true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (UnrealBuildTool.bPrintPerformanceInfo)
|
|
{
|
|
double UObjectDiscoveryTime = (DateTime.UtcNow - UObjectDiscoveryStartTime).TotalSeconds;
|
|
Console.WriteLine("UObject discovery time: " + UObjectDiscoveryTime + "s");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets UnrealHeaderTool.exe path. Does not care if UnrealheaderTool was build as a monolithic exe or not.
|
|
/// </summary>
|
|
static string GetHeaderToolPath()
|
|
{
|
|
UnrealTargetConfiguration Config = BuildConfiguration.bForceDebugUnrealHeaderTool ? UnrealTargetConfiguration.Debug : UnrealTargetConfiguration.Development;
|
|
|
|
string ReceiptFileName = TargetReceipt.GetDefaultPath(UnrealBuildTool.EngineDirectory.FullName, "UnrealHeaderTool", BuildHostPlatform.Current.Platform, Config, "");
|
|
TargetReceipt Receipt = TargetReceipt.Read(ReceiptFileName);
|
|
Receipt.ExpandPathVariables(UnrealBuildTool.EngineDirectory, UnrealBuildTool.EngineDirectory);
|
|
|
|
string HeaderToolPath = Receipt.BuildProducts[0].Path;
|
|
return HeaderToolPath;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the latest write time of any of the UnrealHeaderTool binaries (including DLLs and Plugins) or DateTime.MaxValue if UnrealHeaderTool does not exist
|
|
/// </summary>
|
|
/// <returns>
|
|
/// Latest timestamp of UHT binaries or DateTime.MaxValue if UnrealHeaderTool is out of date and needs to be rebuilt.
|
|
/// </returns>
|
|
static bool GetHeaderToolTimestamp(out DateTime Timestamp)
|
|
{
|
|
using (ScopedTimer TimestampTimer = new ScopedTimer("GetHeaderToolTimestamp"))
|
|
{
|
|
// Try to read the receipt for UHT.
|
|
string ReceiptPath = TargetReceipt.GetDefaultPath(UnrealBuildTool.EngineDirectory.FullName, "UnrealHeaderTool", BuildHostPlatform.Current.Platform, UnrealTargetConfiguration.Development, null);
|
|
if (!File.Exists(ReceiptPath))
|
|
{
|
|
Timestamp = DateTime.MaxValue;
|
|
return false;
|
|
}
|
|
|
|
TargetReceipt Receipt;
|
|
if (!TargetReceipt.TryRead(ReceiptPath, out Receipt))
|
|
{
|
|
Timestamp = DateTime.MaxValue;
|
|
return false;
|
|
}
|
|
Receipt.ExpandPathVariables(UnrealBuildTool.EngineDirectory, UnrealBuildTool.EngineDirectory);
|
|
|
|
// Check all the binaries exist, and that all the DLLs are built against the right version
|
|
if (!CheckBinariesExist(Receipt) || !CheckDynamicLibaryVersionsMatch(Receipt))
|
|
{
|
|
Timestamp = DateTime.MaxValue;
|
|
return false;
|
|
}
|
|
|
|
// Return the timestamp for all the binaries
|
|
Timestamp = GetTimestampFromBinaries(Receipt);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Checks if all the files in a receipt are present and that all the DLLs are at the same version
|
|
/// </summary>
|
|
/// <returns>
|
|
/// True if all the files are valid.
|
|
/// </returns>
|
|
static bool CheckBinariesExist(TargetReceipt Receipt)
|
|
{
|
|
bool bExist = true;
|
|
foreach (BuildProduct BuildProduct in Receipt.BuildProducts)
|
|
{
|
|
if (BuildProduct.Type == BuildProductType.Executable || BuildProduct.Type == BuildProductType.DynamicLibrary)
|
|
{
|
|
if (!File.Exists(BuildProduct.Path))
|
|
{
|
|
Log.TraceWarning("Missing binary: {0}", BuildProduct.Path);
|
|
bExist = false;
|
|
}
|
|
}
|
|
}
|
|
return bExist;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Checks if all the files in a receipt have the same version
|
|
/// </summary>
|
|
/// <returns>
|
|
/// True if all the files are valid.
|
|
/// </returns>
|
|
static bool CheckDynamicLibaryVersionsMatch(TargetReceipt Receipt)
|
|
{
|
|
List<Tuple<string, int>> BinaryVersions = new List<Tuple<string, int>>();
|
|
foreach (BuildProduct BuildProduct in Receipt.BuildProducts)
|
|
{
|
|
if (BuildProduct.Type == BuildProductType.DynamicLibrary)
|
|
{
|
|
int Version = BuildHostPlatform.Current.GetDllApiVersion(BuildProduct.Path);
|
|
BinaryVersions.Add(new Tuple<string, int>(BuildProduct.Path, Version));
|
|
}
|
|
}
|
|
|
|
bool bMatch = true;
|
|
if (BinaryVersions.Count > 0 && !BinaryVersions.All(x => x.Item2 == BinaryVersions[0].Item2))
|
|
{
|
|
Log.TraceWarning("Detected mismatch in binary versions:");
|
|
foreach (Tuple<string, int> BinaryVersion in BinaryVersions)
|
|
{
|
|
Log.TraceWarning(" {0} has API version {1}", BinaryVersion.Item1, BinaryVersion.Item2);
|
|
File.Delete(BinaryVersion.Item1);
|
|
}
|
|
bMatch = false;
|
|
}
|
|
return bMatch;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Checks if all the files in a receipt are present and that all the DLLs are at the same version
|
|
/// </summary>
|
|
/// <returns>
|
|
/// True if all the files are valid.
|
|
/// </returns>
|
|
static DateTime GetTimestampFromBinaries(TargetReceipt Receipt)
|
|
{
|
|
DateTime LatestWriteTime = DateTime.MinValue;
|
|
foreach (BuildProduct BuildProduct in Receipt.BuildProducts)
|
|
{
|
|
if (BuildProduct.Type == BuildProductType.Executable || BuildProduct.Type == BuildProductType.DynamicLibrary)
|
|
{
|
|
DateTime WriteTime = File.GetLastWriteTime(BuildProduct.Path);
|
|
if (WriteTime > LatestWriteTime)
|
|
{
|
|
LatestWriteTime = WriteTime;
|
|
}
|
|
}
|
|
}
|
|
return LatestWriteTime;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the timestamp of CoreUObject.generated.cpp file.
|
|
/// </summary>
|
|
/// <returns>Last write time of CoreUObject.generated.cpp or DateTime.MaxValue if it doesn't exist.</returns>
|
|
private static DateTime GetCoreGeneratedTimestamp(string ModuleName, string ModuleGeneratedCodeDirectory)
|
|
{
|
|
// In Installed Builds, we don't check the timestamps on engine headers. Default to a very old date.
|
|
if (UnrealBuildTool.IsEngineInstalled())
|
|
{
|
|
return DateTime.MinValue;
|
|
}
|
|
|
|
// Otherwise look for CoreUObject.generated.cpp or CoreUObject.generated.1.cpp
|
|
string[] Suffixes = { ".generated.cpp", ".generated.1.cpp" };
|
|
foreach(string Suffix in Suffixes)
|
|
{
|
|
FileInfo CoreGeneratedFileInfo = new FileInfo(Path.Combine(ModuleGeneratedCodeDirectory, ModuleName + Suffix));
|
|
if (CoreGeneratedFileInfo.Exists)
|
|
{
|
|
return CoreGeneratedFileInfo.LastWriteTime;
|
|
}
|
|
}
|
|
|
|
// Doesn't exist, so use a 'newer that everything' date to force rebuild headers.
|
|
return DateTime.MaxValue;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Checks the class header files and determines if generated UObject code files are out of date in comparison.
|
|
/// </summary>
|
|
/// <param name="UObjectModules">Modules that we generate headers for</param>
|
|
/// <param name="HeaderToolTimestamp">Timestamp for UHT</param>
|
|
/// <param name="bUsePrecompiled">Whether to use precompiled engine modules</param>
|
|
/// <returns> True if the code files are out of date</returns>
|
|
private static bool AreGeneratedCodeFilesOutOfDate(List<UHTModuleInfo> UObjectModules, DateTime HeaderToolTimestamp, bool bUsePrecompiled)
|
|
{
|
|
// Get CoreUObject.generated.cpp timestamp. If the source files are older than the CoreUObject generated code, we'll
|
|
// need to regenerate code for the module
|
|
DateTime? CoreGeneratedTimestamp = null;
|
|
{
|
|
// Find the CoreUObject module
|
|
foreach (UHTModuleInfo Module in UObjectModules)
|
|
{
|
|
if (Module.ModuleName.Equals("CoreUObject", StringComparison.InvariantCultureIgnoreCase))
|
|
{
|
|
CoreGeneratedTimestamp = GetCoreGeneratedTimestamp(Module.ModuleName, Path.GetDirectoryName(Module.GeneratedCPPFilenameBase));
|
|
break;
|
|
}
|
|
}
|
|
if (CoreGeneratedTimestamp == null)
|
|
{
|
|
throw new BuildException("Could not find CoreUObject in list of all UObjectModules");
|
|
}
|
|
}
|
|
|
|
|
|
foreach (UHTModuleInfo Module in UObjectModules)
|
|
{
|
|
// If we're using a precompiled engine, skip skip checking timestamps for modules that are under the engine directory
|
|
if (bUsePrecompiled && Module.ModuleDirectory.IsUnderDirectory(UnrealBuildTool.EngineDirectory))
|
|
{
|
|
continue;
|
|
}
|
|
|
|
// Make sure we have an existing folder for generated code. If not, then we definitely need to generate code!
|
|
string GeneratedCodeDirectory = Path.GetDirectoryName(Module.GeneratedCPPFilenameBase);
|
|
FileSystemInfo TestDirectory = (FileSystemInfo)new DirectoryInfo(GeneratedCodeDirectory);
|
|
if (!TestDirectory.Exists)
|
|
{
|
|
// Generated code directory is missing entirely!
|
|
Log.TraceVerbose("UnrealHeaderTool needs to run because no generated code directory was found for module {0}", Module.ModuleName);
|
|
return true;
|
|
}
|
|
|
|
// Grab our special "Timestamp" file that we saved after the last set of headers were generated. This file
|
|
// actually contains the list of source files which contained UObjects, so that we can compare to see if any
|
|
// UObject source files were deleted (or no longer contain UObjects), which means we need to run UHT even
|
|
// if no other source files were outdated
|
|
string TimestampFile = Path.Combine(GeneratedCodeDirectory, @"Timestamp");
|
|
FileSystemInfo SavedTimestampFileInfo = (FileSystemInfo)new FileInfo(TimestampFile);
|
|
if (!SavedTimestampFileInfo.Exists)
|
|
{
|
|
// Timestamp file was missing (possibly deleted/cleaned), so headers are out of date
|
|
Log.TraceVerbose("UnrealHeaderTool needs to run because UHT Timestamp file did not exist for module {0}", Module.ModuleName);
|
|
return true;
|
|
}
|
|
|
|
// Make sure the last UHT run completed after UnrealHeaderTool.exe was compiled last, and after the CoreUObject headers were touched last.
|
|
DateTime SavedTimestamp = SavedTimestampFileInfo.LastWriteTime;
|
|
if (HeaderToolTimestamp > SavedTimestamp || CoreGeneratedTimestamp > SavedTimestamp)
|
|
{
|
|
// Generated code is older than UnrealHeaderTool.exe or CoreUObject headers. Out of date!
|
|
Log.TraceVerbose("UnrealHeaderTool needs to run because UnrealHeaderTool.exe or CoreUObject headers are newer than SavedTimestamp for module {0}", Module.ModuleName);
|
|
return true;
|
|
}
|
|
|
|
// Iterate over our UObjects headers and figure out if any of them have changed
|
|
List<FileItem> AllUObjectHeaders = new List<FileItem>();
|
|
AllUObjectHeaders.AddRange(Module.PublicUObjectClassesHeaders);
|
|
AllUObjectHeaders.AddRange(Module.PublicUObjectHeaders);
|
|
AllUObjectHeaders.AddRange(Module.PrivateUObjectHeaders);
|
|
|
|
// Load up the old timestamp file and check to see if anything has changed
|
|
{
|
|
string[] UObjectFilesFromPreviousRun = File.ReadAllLines(TimestampFile);
|
|
if (AllUObjectHeaders.Count != UObjectFilesFromPreviousRun.Length)
|
|
{
|
|
Log.TraceVerbose("UnrealHeaderTool needs to run because there are a different number of UObject source files in module {0}", Module.ModuleName);
|
|
return true;
|
|
}
|
|
for (int FileIndex = 0; FileIndex < AllUObjectHeaders.Count; ++FileIndex)
|
|
{
|
|
if (!UObjectFilesFromPreviousRun[FileIndex].Equals(AllUObjectHeaders[FileIndex].AbsolutePath, StringComparison.InvariantCultureIgnoreCase))
|
|
{
|
|
Log.TraceVerbose("UnrealHeaderTool needs to run because the set of UObject source files in module {0} has changed", Module.ModuleName);
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
foreach (FileItem HeaderFile in AllUObjectHeaders)
|
|
{
|
|
DateTime HeaderFileTimestamp = HeaderFile.Info.LastWriteTime;
|
|
|
|
// Has the source header changed since we last generated headers successfully?
|
|
if (HeaderFileTimestamp > SavedTimestamp)
|
|
{
|
|
Log.TraceVerbose("UnrealHeaderTool needs to run because SavedTimestamp is older than HeaderFileTimestamp ({0}) for module {1}", HeaderFile.AbsolutePath, Module.ModuleName);
|
|
return true;
|
|
}
|
|
|
|
// When we're running in assembler mode, outdatedness cannot be inferred by checking the directory timestamp
|
|
// of the source headers. We don't care if source files were added or removed in this mode, because we're only
|
|
// able to process the known UObject headers that are in the Makefile. If UObject header files are added/removed,
|
|
// we expect the user to re-run GenerateProjectFiles which will force UBTMakefile outdatedness.
|
|
// @todo ubtmake: Possibly, we should never be doing this check these days.
|
|
if (UnrealBuildTool.IsGatheringBuild || !UnrealBuildTool.IsAssemblingBuild)
|
|
{
|
|
// Also check the timestamp on the directory the source file is in. If the directory timestamp has
|
|
// changed, new source files may have been added or deleted. We don't know whether the new/deleted
|
|
// files were actually UObject headers, but because we don't know all of the files we processed
|
|
// in the previous run, we need to assume our generated code is out of date if the directory timestamp
|
|
// is newer.
|
|
DateTime HeaderDirectoryTimestamp = new DirectoryInfo(Path.GetDirectoryName(HeaderFile.AbsolutePath)).LastWriteTime;
|
|
if (HeaderDirectoryTimestamp > SavedTimestamp)
|
|
{
|
|
Log.TraceVerbose("UnrealHeaderTool needs to run because the directory containing an existing header ({0}) has changed, and headers may have been added to or deleted from module {1}", HeaderFile.AbsolutePath, Module.ModuleName);
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Updates the intermediate include directory timestamps of all the passed in UObject modules
|
|
/// </summary>
|
|
private static void UpdateDirectoryTimestamps(List<UHTModuleInfo> UObjectModules, bool bUsePrecompiled)
|
|
{
|
|
foreach (UHTModuleInfo Module in UObjectModules)
|
|
{
|
|
string GeneratedCodeDirectory = Path.GetDirectoryName(Module.GeneratedCPPFilenameBase);
|
|
DirectoryInfo GeneratedCodeDirectoryInfo = new DirectoryInfo(GeneratedCodeDirectory);
|
|
|
|
try
|
|
{
|
|
if (GeneratedCodeDirectoryInfo.Exists)
|
|
{
|
|
// Don't write anything to the engine directory if we're running an installed build
|
|
if (bUsePrecompiled && Module.ModuleDirectory.IsUnderDirectory(UnrealBuildTool.EngineDirectory))
|
|
{
|
|
continue;
|
|
}
|
|
|
|
// Touch the include directory since we have technically 'generated' the headers
|
|
// However, the headers might not be touched at all since that would cause the compiler to recompile everything
|
|
// We can't alter the directory timestamp directly, because this may throw exceptions when the directory is
|
|
// open in visual studio or windows explorer, so instead we create a blank file that will change the timestamp for us
|
|
FileReference TimestampFile = FileReference.Combine(new DirectoryReference(GeneratedCodeDirectoryInfo.FullName), "Timestamp");
|
|
|
|
// Save all of the UObject files to a timestamp file. We'll load these on the next run to see if any new
|
|
// files with UObject classes were deleted, so that we'll know to run UHT even if the timestamps of all
|
|
// of the other source files were unchanged
|
|
{
|
|
List<string> AllUObjectFiles = new List<string>();
|
|
AllUObjectFiles.AddRange(Module.PublicUObjectClassesHeaders.ConvertAll(Item => Item.AbsolutePath));
|
|
AllUObjectFiles.AddRange(Module.PublicUObjectHeaders.ConvertAll(Item => Item.AbsolutePath));
|
|
AllUObjectFiles.AddRange(Module.PrivateUObjectHeaders.ConvertAll(Item => Item.AbsolutePath));
|
|
ResponseFile.Create(TimestampFile, AllUObjectFiles, ResponseFile.CreateOptions.WriteEvenIfUnchanged);
|
|
}
|
|
}
|
|
}
|
|
catch (Exception Exception)
|
|
{
|
|
throw new BuildException(Exception, "Couldn't touch header directories: " + Exception.Message);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Run an external exe (and capture the output), given the exe path and the commandline.
|
|
/// </summary>
|
|
public static int RunExternalExecutable(string ExePath, string Commandline)
|
|
{
|
|
ProcessStartInfo ExeInfo = new ProcessStartInfo(ExePath, Commandline);
|
|
Log.TraceVerbose("RunExternalExecutable {0} {1}", ExePath, Commandline);
|
|
ExeInfo.UseShellExecute = false;
|
|
ExeInfo.RedirectStandardOutput = true;
|
|
using (Process GameProcess = Process.Start(ExeInfo))
|
|
{
|
|
GameProcess.BeginOutputReadLine();
|
|
GameProcess.OutputDataReceived += PrintProcessOutputAsync;
|
|
GameProcess.WaitForExit();
|
|
|
|
return GameProcess.ExitCode;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Simple function to pipe output asynchronously
|
|
/// </summary>
|
|
private static void PrintProcessOutputAsync(object Sender, DataReceivedEventArgs Event)
|
|
{
|
|
// DataReceivedEventHandler is fired with a null string when the output stream is closed. We don't want to
|
|
// print anything for that event.
|
|
if (!String.IsNullOrEmpty(Event.Data))
|
|
{
|
|
Log.TraceInformation(Event.Data);
|
|
}
|
|
}
|
|
|
|
// Set to true if makefiles need invalidating
|
|
static public bool bInvalidateUHTMakefile = false;
|
|
|
|
/// <summary>
|
|
/// Builds and runs the header tool and touches the header directories.
|
|
/// Performs any early outs if headers need no changes, given the UObject modules, tool path, game name, and configuration
|
|
/// </summary>
|
|
public static bool ExecuteHeaderToolIfNecessary(BuildConfiguration BuildConfiguration, UEBuildTarget Target, CppCompileEnvironment GlobalCompileEnvironment, List<UHTModuleInfo> UObjectModules, FileReference ModuleInfoFileName, ref ECompilationResult UHTResult)
|
|
{
|
|
if (ProgressWriter.bWriteMarkup)
|
|
{
|
|
Log.WriteLine(LogEventType.Console, "@progress push 5%");
|
|
}
|
|
using (ProgressWriter Progress = new ProgressWriter("Generating code...", false))
|
|
{
|
|
// We never want to try to execute the header tool when we're already trying to build it!
|
|
bool bIsBuildingUHT = Target.GetTargetName().Equals("UnrealHeaderTool", StringComparison.InvariantCultureIgnoreCase);
|
|
|
|
string RootLocalPath = UnrealBuildTool.RootDirectory.FullName;
|
|
|
|
// check if UHT is out of date
|
|
DateTime HeaderToolTimestamp = DateTime.MaxValue;
|
|
bool bHaveHeaderTool = !bIsBuildingUHT && GetHeaderToolTimestamp(out HeaderToolTimestamp);
|
|
|
|
// ensure the headers are up to date
|
|
bool bUHTNeedsToRun = (BuildConfiguration.bForceHeaderGeneration == true || !bHaveHeaderTool || AreGeneratedCodeFilesOutOfDate(UObjectModules, HeaderToolTimestamp, Target.bUsePrecompiled));
|
|
if (bUHTNeedsToRun || UnrealBuildTool.IsGatheringBuild)
|
|
{
|
|
// Since code files are definitely out of date, we'll now finish computing information about the UObject modules for UHT. We
|
|
// want to save this work until we know that UHT actually needs to be run to speed up best-case iteration times.
|
|
if (UnrealBuildTool.IsGatheringBuild) // In assembler-only mode, PCH info is loaded from our UBTMakefile!
|
|
{
|
|
foreach (UHTModuleInfo UHTModuleInfo in UObjectModules)
|
|
{
|
|
// Only cache the PCH name if we don't already have one. When running in 'gather only' mode, this will have already been cached
|
|
if (string.IsNullOrEmpty(UHTModuleInfo.PCH))
|
|
{
|
|
UHTModuleInfo.PCH = "";
|
|
|
|
// We need to figure out which PCH header this module is including, so that UHT can inject an include statement for it into any .cpp files it is synthesizing
|
|
UEBuildModuleCPP DependencyModuleCPP = (UEBuildModuleCPP)Target.GetModuleByName(UHTModuleInfo.ModuleName);
|
|
CppCompileEnvironment ModuleCompileEnvironment = DependencyModuleCPP.CreateModuleCompileEnvironment(Target.Rules, GlobalCompileEnvironment);
|
|
DependencyModuleCPP.CachePCHUsageForModuleSourceFiles(Target.Rules, ModuleCompileEnvironment);
|
|
if (DependencyModuleCPP.ProcessedDependencies != null && DependencyModuleCPP.ProcessedDependencies.UniquePCHHeaderFile != null)
|
|
{
|
|
UHTModuleInfo.PCH = DependencyModuleCPP.ProcessedDependencies.UniquePCHHeaderFile.AbsolutePath;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// @todo ubtmake: Optimization: Ideally we could avoid having to generate this data in the case where UHT doesn't even need to run! Can't we use the existing copy? (see below use of Manifest)
|
|
UHTManifest Manifest = new UHTManifest(Target, RootLocalPath, UEBuildPlatform.GetBuildPlatform(Target.Platform).ConvertPath(RootLocalPath + '\\'), UObjectModules, Target.bUsePrecompiled);
|
|
|
|
if (!bIsBuildingUHT && bUHTNeedsToRun)
|
|
{
|
|
// Always build UnrealHeaderTool if header regeneration is required, unless we're running within an installed ecosystem or hot-reloading
|
|
if (UnrealBuildTool.IsEngineInstalled() == false &&
|
|
BuildConfiguration.bDoNotBuildUHT == false &&
|
|
BuildConfiguration.bHotReloadFromIDE == false &&
|
|
!(bHaveHeaderTool && !UnrealBuildTool.IsGatheringBuild && UnrealBuildTool.IsAssemblingBuild)) // If running in "assembler only" mode, we assume UHT is already up to date for much faster iteration!
|
|
{
|
|
// If it is out of date or not there it will be built.
|
|
// If it is there and up to date, it will add 0.8 seconds to the build time.
|
|
Log.TraceInformation("Building UnrealHeaderTool...");
|
|
|
|
StringBuilder UBTArguments = new StringBuilder();
|
|
|
|
UBTArguments.Append("UnrealHeaderTool");
|
|
|
|
// Which desktop platform do we need to compile UHT for?
|
|
UBTArguments.Append(" " + BuildHostPlatform.Current.Platform.ToString());
|
|
|
|
// NOTE: We force Development configuration for UHT so that it runs quickly, even when compiling debug, unless we say so explicitly
|
|
if (BuildConfiguration.bForceDebugUnrealHeaderTool)
|
|
{
|
|
UBTArguments.Append(" " + UnrealTargetConfiguration.Debug.ToString());
|
|
}
|
|
else
|
|
{
|
|
UBTArguments.Append(" " + UnrealTargetConfiguration.Development.ToString());
|
|
}
|
|
|
|
// NOTE: We disable mutex when launching UBT from within UBT to compile UHT
|
|
UBTArguments.Append(" -NoMutex");
|
|
|
|
if (!BuildConfiguration.bAllowXGE)
|
|
{
|
|
UBTArguments.Append(" -noxge");
|
|
}
|
|
|
|
// Always ignore the junk manifest on recursive invocations; it will have been run by this process if necessary
|
|
UBTArguments.Append(" -ignorejunk");
|
|
|
|
// Add UHT plugins to UBT command line as external plugins
|
|
if (Target.UnrealHeaderToolPlugins != null && Target.UnrealHeaderToolPlugins.Count > 0)
|
|
{
|
|
foreach (PluginInfo Plugin in Target.UnrealHeaderToolPlugins)
|
|
{
|
|
UBTArguments.Append(" -PLUGIN \"" + Plugin.File + "\"");
|
|
}
|
|
}
|
|
|
|
if (RunExternalExecutable(UnrealBuildTool.GetUBTPath(), UBTArguments.ToString()) != 0)
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
Progress.Write(1, 3);
|
|
|
|
string ActualTargetName = String.IsNullOrEmpty(Target.GetTargetName()) ? "UE4" : Target.GetTargetName();
|
|
Log.TraceInformation("Parsing headers for {0}", ActualTargetName);
|
|
|
|
string HeaderToolPath = GetHeaderToolPath();
|
|
if (!File.Exists(HeaderToolPath))
|
|
{
|
|
throw new BuildException("Unable to generate headers because UnrealHeaderTool binary was not found ({0}).", Path.GetFullPath(HeaderToolPath));
|
|
}
|
|
|
|
// Disable extensions when serializing to remove the $type fields
|
|
Directory.CreateDirectory(ModuleInfoFileName.Directory.FullName);
|
|
System.IO.File.WriteAllText(ModuleInfoFileName.FullName, fastJSON.JSON.Instance.ToJSON(Manifest, new fastJSON.JSONParameters { UseExtensions = false }));
|
|
|
|
string CmdLine = (Target.ProjectFile != null) ? "\"" + Target.ProjectFile.FullName + "\"" : Target.GetTargetName();
|
|
CmdLine += " \"" + ModuleInfoFileName + "\" -LogCmds=\"loginit warning, logexit warning, logdatabase error\" -Unattended -WarningsAsErrors";
|
|
if (UnrealBuildTool.IsEngineInstalled())
|
|
{
|
|
CmdLine += " -installed";
|
|
}
|
|
|
|
if (BuildConfiguration.bFailIfGeneratedCodeChanges)
|
|
{
|
|
CmdLine += " -FailIfGeneratedCodeChanges";
|
|
}
|
|
|
|
if (!bInvalidateUHTMakefile && BuildConfiguration.bUseUHTMakefiles)
|
|
{
|
|
CmdLine += " -UseMakefiles";
|
|
}
|
|
|
|
if (Target.Rules != null && !Target.Rules.bCompileAgainstEngine)
|
|
{
|
|
CmdLine += " -NoEnginePlugins";
|
|
}
|
|
|
|
Log.TraceInformation(" Running UnrealHeaderTool {0}", CmdLine);
|
|
|
|
Stopwatch s = new Stopwatch();
|
|
s.Start();
|
|
UHTResult = (ECompilationResult)RunExternalExecutable(ExternalExecution.GetHeaderToolPath(), CmdLine);
|
|
s.Stop();
|
|
|
|
if (UHTResult != ECompilationResult.Succeeded)
|
|
{
|
|
// On Linux and Mac, the shell will return 128+signal number exit codes if UHT gets a signal (e.g. crashes or is interrupted)
|
|
if ((BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Linux ||
|
|
BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Mac) &&
|
|
(int)(UHTResult) >= 128
|
|
)
|
|
{
|
|
// SIGINT is 2, so 128 + SIGINT is 130
|
|
UHTResult = ((int)(UHTResult) == 130) ? ECompilationResult.Canceled : ECompilationResult.CrashOrAssert;
|
|
}
|
|
|
|
if ((BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Win32 ||
|
|
BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Win64) &&
|
|
(int)(UHTResult) < 0)
|
|
{
|
|
Log.TraceInformation(String.Format("UnrealHeaderTool failed with exit code 0x{0:X} - check that UE4 prerequisites are installed.", (int)UHTResult));
|
|
}
|
|
return false;
|
|
}
|
|
|
|
Log.TraceInformation("Reflection code generated for {0} in {1} seconds", ActualTargetName, s.Elapsed.TotalSeconds);
|
|
if (UnrealBuildTool.bPrintPerformanceInfo)
|
|
{
|
|
Log.TraceInformation("UnrealHeaderTool took {1}", ActualTargetName, (double)s.ElapsedMilliseconds / 1000.0);
|
|
}
|
|
|
|
// Now that UHT has successfully finished generating code, we need to update all cached FileItems in case their last write time has changed.
|
|
// Otherwise UBT might not detect changes UHT made.
|
|
DateTime StartTime = DateTime.UtcNow;
|
|
FileItem.ResetInfos();
|
|
double ResetDuration = (DateTime.UtcNow - StartTime).TotalSeconds;
|
|
Log.TraceVerbose("FileItem.ResetInfos() duration: {0}s", ResetDuration);
|
|
}
|
|
else
|
|
{
|
|
Log.TraceVerbose("Generated code is up to date.");
|
|
}
|
|
|
|
Progress.Write(2, 3);
|
|
|
|
// There will never be generated code if we're building UHT, so this should never be called.
|
|
if (!bIsBuildingUHT)
|
|
{
|
|
// Allow generated code to be sync'd to remote machines if needed. This needs to be done even if UHT did not run because
|
|
// generated headers include other generated headers using absolute paths which in case of building remotely are already
|
|
// the remote machine absolute paths. Because of that parsing headers will not result in finding all includes properly.
|
|
// @todo ubtmake: Need to figure out what this does in the assembler case, and whether we need to run it
|
|
UEBuildPlatform.GetBuildPlatform(Target.Platform).PostCodeGeneration(Manifest);
|
|
}
|
|
|
|
// touch the directories
|
|
UpdateDirectoryTimestamps(UObjectModules, Target.bUsePrecompiled);
|
|
|
|
Progress.Write(3, 3);
|
|
}
|
|
if (ProgressWriter.bWriteMarkup)
|
|
{
|
|
Log.WriteLine(LogEventType.Console, "@progress pop");
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
}
|