Commit Graph

43 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
Ben Marsh
900d7fbb01 Change artifact tests to be async, so callstacks are correct while debugging.
[CL 26023954 by Ben Marsh in ue5-main branch]
2023-06-15 16:05:52 -04:00
tim smith
e452362386 Cleaned up naming of structures and classes to reduce the overuse of the word Mapping.
#rb self

[CL 25815125 by tim smith in ue5-main branch]
2023-06-06 10:01:44 -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
tim smith
cf626105dd 1) Replaced bCanCache with new artifact mode flags
2) Added support in artifacts for relative paths
3) Modified ISPC header generation to be cached

At this time, only MSVC compiles are cached and -deterministic must be specified when building.

#rb josh.adams
#preflight 6470a172054af2576a2bd4b9

[CL 25647092 by tim smith in ue5-main branch]
2023-05-26 12:48:45 -04:00
tim smith
c4e58dd394 Implementation of the action artifact cache.
#rb ben.marsh
#preflight 645a299fa73096fab761de62

[CL 25386005 by tim smith in ue5-main branch]
2023-05-09 08:29:47 -04:00
Ben Marsh
0ede5eada2 UBT: Match engine-style script errors in logs.
#preflight none

[CL 25330216 by Ben Marsh in ue5-main branch]
2023-05-03 21:04:34 -04:00
Tim Smith
650df59d35 Update UBT preprocessor code to much stricter coding standards
#rb self
#rnx
#preflight 640b66c00e1f02786b03f6e1

[CL 24593895 by Tim Smith in ue5-main branch]
2023-03-10 12:35:47 -05:00
Tim Smith
6f31743583 Fixed SourceFileTests and disabled UHT tests
#rb self
#rnx
#preflight 640a2b7b3c2db4002930c4d0

[CL 24579984 by Tim Smith in ue5-main branch]
2023-03-09 14:12:47 -05:00
Joe Kirchoff
eabe3f6333 UnrealBuildTool.Tests: .editorconfig and fixing warnings + format documents
#rnx
#rb trivial
#preflight 63b774525d4ef8faf6f7b148

[CL 23595279 by Joe Kirchoff in ue5-main branch]
2023-01-05 20:19:41 -05:00
Josh Engebretson
058ba28ad4 Horde: Add UBT matchers for additional XGE messages, with test
#jira none
#rnx
#preflight none
#fyi ryan.hummer

[CL 22435527 by Josh Engebretson in ue5-main branch]
2022-10-10 14:34:10 -04:00
Ben Marsh
f02930fb9c UBT: Add a matcher for Verse errors.
#preflight none

[CL 22142130 by Ben Marsh in ue5-main branch]
2022-09-22 15:04:30 -04:00
Ben Marsh
8e8db2a5de UBT: Add a matcher for XGE errors.
#preflight none

[CL 21817422 by Ben Marsh in ue5-main branch]
2022-09-06 10:50:38 -04:00
Ben Marsh
80e934e200 Horde: Add log event matcher for XGE cache warnings.
#preflight none

[CL 21700290 by Ben Marsh in ue5-main branch]
2022-08-30 10:28:16 -04:00
Ben Marsh
133ba2e8c6 UBT: Improve matcher for Clang line markers.
#preflight none

[CL 21699654 by Ben Marsh in ue5-main branch]
2022-08-30 09:46:10 -04:00
Ben Marsh
648f54ab5d UBT: Allow matching files without extensions as C++ source files (eg. STL headers).
#preflight none
#jira UE-160049

[CL 21518857 by Ben Marsh in ue5-main branch]
2022-08-23 16:22:56 -04:00
UnrealBot
73409369c0 Branch snapshot for CL 21319338
[CL 21319338 in ue5-main branch]
2022-08-10 16:03:37 +00:00
Ben Marsh
be4775b89f Match *.hpp files as source files for compile errors.
#preflight none

[CL 21011851 by Ben Marsh in ue5-main branch]
2022-07-08 14:55:48 -04:00
Ben Marsh
ebe794a17c UBT: Add matcher for errors/warnings from UHT.
#preflight none

[CL 20701987 by Ben Marsh in ue5-main branch]
2022-06-17 09:03:30 -04:00
Ben Marsh
c06fd19a72 UBT: Add an event matcher for Clang fatal errors.
#preflight none

[CL 20654680 by Ben Marsh in ue5-main branch]
2022-06-14 15:05:54 -04:00
Ben Marsh
db7ebc35b6 Tag files referenced via "In file included from..." clauses in Clang errors.
#preflight none

[CL 20577682 by Ben Marsh in ue5-main branch]
2022-06-09 11:27:05 -04:00
Ben Marsh
3b25cb1d71 Manually mask out IOS link errors from event matcher.
#preflight none

[CL 20535960 by Ben Marsh in ue5-main branch]
2022-06-07 08:36:39 -04:00
Ben Marsh
a95cc9a7c9 UBT: Fix over-eager matching of multiple lines in prelude to error message.
#preflight none

[CL 20519054 by Ben Marsh in ue5-main branch]
2022-06-06 09:06:04 -04:00