-
Notifications
You must be signed in to change notification settings - Fork 397
Closed
Description
The current UnitsNet source code is a bit of a mess due to supporting Windows Runtime Component (WinRTC) and adapting to all the constraints WinRTC imposes on the public API types and method signatures. This results in MANY #if WINDOWS_UWP
directives that clutters the code.
Short story; WinRTC allows .NET code and nugets to be consumed by JavaScript and C++ Windows UWP apps, by sticking to some strict constraints on the public API. Read more on Windows Runtime Component and its constraints.
I propose:
- Move WinRTC project to
/UnitsNet.WindowsRuntimeComponent
folder - Generate WinRTC source code separately in new folder
- Remove
#if
directives from generated code of each set so it only has the code it needs - Add linked files (not copies) of
/UnitsNet
source code that is fully compatible with both, with same folder structure - Update build scripts with new paths
- Bonus: Copy/add some test cases specific to WinRTC, we currently have zero test coverage on it
I would rank this as medium difficulty, it definitely involves some mucking around with the source code, the code generator scripts and the build scripts. I'm happy to assist if anyone wants to take this on though!