A library for exposing configurable resources.
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 asConfigurationRequirementType
andCollectionInfo
.Drexel.Configurables
: Implements the contracts defined byDrexel.Configurables.Contracts
with 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.Configurables
namespace. ~92% code coverage.
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.
- Add a reference to the
Drexel.Configurables
NuGet package in your project. - Implement the
IRequirementSource
interface on an object which has requirements (for example, a factory class.) - Either implement the
IConfigurator
interface on an object which transforms user-input toConfiguration
objects, or define your own interface to do something similar (ex.IMyFactory.GetInstance(...)
.)
- Download the latest recommended version of nuget.exe
- Create an API key on nuget.org
- Build the solution in Release mode
- Pack the
.nuspec
files using the commandnuget pack -Symbols "C:\Path\to\my.nuspec"
- Delete the non-
.symbol
packages - 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