Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.bobbit/state

# Build results
[Dd]ebug/
[Rr]elease/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# NuGet
*.nupkg
*.snupkg
.nuget/
**/packages/

# Visual Studio
.vs/
*.user
*.suo
*.userosscache
*.sln.docstates

# Rider
.idea/

# OS files
Thumbs.db
ehthumbs.db
Desktop.ini
.DS_Store
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
language: csharp
dotnet: 2.0.0
mono: none
dotnet: 10.0

install:
- dotnet restore

# workaround for missing .net 4.5 targing pack
- export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/

script:
- dotnet build
- dotnet test Paramulate.Test/Paramulate.Test.csproj
- dotnet build --configuration Release
- dotnet test Paramulate.Test/Paramulate.Test.csproj --configuration Release
18 changes: 12 additions & 6 deletions Paramulate.Test/Paramulate.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.7.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Paramulate\Paramulate.csproj" />
</ItemGroup>
</Project>
</Project>
4 changes: 2 additions & 2 deletions Paramulate.Test/TestPrinting.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.IO;
using NUnit.Framework;
using NUnit.Framework.Internal;
using Paramulate.Attributes;

namespace Paramulate.Test
Expand Down Expand Up @@ -55,7 +55,7 @@ public void TestPrintingObject()
{
var builder = ParamsBuilder<IPrintParent>.New("PrintParent");
var testObject = builder.Build();
var testStream = new TextMessageWriter();
var testStream = new StringWriter();
builder.WriteParams(testObject, testStream);

Console.WriteLine(testStream.ToString());
Expand Down
12 changes: 7 additions & 5 deletions Paramulate/Paramulate.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>disable</Nullable>
<Version>1.0.0-beta3</Version>
<Authors>SuuBro</Authors>
<Company />
Expand All @@ -12,7 +14,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ImpromptuInterface" Version="7.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="ImpromptuInterface" Version="8.0.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project>
</Project>
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,13 @@ App:
```

## Features
TODO
- __Strongly-typed parameters:__ define your parameter tree as plain C# interfaces and let Paramulate generate the implementation for you
- __Sensible defaults:__ specify defaults inline with `[Default("...")]` so your component is usable out-of-the-box
- __Command line support out of the box:__ the built-in `CommandLineValueProvider` maps fully-qualified paths (e.g. `--App.UserDb.ConnectionString`) to your tree, with short (`-o`) and long (`--output-language`) aliases via `[Alias]`
- __Pluggable value providers:__ implement `IValueProvider` to pull values from config files, environment variables, databases, secret stores or anything else, and chain providers together in priority order
- __Nested parameter trees:__ compose reusable parameter interfaces and tweak nested values per-use with `[Override("PropertyName", "value")]`
- __Source tracking:__ every value remembers where it came from (`Default`, `Override`, `Command Line`, custom provider, ...) so you can pinpoint exactly where a setting was set
- __Self-documenting output:__ `WriteParams` pretty-prints the resolved parameter tree (values + sources) to any `TextWriter` -- ideal for startup logs
- __Built-in help:__ `-h` / `--help` is wired up automatically and prints the aliases and help text declared on your interfaces
- __Unrecognised argument detection:__ unknown command-line keys are surfaced as an `UnrecognisedParameterException` rather than silently ignored
- __Rich type support:__ primitives, `string`, `enum` (by name or numeric value), `DateTime`, `TimeSpan`, `Nullable<T>` and any JSON-deserialisable type are supported out of the box