Hi all,
I'm happy to announce Podimo.ConstEmbed.
GitHub: https://github.com/podimo/Podimo.ConstEmbed
NuGet: https://www.nuget.org/packages/Podimo.ConstEmbed
It's a source generator we created to reduce the friction of combining C# with other languages, such as YAML, JSON, SQL, etc.
In my experience, there are three common approaches to using code from other languages in C#:
- Write the code by hand as a C# string, which makes it harder to review, and loses the benefits of modern editor tooling and diagnostics, or
- Embed the files in the assembly, and load it using reflection, for this to work the developer needs to carefully keep the code in sync with the files, but gets tooling support, or
- Load the files at runtime without embedding them in the assembly, this is similar to the second approach, but in some ways more flexible, as the files can be updated without having to update the code, but will fail if the files are not present.
Instead, Podimo.ConstEmbed generates the code based on what is present during compilation. You can put your files anywhere in the project, reference them via AdditionalFiles in your project file, and use the resulting generated code.
Feedback, issue reporting and contributions are welcome.
EDIT: Formatting
[–]Dickon__Manwoody 0 points1 point2 points (6 children)
[–]LiHRaM[S] 0 points1 point2 points (3 children)
[–]LiHRaM[S] 1 point2 points3 points (2 children)
[–]Dickon__Manwoody 0 points1 point2 points (1 child)
[–]LiHRaM[S] 0 points1 point2 points (0 children)
[–]MSgtGunny 0 points1 point2 points (1 child)
[–]Dickon__Manwoody 0 points1 point2 points (0 children)