Commit Graph

51 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
leon huang
e8c7cae7b2 [Backout] - CL26105383
[FYI] Leon.Huang
Original CL Desc
-----------------------------------------------------------------
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.

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 26111662 by leon huang in ue5-main branch]
2023-06-19 21:11:08 -04:00
leon huang
82b1ba105d 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.

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 26105458 by leon huang in ue5-main branch]
2023-06-19 17:00:48 -04:00
joe kirchoff
36d266e932 UnrealBuildTool: Automated code cleanup
#rnx
#preflight 6476799e947ff6973c225619

[CL 25693241 by joe kirchoff in ue5-main branch]
2023-05-30 18:38:07 -04:00
haisongliang
3c8231e5fd PR #8797: add missing '$' in the log so that values are formatted correctly. (Contributed by haisongliang)
#rb sebastian.nordgren
#preflight 61e82c46b875abaf33228114

#ROBOMERGE-AUTHOR: sebastian.nordgren
#ROBOMERGE-SOURCE: CL 18658557 in //UE5/Release-5.0/... via CL 18658565 via CL 18658573
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v900-18638592)

[CL 18658575 by haisongliang in ue5-main branch]
2022-01-19 10:37:27 -05:00
jonathan adamczewski
c7aeb00f62 UnrealBuildTool: Remove various references to UE4.
#jira UE-111420
#trivial
#preflight none

#ROBOMERGE-AUTHOR: jonathan.adamczewski
#ROBOMERGE-SOURCE: CL 18565554 in //UE5/Release-5.0/... via CL 18565574
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18565586 by jonathan adamczewski in ue5-release-engine-test branch]
2022-01-10 16:46:00 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
David Harvey
e581358a11 Add HasExplicitPlatforms property to uplugin definitions, allowing the SupportedTargetPlatforms and WhitelistPlatforms fields to be entirely defined in child plugins. The existing functionality means that an empty platform list implies "all platforms".
#jira UECON-417
#rb ben.marsh

[CL 16531379 by David Harvey in ue5-main branch]
2021-06-02 04:27:26 -04:00
Ben Marsh
6f927647b1 Changing C# code over to using EpicGames.Core over DotNETCommon.
#rb none
#rnx

[CL 14962096 by Ben Marsh in ue5-main branch]
2020-12-21 23:07:37 -04:00
Ben Marsh
68f5abeb09 UBT: Convert UnrealBuildTool to use nullable references.
#rb none
#rnx

[CL 14960546 by Ben Marsh in ue5-main branch]
2020-12-20 18:47:42 -04:00
Josh Adams
77c0e15de9 - Fixed UBT to not throw errors if a project has a Platforms/XYZ directory, which will try to build with platform XYZ, if the engine doesn't have Engine/Platforms/XYZ/DataDrivenPlatformInfo.ini file. This will make it so the Project/Platforms/XYZ directory would be completely skipped over (and Project/Restricted/Blah/Platforms/XYZ)
- Changed plugin module descriptor internals to allow for an empty platform whitelist (which means no platforms are enabled), in the case of all platforms in the whitelist are not around
- Added some dummy DDPI.ini files for "fake platforms" to the Engine so that the above directory checks will not strip out the shared platform directories from projects
#rb ben.marsh
#fyi luke.thatcher,david.harvey
#jira UE-100574

[CL 14490452 by Josh Adams in ue5-main branch]
2020-10-14 08:54:14 -04:00
anthony bills
1ef400627b Add support for whitelisting additional plugins and adding additional modules to plugin extensions.
Additionally allow monolithic programs inside platform extensions to ouput to the Binaries directory in the extension.

[at]brian.white, [at]josh.adams, [at]ben.marsh
#jira UE-81798
#rb ben.marsh

#ROBOMERGE-SOURCE: CL 11655119 in //UE4/Release-4.25/... via CL 11655234
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v656-11643781)

[CL 11655284 by anthony bills in Main branch]
2020-02-27 10:47:20 -05:00
chris varnsverry
b7289965b5 - Fix ClientOnlyNoCommandlet modules not being included in builds
[REVIEW] [at]Bob.Tellez


#ROBOMERGE-SOURCE: CL 10930162 via CL 10930165 via CL 10930338 via CL 10930352 via CL 10930372
#ROBOMERGE-BOT: (v626-10872990)

[CL 10930392 by chris varnsverry in Main branch]
2020-01-09 14:55:28 -05:00
Ryan Durand
9ef3748747 Updating copyrights for Engine Programs.
#rnx
#rb none
#jira none

#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869242 in //Fortnite/Release-12.00/... via CL 10869536
#ROBOMERGE-BOT: FORTNITE (Main -> Dev-EngineMerge) (v613-10869866)

[CL 10870955 by Ryan Durand in Main branch]
2019-12-26 23:01:54 -05:00
hongyi yu
dc9ac74cb1 Split PreInit() into PreInitPreStartupScreen() and PreInitPostStartupScreen() to add flexibility to engine preinit. This is useful on certain platforms which need to display a splash screen before preinit is completed.
The PostSplashScreen plugin can be used to show a custom splash screen during this time.
[REVIEW] Ben.Woodhouse,Thomas.Ross


#ROBOMERGE-SOURCE: CL 9379086 via CL 9379088 via CL 9386092 via CL 9386128 via CL 9386152
#ROBOMERGE-BOT: (v456-9359915)

[CL 9389466 by hongyi yu in Main branch]
2019-10-03 08:46:18 -04:00
Ben Marsh
324e2e6c5b Remove the bBuildEditor flag passed to ModuleDescriptor.IsCompiledInConfiguration(). This is always determined from the target type now.
#rb none
#rnx

[CL 8576545 by Ben Marsh in Dev-Build branch]
2019-09-09 16:33:08 -04:00
Ben Marsh
7810027daf Deprecate the 'Developer' module type. The 'UncookedOnly' type has the same functionality but is more descriptive, and the 'DeveloperTool' module type correctly represents the state of the bBuildDeveloperTools flag.
#rb none

[CL 8407077 by Ben Marsh in Dev-Build branch]
2019-09-02 16:21:40 -04:00
Ben Marsh
4330a4a58d UBT: Add a new "UncookedOnly" module type, which only loads a module in uncooked builds.
The Developer module type is currently generally used for this purpose, because it allows modules to load from an editor executable running with -game, but this is not the documented or intended behavior.

#rb none
#jira UE-70913

[CL 8386073 by Ben Marsh in Dev-Build branch]
2019-08-30 15:07:33 -04:00
daniel lamb
f46a50c93c Added support for ClientOnlyNoCommandlet to module type.
Robert.Manuszewski


#ROBOMERGE-OWNER: daniel.lamb
#ROBOMERGE-AUTHOR: daniel.lamb
#ROBOMERGE-SOURCE: CL 7614033 via CL 7614038 via CL 7614047 via CL 7623664
#ROBOMERGE-BOT: (v372-7473910)

[CL 7623665 by daniel lamb in Main branch]
2019-07-25 10:12:32 -04:00
Ben Marsh
0cc6e3dca6 Copying //UE4/Dev-Build to Dev-Main (//UE4/Dev-Main)
#rb none
#rnx

[CL 6631504 by Ben Marsh in Main branch]
2019-05-24 11:51:54 -04:00
Robert Manuszewski
2752c82adc Merging //UE4/Dev-Main @ 4664414 to Dev-Core (//UE4/Dev-Core)
#rb none

[CL 4675693 by Robert Manuszewski in Dev-Core branch]
2019-01-02 00:55:51 -05:00
Ben Marsh
530369c613 Merging //UE4/Dev-Main to Dev-Build (//UE4/Dev-Build)
#rb none
#rnx

[CL 4662695 by Ben Marsh in Dev-Build branch]
2018-12-14 14:49:12 -05:00
Josh Adams
4f63a76b48 - Changed compression methods to be an FName instead of hardcoded enum
- Added support for compression plugins
- Removed the Custom compression concept, now using plugins properly
- Modified UnrealPak to use FNames, and allow for multiple compression methods (fallbacks on error or unavailability, etc)
- Added project settings for compression method selection for UnrealPak, and additional settings to be passed to UnrealPak (for instance, to control compression size/speed, etc)
- Deprecated a bunch of old function calls
- Improved pak file "old format" reading ability
- Brought over some changes from Fortnite for pak file encryption and memory savings
- Implemented a parallel compression pull request (#4129) to speed up pak file compression
#jira UE-51294
#rb ben.marsh

[CL 4480944 by Josh Adams in Dev-Core branch]
2018-10-17 14:18:10 -04:00