X2CommunityCore / X2ModBuildCommon

An improved XCOM 2 mod build system
MIT License
5 stars 5 forks source link

Unified editor Cmdlet handling #7

Closed robojumper closed 3 years ago

robojumper commented 3 years ago

Use a unified function to manage process events and crash detection.

Also removes _Compiletest because this is implemented as a pre-make hook in X2CommunityCore/X2WOTCCommunityHighlander#991.

Xymanek commented 3 years ago

If I understood correctly, you are using same output processing for HL cook and assets cook. If that's the case, I think it's a bad idea (if not outright wrong); for example, assets cook does not care about what happens with native script packages (and if a way is found, it would prefer to not have them participate in the cooking process entirely), while the HL cook actually needs and cares about those packages (even though the 2 in question aren't shipped by CHL right now)

Xymanek commented 3 years ago

One thing that I would like to see (and I dunno if that's possible or not, my knowledge of powershell is pretty limited) is for the callback handlers to be passed as delegates to _InvokeEditorCmdlet, instead of being huge switch blocks. It would probably also help with addressing the previous comment

robojumper commented 3 years ago

Instead of messing around with callbacks, the latest commit instead just uses a plain old object and inheritance to handle stdout parsing, rewriting and crash detection. This looks a fair bit nicer.