Skip to content

Commit

Permalink
Removed most dependencies. (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgernand authored May 26, 2024
1 parent 1d3d474 commit 7817447
Show file tree
Hide file tree
Showing 43 changed files with 323 additions and 138 deletions.
6 changes: 3 additions & 3 deletions samples/BlazorApp1/BlazorApp1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Forms" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.Forms" Version="8.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.5" PrivateAssets="all" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.BrowserConsole" Version="2.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions samples/BlazorApp2/BlazorApp2.Client/BlazorApp2.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Forms" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.Forms" Version="8.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.5" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.BrowserConsole" Version="2.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion samples/BlazorApp2/BlazorApp2/BlazorApp2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/ConsoleApp1/ConsoleApp1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.OpenTelemetry" Version="1.2.0" />
<PackageReference Include="Serilog.Sinks.OpenTelemetry" Version="2.0.0" />
</ItemGroup>

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

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!--<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>-->
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->

Expand Down Expand Up @@ -33,7 +33,7 @@
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>-->
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<!--<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>-->
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>-->
</PropertyGroup>

Expand All @@ -56,14 +56,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="8.0.1" />
<PackageReference Include="CommunityToolkit.Maui.Core" Version="8.0.1" />
<PackageReference Include="CommunityToolkit.Maui.Maps" Version="2.0.1" />
<PackageReference Include="CommunityToolkit.Maui" Version="9.0.0" />
<PackageReference Include="CommunityToolkit.Maui.Core" Version="9.0.0" />
<PackageReference Include="CommunityToolkit.Maui.Maps" Version="2.0.2" />
<PackageReference Include="CommunityToolkit.Maui.Markup" Version="4.0.0" />
<PackageReference Include="CommunityToolkit.Maui.MediaElement" Version="3.1.0" />
<PackageReference Include="CommunityToolkit.Maui.MediaElement" Version="3.1.1" />
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.21" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.21" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.40" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.40" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion samples/TestProject1/TestProject1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.2.0">
Expand Down
2 changes: 1 addition & 1 deletion samples/WebApplication1/WebApplication1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Fluxera.Extensions.DependencyInjection.Abstractions" Version="8.2.0" />
<PackageReference Include="Fluxera.Guards" Version="8.0.2" />
<PackageReference Include="Fluxera.Extensions.DependencyInjection.Abstractions" Version="8.3.0" />
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="[6.0.29]" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.30" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="[7.0.18]" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.19" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Fluxera.Extensions.Hosting.AspNetCore\Fluxera.Extensions.Hosting.AspNetCore.csproj" />
<ProjectReference Include="..\Fluxera.Extensions.Hosting\Fluxera.Extensions.Hosting.csproj" />
</ItemGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace Fluxera.Extensions.Hosting
{
using Fluxera.Guards;
using JetBrains.Annotations;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -19,7 +18,7 @@ public static class ServiceCollectionExtensions
/// <returns>The service collection.</returns>
public static IServiceCollection AddActionContextAccessor(this IServiceCollection services)
{
Guard.Against.Null(services, nameof(services));
Guard.ThrowIfNull(services);

services.TryAddSingleton<IActionContextAccessor, ActionContextAccessor>();
return services;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
namespace Fluxera.Extensions.Hosting
{
using System;
using Fluxera.Guards;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -12,7 +11,7 @@ internal sealed class WebApplicationInitializationContext : IApplicationInitiali
{
public WebApplicationInitializationContext(IApplicationBuilder applicationBuilder)
{
Guard.Against.Null(applicationBuilder, nameof(applicationBuilder));
Guard.ThrowIfNull(applicationBuilder);

this.ApplicationBuilder = applicationBuilder;
this.ServiceProvider = applicationBuilder.ApplicationServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Threading.Tasks;
using Fluxera.Extensions.Hosting.Modules;
using Fluxera.Extensions.Hosting.Plugins;
using Fluxera.Guards;
using JetBrains.Annotations;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -31,7 +30,7 @@ public abstract class BlazorApplicationHost<TStartupModule> : IApplicationHost
/// <inheritdoc />
public async Task RunAsync(string[] args)
{
Guard.Against.Null(args);
Guard.ThrowIfNull(args);

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Threading.Tasks;
using Fluxera.Extensions.Hosting.Modules;
using Fluxera.Extensions.Hosting.Plugins;
using Fluxera.Guards;
using JetBrains.Annotations;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
Expand Down Expand Up @@ -35,7 +34,7 @@ public abstract class BlazorApplicationHost<TStartupModule, TRootComponent> : IA
/// <inheritdoc />
public async Task RunAsync(string[] args)
{
Guard.Against.Null(args);
Guard.ThrowIfNull(args);

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="[6.0.29]" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.30" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="[7.0.18]" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.19" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Fluxera.Extensions.Hosting\Fluxera.Extensions.Hosting.csproj" />
</ItemGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
</ItemGroup>

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

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0|AnyCPU'">
<WarningLevel>7</WarningLevel>
<NoWarn>1701;1702;NETSDK1023</NoWarn>
<WarningLevel>7</WarningLevel>
<NoWarn>1701;1702;NETSDK1023</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0|AnyCPU'">
<WarningLevel>7</WarningLevel>
<NoWarn>1701;1702;NETSDK1023</NoWarn>
<WarningLevel>7</WarningLevel>
<NoWarn>1701;1702;NETSDK1023</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0|AnyCPU'">
<NoWarn>1701;1702;NETSDK1023</NoWarn>
<NoWarn>1701;1702;NETSDK1023</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0|AnyCPU'">
<NoWarn>1701;1702;NETSDK1023</NoWarn>
<NoWarn>1701;1702;NETSDK1023</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand All @@ -48,16 +48,16 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.4" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.21" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.21" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.40" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.40" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 3 additions & 6 deletions src/Fluxera.Extensions.Hosting/ApplicationHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ namespace Fluxera.Extensions.Hosting
using System.Threading.Tasks;
using Fluxera.Extensions.Hosting.Modules;
using Fluxera.Extensions.Hosting.Plugins;
using Fluxera.Guards;
using Fluxera.Utilities.Extensions;
using JetBrains.Annotations;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -94,7 +92,7 @@ protected virtual IEnumerable<string> HostConfigurationEnvironmentVariablesPrefi
/// <inheritdoc />
public async Task RunAsync(string[] args)
{
Guard.Against.Null(args, nameof(args));
Guard.ThrowIfNull(args);

try
{
Expand Down Expand Up @@ -236,7 +234,7 @@ private IConfiguration BuildHostConfiguration(string[] args)

foreach(string prefix in this.HostConfigurationEnvironmentVariablesPrefixes)
{
if(prefix.IsNotNullOrWhiteSpace())
if(!string.IsNullOrWhiteSpace(prefix))
{
configurationBuilder.AddEnvironmentVariables(prefix);
}
Expand All @@ -260,8 +258,7 @@ private IHostEnvironment CreateHostingEnvironment(string[] args)

if(string.IsNullOrEmpty(hostingEnvironment.ApplicationName))
{
// Note GetEntryAssembly returns null for the net4x console test runner.
hostingEnvironment.ApplicationName = Assembly.GetEntryAssembly()?.GetName().Name;
hostingEnvironment.ApplicationName = Assembly.GetEntryAssembly()?.GetName()?.Name ?? "(unknown)";
}

hostingEnvironment.ContentRootFileProvider = new PhysicalFileProvider(hostingEnvironment.ContentRootPath);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
namespace Fluxera.Extensions.Hosting
{
using System;
using Fluxera.Guards;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand All @@ -11,7 +10,7 @@ internal class ApplicationInitializationContext : IApplicationInitializationCont
{
public ApplicationInitializationContext(IServiceProvider serviceProvider)
{
Guard.Against.Null(serviceProvider, nameof(serviceProvider));
Guard.ThrowIfNull(serviceProvider);

this.ServiceProvider = serviceProvider;
this.Configuration = this.ServiceProvider.GetRequiredService<IConfiguration>();
Expand Down
Loading

0 comments on commit 7817447

Please sign in to comment.