Skip to content
Merged
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
10 changes: 10 additions & 0 deletions Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreativeCoders.IO.Ports", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreativeCoders.CakeBuild.Tests", "tests\CreativeCoders.CakeBuild.Tests\CreativeCoders.CakeBuild.Tests.csproj", "{A081DDB3-A9DB-498F-824B-C605ACFDB43A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{2568D059-EB13-4489-8F12-769EB4DD449F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreativeCoders.Configuration", "source\Configuration\CreativeCoders.Configuration\CreativeCoders.Configuration.csproj", "{86E41188-7778-415E-A783-2CEF2DADB21A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -588,6 +592,10 @@ Global
{A081DDB3-A9DB-498F-824B-C605ACFDB43A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A081DDB3-A9DB-498F-824B-C605ACFDB43A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A081DDB3-A9DB-498F-824B-C605ACFDB43A}.Release|Any CPU.Build.0 = Release|Any CPU
{86E41188-7778-415E-A783-2CEF2DADB21A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{86E41188-7778-415E-A783-2CEF2DADB21A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{86E41188-7778-415E-A783-2CEF2DADB21A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{86E41188-7778-415E-A783-2CEF2DADB21A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -698,6 +706,8 @@ Global
{EC120660-306E-4E48-8FBB-43D9F3962CEE} = {F31389F0-613B-48B1-AA99-6BFC3D8D7D1A}
{C34426F1-E40C-498D-8FDE-D4ECEB3E49D4} = {F31389F0-613B-48B1-AA99-6BFC3D8D7D1A}
{A081DDB3-A9DB-498F-824B-C605ACFDB43A} = {5A3FFD14-2258-4007-AC77-BAFB3B3EB26F}
{2568D059-EB13-4489-8F12-769EB4DD449F} = {2A7105AA-05B6-469A-93F5-719723A4D90D}
{86E41188-7778-415E-A783-2CEF2DADB21A} = {2568D059-EB13-4489-8F12-769EB4DD449F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EE24476B-9A4C-4146-B982-3461FAF8B3B0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.1"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.1" PrivateAssets="all"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="10.0.1"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.3"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.3" PrivateAssets="all"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/CakeBuildSample/CakeBuildSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="6.0.0"/>
<PackageReference Include="Cake.Frosting" Version="6.1.0"/>
<PackageDownload Include="ReportGenerator" Version="[5.5.1]"/>
<PackageDownload Include="GitVersion.Tool" Version="[6.5.1]"/>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/NetSampleApp/NetSampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions samples/ProcessUtilsSampleApp/ProcessUtilsSampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/WebApiSampleApp/WebApiSampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.1.4"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@


<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="10.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.0.1" />
<PackageReference Include="Microsoft.JSInterop" Version="10.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="10.0.3"/>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.0.3"/>
<PackageReference Include="Microsoft.JSInterop" Version="10.0.3"/>
</ItemGroup>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.3"/>
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2025.2.4"/>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.3.9"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="6.0.0"/>
<PackageReference Include="MimeMapping" Version="3.1.0"/>
<PackageReference Include="Cake.Frosting" Version="6.1.0"/>
<PackageReference Include="MimeMapping" Version="4.0.0"/>
<PackageReference Include="Octokit" Version="14.0.0"/>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.3"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.3"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3"/>
<PackageReference Include="Spectre.Console" Version="0.54.0"/>
</ItemGroup>

Expand Down
18 changes: 18 additions & 0 deletions source/Cli/CreativeCoders.Cli.Hosting/DefaultCliHostBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using CreativeCoders.Cli.Hosting.Commands.Validation;
using CreativeCoders.Cli.Hosting.Help;
using CreativeCoders.Core;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;

Expand Down Expand Up @@ -123,6 +124,23 @@ public ICliHostBuilder RegisterPostProcessor<T>(Action<T>? configure = null)
return ConfigureServices(x => x.AddSingleton<ICliPostProcessor, T>());
}

public ICliHostBuilder UseConfiguration(Action<IConfigurationBuilder> configure)
{
Ensure.NotNull(configure);

return ConfigureServices(x =>
{
var configurationBuilder = new ConfigurationBuilder();

configure(configurationBuilder);

var configuration = configurationBuilder.Build();

x.AddSingleton(configuration);
x.AddSingleton<IConfiguration>(configuration);
});
}

[SuppressMessage("Performance", "CA1859:Use concrete types when possible for improved performance")]
private IServiceProvider BuildServiceProvider()
{
Expand Down
12 changes: 12 additions & 0 deletions source/Cli/CreativeCoders.Cli.Hosting/ICliHostBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using CreativeCoders.Cli.Core;
using CreativeCoders.Cli.Hosting.Help;
using JetBrains.Annotations;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace CreativeCoders.Cli.Hosting;
Expand Down Expand Up @@ -95,6 +96,17 @@ ICliHostBuilder UseContext<TContext>(Action<IServiceProvider, TContext>? configu
/// <returns>The same <see cref="ICliHostBuilder"/> instance.</returns>
ICliHostBuilder RegisterPostProcessor<T>(Action<T>? configure = null) where T : class, ICliPostProcessor;

/// <summary>
/// Configures the application using a custom configuration setup.
/// </summary>
/// <param name="configure">
/// An action to configure the <see cref="IConfigurationBuilder"/>. The action allows adding sources,
/// modifying settings, or otherwise adjusting the configuration behavior.
/// </param>
/// <returns>The same <see cref="ICliHostBuilder"/> instance, enabling method chaining.</returns>
/// <exception cref="ArgumentNullException">Thrown if the <paramref name="configure"/> parameter is null.</exception>
ICliHostBuilder UseConfiguration(Action<IConfigurationBuilder> configure);

/// <summary>
/// Builds and creates an instance of <see cref="ICliHost"/> configured through the current builder.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using CreativeCoders.Core.IO;
using Microsoft.Extensions.Configuration;

namespace CreativeCoders.Configuration;

public static class ConfigurationBuilderExtensions
{
public static IConfigurationBuilder TryAddJsonFile(this IConfigurationBuilder builder, string path)
{
return FileSys.File.Exists(path)
? builder.AddJsonFile(path)
: builder;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.3"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.3"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Core\CreativeCoders.Core\CreativeCoders.Core.csproj"/>
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions source/Core/CreativeCoders.Core/CreativeCoders.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2025.2.4"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1" />
<PackageReference Include="System.IO.Abstractions" Version="22.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3"/>
<PackageReference Include="System.IO.Abstractions" Version="22.1.0"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2025.2.4"/>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.3"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3"/>
<PackageReference Include="NHibernate" Version="5.6.0"/>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.3"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.IO.Ports" Version="10.0.1"/>
<PackageReference Include="System.IO.Ports" Version="10.0.3"/>
<PackageReference Include="System.Reactive" Version="6.1.0"/>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Localization" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.3"/>
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions source/Net/CreativeCoders.Net/CreativeCoders.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.3"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.4"/>
<PackageReference Include="Polly" Version="8.6.5" />
<PackageReference Include="Polly" Version="8.6.5"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
Loading