Drexel.Configurables
A library for exposing configurable resources.
Description
Drexel.Configurables consists of three projects:
-
Drexel.Configurables.Externals: Defines & implements simple classes shared across other projects. -
Drexel.Configurables.Contracts: Defines the primary interfaces (IConfigurationRequirement,IRequirementSource,IConfigurator,IConfiguration, andIMapping.) Some simple contract classes are also included, such asConfigurationRequirementTypeandCollectionInfo. -
Drexel.Configurables: Implements the contracts defined byDrexel.Configurables.Contractswith some canonical defaults. The canonical implementations are designed to function in simple use-cases. This is probably the package you're interested in.
Other noteable projects include:
-
Drexel.Configurables.Sample: Sample project demonstrating a simple example of usingDrexel.Configurables. -
Drexel.Configurables.Tests: Contains the tests for theDrexel.Configurablesnamespace. ~92% code coverage.
Building
The solution should build without issue on Visual Studio 2017 Community Edition. The projects target .NET Framework version 4.7.2, which at the time of writing is not available through the Visual Studio Installer. It can be downloaded here. All projects except the sample are configured for StyleCop using a lightly modified ruleset, and a custom dictionary.
Use
- Add a reference to the
Drexel.ConfigurablesNuGet package in your project. - Implement the
IRequirementSourceinterface on an object which has requirements (for example, a factory class.) - Either implement the
IConfiguratorinterface on an object which transforms user-input toConfigurationobjects, or define your own interface to do something similar (ex.IMyFactory.GetInstance(...).)
Publishing
- Download the latest recommended version of nuget.exe
- Create an API key on nuget.org
- Build the solution in Release mode
- Pack the
.nuspecfiles using the commandnuget pack -Symbols "C:\Path\to\my.nuspec" - Delete the non-
.symbolpackages - Set the local machine's nuget key using the command
nuget setApiKey <your_API_key> - Publish the packages using the command
nuget push YourPackage.nupkg -Source https://api.nuget.org/v3/index.json