Commit Graph

5647 Commits

Author SHA1 Message Date
leon huang
721ed16c42 Unreal Build Tool:
Update PluginDescriptor to have parity with FPluginDescriptor in terms of handling custom JSON fields. The order in which the original fields are written to disk is preserved.
When saving the PluginDescriptor to disk, the same order is followed and any new entries are added to the end of the plugin file.
Note: PluginDescriptor.Save and PluginDescriptor.Save2 will exist concurrently for now. There are still parts of UBT that use PluginDescriptor.Write and the refactor to create a unified Save function will come later as a lot of testing still needs to be done.
JsonObject:
- Introduced AddOrSetFieldValue() methods overloaded on value types to add/set fields in JsonObject.
- Changed the underlying data structure of JsonObject from Dictionary<string,Object?> to OrderedDictionary to guarantee that order of all .uplugin fields (default and custom) are preserved
- Made the JsonObject constructor that takes an OrderedDictionary private to ensure type safety of values passed to JsonObject
- Introduced ToJsonString() for JsonObject that serializes the JsonObject to match the formatting of .uplugin
IMPORTANT: The ToJsonString() method uses the JavaScriptEncoder.UnsafeRelaxedJsonEscaping encoder for Utf8JsonWriter.
This allows +,<,>,&,` etc characters to be written properly for .uplugins. As per MS docs, with this encoding, none of the contents should be written to HTML or a script.
- Introduced JsonObjectTests that unit tested JsonObject to ensure previous behavior was maintained.
- Ensured that keys for the JsonObject are processed in a case insensitive and culture independent way.

PluginDescriptor
- Added a JsonObject field that acts as the cache of all fields that were read from a file or parsed from a json string.
- Cached JsonObject records the order of all fields that were read and captures custom fields in the .uplugin
- Introduced Save2(), the new save algorithm that writes all fields (default and custom) to disk.
- Deleted the private default constructor because it didn't seem to be used anywhere.
- Introduced PluginDescriptorTests to ensure previous behavior is maintained. In particular when dealing with a .uplugin with only default fields, results of Save() and Save2() are the same.

Descriptor Files:
- Introduced ToJsonObject() methods to replace the previous JsonWriter patterns of writing the descriptor data.
- Introduced the UpdateJsonObject pattern which mimics the old WriteArray pattern of writing data to a JsonWriter.

#rb: Mark.Winter, Joe.Kirchoff
#jira: none
#test: Developed this in a TDD style with unit tests for all the major functions. Also reviewed output of created .uplugins and diffed them.

[CL 26920712 by leon huang in ue5-main branch]
2023-08-08 12:52:41 -04:00
chris constantinescu
199373a78d UBT new plugin test - generate solution doesn't include create new target
#rb Jerome.Delattre, Eric.Day
#jira UE-192402

[CL 26919864 by chris constantinescu in ue5-main branch]
2023-08-08 12:26:25 -04:00
dmytro ivanov
a73d0e1f9f Enable support for non-4k virtual page sizes on Android, part 1
#jira UE-192126
#rb Chris.Babcock

[CL 26911522 by dmytro ivanov in ue5-main branch]
2023-08-08 04:17:39 -04:00
chris babcock
d43d1225fe Support resizeability for foldable devices / multiscreen
#jira UE-168578
#android
[REVIEW] [at]Jack.Porter
#rb Jack.Porter

[CL 26910173 by chris babcock in ue5-main branch]
2023-08-07 23:01:55 -04:00
andrew grant
8168aa1717 Change UBT limiting of actions based on memory to use total ram on Mac instead of free ram.
This addresses issues with CPU resources on Mac going under utilized on systems where total RAM is only 2-3x the number of cores (e.g 8c/16GB, 10c/32GB) and the user has applications running (UE, XCode, browsers) that are occupying RAM.

Historically this check limited actions based on free memory to ensure action processes weren't forced to use swap, but there's strong evidence that limiting based on total system memory and relying on the OS to swap out other processes to make room is fine. That said only Mac has been extensively tested here in this scenario (and tends to have faster disk performance than other platforms). So for now we'll change Mac and leave Windows/Linux using the old behavior

Tests -

* Ran on an M1 8c/16GB Mac with Xcode & UE open and compared core utilization before (5) to after this change (8)
* Loaded up a bucket-load of apps, browser tabs, and a running game and verified engine built successfully 2x with no compiler OOMs

#jira UE-192238
#rb swarm
#swarm [at]Joe.Kirchoff [at]Zack.Neyland

[CL 26906094 by andrew grant in ue5-main branch]
2023-08-07 19:49:26 -04:00
marc audy
434a1b9e47 Remove circular reference entries that are no longer accurate post CL# 25899269
#jira
#rnx
[FYI] Bryan.Sefcik

[CL 26903173 by marc audy in ue5-main branch]
2023-08-07 18:43:44 -04:00
dmytro ivanov
2536e616e1 Update cmake to 3.22.1
#jira UE-192126
#rb Chris.Babcock

[CL 26894364 by dmytro ivanov in ue5-main branch]
2023-08-07 14:56:20 -04:00
andrew grant
725db830a1 Fixes regression where BenchmarkBuild script would not reliably measure build performance.
The fix is to restore the <= 5.1 behavior of UBT where the MaxParallelActions argument specifies the maximum number of actions to execute in parallel, not a cap on UBTs heuristic-based selection.

This change also modifies BenchmarkBuild so it will default to the available processor count if no -cores argument is specified. This ensures the behavior of repeated runs will be deterministic as UBT may select different values if the system free memory changes

#jira UE-192236
#rb swarm
[REVIEW] [at]Joe.Kirchoff
#tests Ran UBT / BenchmarkBuild with arguments that forces the number of actions higher than the locally available core count

[CL 26889927 by andrew grant in ue5-main branch]
2023-08-07 13:35:03 -04:00
henrik karlsson
97a4015f60 [UBT]
* Added actions first produced item directory path as part of sorting for scheduling. This groups modules together nicely which will benefit when running things remotely where remotes takes batches of actions at the time meaning there is a higher chance each remote helper will need to download fewer variations of pch files

#rb  joe.kirchoff

[CL 26856192 by henrik karlsson in ue5-main branch]
2023-08-04 15:04:09 -04:00
bryan sefcik
ca12a1a2e0 Cleaned up the project generator API by passing a struct of commonly used arguments. This makes it easier for us to add/remove arguments.
#rb joe.kirchoff
#jira

[CL 26854215 by bryan sefcik in ue5-main branch]
2023-08-04 14:18:11 -04:00
calvin zheng
453260b02f UBT: Use ld-classic in order to avoid the new linker since it seems to have some bugs with our code base.
Remove redundant -lc++

#jira UE-191350
#rb Josh.Adams, Zack.Neyland

[CL 26852644 by calvin zheng in ue5-main branch]
2023-08-04 13:17:50 -04:00
joe kirchoff
5c916d0313 UnrealBuildTool: Fix regression with shared environment path
#rnx
#jira UE-192137

[CL 26852403 by joe kirchoff in ue5-main branch]
2023-08-04 13:12:17 -04:00
adam kinge
43d42d6d2b Required Metal changes to support iOS Simulator.
- add a new shader platform (SP_METAL_SIM) to support iOS Simulator specific compilation requirements
- update iOS sim #define WITH_SIMULATOR to WITH_IOS_SIMULATOR

#jira UE-168571
#rb carl.lloyd

[CL 26850475 by adam kinge in ue5-main branch]
2023-08-04 12:28:20 -04:00
josh adams
fafd488a40 - Fixed making .apps using a StagingDirectory override with code-based projects
#jira UE-189819, UE-189368
#rb trivial

[CL 26848281 by josh adams in ue5-main branch]
2023-08-04 11:34:16 -04:00
josh adams
65fbd954e5 - Changed how .dylibs in the Contents/MacOS directory are copied into Mac .apps (done directly instead of needing to be staged first)
#jira UE-191538
#rb calvin.zheng

[CL 26832937 by josh adams in ue5-main branch]
2023-08-03 19:21:32 -04:00
josh adams
fd539f221c - Enabled Modern Xcode mode by default for everyone!
- Fixed a naming issue (GameName vs ExeName) with stub creation for non-Development builds
#jira UE-191986
#rb calvin.zheng

[CL 26831842 by josh adams in ue5-main branch]
2023-08-03 18:45:15 -04:00
bryan sefcik
dd629c9b68 Turned off the creation of the additional platform/architectures options until I figure out a way to not have VS reset what current config/platform was previously selected.
[FYI] joe.kirchoff
#jira

[CL 26825507 by bryan sefcik in ue5-main branch]
2023-08-03 16:24:09 -04:00
marc audy
de3c6ed141 Allow bRequireObjectPtrForAddReferencedObjects to be set via BuildConfiguration.xml
#rnx
[FYI] Kirill.Zorin

[CL 26825293 by marc audy in ue5-main branch]
2023-08-03 16:21:08 -04:00
kirill zorin
b36d22897c Deprecating non-TObjectPtr FReferenceCollector::AddReferencedObject(s) API.
#rb andrew.scheidecker, marc.audy

[CL 26821499 by kirill zorin in ue5-main branch]
2023-08-03 14:53:09 -04:00
bryan sefcik
33c066c2cc Updated the exe name logic to take into account the project/platform architecture when it is set.
#jira
#fyi joe.kirchoff

[CL 26821373 by bryan sefcik in ue5-main branch]
2023-08-03 14:51:09 -04:00
andrew scheidecker
df882395a6 Fix error due to missing executable extension when cross-compiling for Linux using the AutoRTFM compiler with Box enabled.
#rb Brandon.Schaefer

[CL 26818431 by andrew scheidecker in ue5-main branch]
2023-08-03 13:59:09 -04:00
chris babcock
2554a6bbb7 Change GameActivity exported to true
#android
[REVIEW] [at]Peter.Sauerbrei
#rb Peter.Sauerbrei

[CL 26795021 by chris babcock in ue5-main branch]
2023-08-02 20:27:26 -04:00
bryan sefcik
9a81ca5c26 Added support to have multiple architectures per platform in the VS sln/projects.
Updated the project generators to search the VS platform directory when HasVisualStudioSupport is called to find out whether a platform is supported. This fixes several issues where platforms were being generated like they were supported by the host machine but actually weren't.

#rb joe.kirchoff
#jira

[CL 26795017 by bryan sefcik in ue5-main branch]
2023-08-02 20:27:20 -04:00
joe kirchoff
85db4326a0 UnrealBuildTool: Write files for static analysis to a separate intermediate folder
Fix up to date checks for clang static analysis. Note that clang analysis warnings can't be made into error, so subsequent builds will not replay warnings for up to date actions

#rnx
#jira UE-187067

[CL 26794436 by joe kirchoff in ue5-main branch]
2023-08-02 20:02:25 -04:00
joe kirchoff
b46695c12e UnrealBuildTool: Ensure generated files are written to the correct intermediate folder name
#rnx

[CL 26780017 by joe kirchoff in ue5-main branch]
2023-08-02 14:02:59 -04:00