Inspired by Code; This is a project that contains utility code that don't belong together in a monolithic library. However, as oppose to Code, this repository has no source generators or roslyn analyzers to add these files. Instead, these are configurations which can be applied and synced to multiple projects simultaneously. This means that there is no need to add references, or figure out whether some type is needed or not, as all of them are added automatically.
Of course, if you add every type, it often means that a lot of unnecessary code is shipped along with your assembly, which is especially not ideal if you only require a single function from the set of all types. To counteract this, an additional dependency is placed on Absence.Fody which automatically looks for unused types that aren't explicitly marked as either CompilerGeneratedAttribute or ImplicitlyUsedAttribute. As a result, any unused types outside of Emik.Morsels within the project will also be discarded during compile-time.
Emik.Morsels has framework-dependent dependencies to accomodate the following purposes:
Framework | Purpose |
---|---|
.NET Framework 3.5 | Keep Talking and Nobody Explodes / Unity 2017.4.22f1 |
.NET Framework 4.5.2 | Celeste / Everest |
.NET Standard 2.0 | Fody |
.NET Standard 2.1 / NET Core | General |
Different scripts and configurations within this repository will act accordingly to the current framework, such as polyfills, or by taking advantage of .NET 6+'s static abstract
features. If you do not own the products, you can simply target another framework. (e.g. .NET Framework 4.5.1)
Anything span-related will not be supported prior to .NET Standard 2.1, and .NET Framework 3.0 and older are considered too old to be necessarily supported in this repository.
- Download/clone the repository:
git clone https://github.com/Emik03/Emik.Morsels.git
- Modify the first PropertyGroup of Directory.Build.props, which contains absolute paths that are system-dependent.
- Add symbolic links to Directory.Build.props and Directory.Build.targets for each project that references Emik.Morsels.
- Windows:
mklink Directory.Build.props <PROPS_PATH>
mklink Directory.Build.targets <TARGETS_PATH>
- Mac/Linux:
ln -s Directory.Build.props <PROPS_PATH>
ln -s Directory.Build.targets <TARGETS_PATH>
Despite the types being marked internal, all scripts here act as an evolving API. As a result, feedback is much more likely to be applied as breaking changes can be more easily made without breaking preexisting code.
Issues and pull requests are welcome to help this repository be the best it can be.
This repository — which includes every source file separately — fall under the MPL-2 license.
You may copy individual or multiple source files, granted that you keep the copyright license, and disclose the source back to this repository.