Skip to content

Commit

Permalink
Updated packages. (#13)
Browse files Browse the repository at this point in the history
* Added MAUI project.

* Updated packages.
  • Loading branch information
mgernand authored Jun 7, 2022
1 parent 5126e0a commit f8ad9b7
Show file tree
Hide file tree
Showing 22 changed files with 87 additions and 41 deletions.
7 changes: 7 additions & 0 deletions Fluxera.Extensions.Hosting.sln
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fluxera.Extensions.Hosting.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fluxera.Extensions.Hosting.UnitTests", "tests\Fluxera.Extensions.Hosting.UnitTests\Fluxera.Extensions.Hosting.UnitTests.csproj", "{3E8945B5-D2C4-43D1-80D3-F669052815C2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fluxera.Extensions.Hosting.Maui", "src\Fluxera.Extensions.Hosting.Maui\Fluxera.Extensions.Hosting.Maui.csproj", "{817778CE-B4C1-4B57-A692-BE276CB279D4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -83,6 +85,10 @@ Global
{3E8945B5-D2C4-43D1-80D3-F669052815C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E8945B5-D2C4-43D1-80D3-F669052815C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E8945B5-D2C4-43D1-80D3-F669052815C2}.Release|Any CPU.Build.0 = Release|Any CPU
{817778CE-B4C1-4B57-A692-BE276CB279D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{817778CE-B4C1-4B57-A692-BE276CB279D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{817778CE-B4C1-4B57-A692-BE276CB279D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{817778CE-B4C1-4B57-A692-BE276CB279D4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -97,6 +103,7 @@ Global
{D0958D89-736C-4304-9280-20AE37E0D871} = {DF28D730-99B3-4811-AAC7-725A73B3F668}
{3E78416A-8F6B-4343-AFA6-930B27574415} = {DF28D730-99B3-4811-AAC7-725A73B3F668}
{3E8945B5-D2C4-43D1-80D3-F669052815C2} = {F18D2D58-282C-4D93-8D9A-3A76CF98F018}
{817778CE-B4C1-4B57-A692-BE276CB279D4} = {DF28D730-99B3-4811-AAC7-725A73B3F668}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D97BF2AF-6E68-4E88-BF70-773A86E26013}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Fluxera.Extensions.DependencyInjection.Abstractions" Version="6.0.33" />
<PackageReference Include="Fluxera.Guards" Version="6.0.22" />
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="Fluxera.Extensions.DependencyInjection.Abstractions" Version="6.1.1" />
<PackageReference Include="Fluxera.Guards" Version="6.1.0" />
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public abstract class WebApplicationHost<TStartupModule> : ApplicationHost<TStartupModule>
where TStartupModule : class, IModule
{
private WebApplicationBuilder webApplicationBuilder = null!;
private WebApplicationBuilder webApplicationBuilder;

/// <inheritdoc />
protected override ApplicationLoaderBuilderFunc ApplicationLoaderBuilder => ApplicationLoaderBuilderFuncFactory.CreateApplication;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// </summary>
internal sealed class WebApplicationLoader : ApplicationLoader
{
private WebApplicationLoaderInitializationContext webContext = null!;
private WebApplicationLoaderInitializationContext webContext;

public WebApplicationLoader(
Type startupModuleType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public abstract class BlazorApplicationHost<TStartupModule, TRootComponent> : IA
where TRootComponent : class, IComponent
{
private ApplicationHostEvents events = new ApplicationHostEvents();
private ILogger logger = null!;
private ILogger logger;

/// <summary>
/// Gets the command line arguments.
/// </summary>
protected string[] CommandLineArgs { get; private set; } = null!;
protected string[] CommandLineArgs { get; private set; }

/// <inheritdoc />
public async Task RunAsync(string[] args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<Title>Fluxera.Extensions.Hosting.Maui</Title>
<Description>A modular application host for .NET MAUI.</Description>
<PackageTags>library;extensions;hosting;modular;maui</PackageTags>
<RootNamespace>$(MSBuildProjectName.Replace(" ", "_").Replace(".Maui",""))</RootNamespace>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\README.md" Link="Properties\README.md">
<Pack>true</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\icon.png" Link="Properties\icon.png">
<Pack>true</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

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

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

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

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/Fluxera.Extensions.Hosting.Wpf/WpfContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ internal sealed class WpfContext

public ShutdownMode ShutdownMode { get; set; } = ShutdownMode.OnLastWindowClose;

public Application Application { get; set; } = null!;
public Application Application { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public abstract class XamarinApplication : Application
/// <summary>
/// Gets or sets the host.
/// </summary>
public IHost Host { get; internal set; } = null!;
public IHost Host { get; internal set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ public abstract class XamarinApplicationHost<TStartupModule, TApplication> : IXa
where TStartupModule : class, IModule
where TApplication : XamarinApplication
{
private IHostEnvironment environment = null!;
private IHostEnvironment environment;
private ApplicationHostEvents events = new ApplicationHostEvents();
private IHost host = null!;
private IHostBuilder hostBuilder = null!;
private ILogger logger = null!;
private IHost host;
private IHostBuilder hostBuilder;
private ILogger logger;

/// <inheritdoc />
public Task StartAsync(CancellationToken cancellationToken = default)
Expand Down
8 changes: 4 additions & 4 deletions src/Fluxera.Extensions.Hosting/ApplicationHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ public static void Run<TApplicationHost>(string[] args)
public abstract class ApplicationHost<TStartupModule> : IApplicationHost
where TStartupModule : class, IModule
{
private IHostEnvironment environment = null!;
private IHostEnvironment environment;
private ApplicationHostEvents events = new ApplicationHostEvents();
private IHostBuilder hostBuilder = null!;
private ILogger logger = null!;
private IHostBuilder hostBuilder;
private ILogger logger;

/// <summary>
/// Gets the command line arguments of the application.
/// </summary>
protected string[] CommandLineArgs { get; private set; } = null!;
protected string[] CommandLineArgs { get; private set; }

/// <summary>
/// Gets the optional allocation loader builder function.
Expand Down
2 changes: 1 addition & 1 deletion src/Fluxera.Extensions.Hosting/ApplicationLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public ApplicationLoader(
public Type StartupModuleType { get; }

/// <inheritdoc />
public IServiceProvider ServiceProvider { get; private set; } = null!;
public IServiceProvider ServiceProvider { get; private set; }

/// <inheritdoc />
public IReadOnlyCollection<IModuleDescriptor> Modules { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Fluxera.Extensions.DependencyInjection" Version="6.0.33" />
<PackageReference Include="Fluxera.Guards" Version="6.0.22" />
<PackageReference Include="Fluxera.Utilities" Version="6.0.16" />
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="Fluxera.Extensions.DependencyInjection" Version="6.1.1" />
<PackageReference Include="Fluxera.Guards" Version="6.1.0" />
<PackageReference Include="Fluxera.Utilities" Version="6.1.1" />
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
10 changes: 6 additions & 4 deletions src/Fluxera.Extensions.Hosting/LoggingContextExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Fluxera.Extensions.Hosting
// ReSharper disable PossibleNullReferenceException

namespace Fluxera.Extensions.Hosting
{
using System;
using System.Linq.Expressions;
Expand All @@ -22,7 +24,7 @@ public static void Log<T>(this ILoggingContext<T> context, Expression<Func<T, T>
Guard.Against.Null(context);
Guard.Against.Null(expression);

MethodCallExpression methodCallExpression = (expression.Body as MethodCallExpression)!;
MethodCallExpression methodCallExpression = expression.Body as MethodCallExpression;
Guard.Against.Null(methodCallExpression, nameof(methodCallExpression));

string methodName = methodCallExpression.Method.Name;
Expand All @@ -43,7 +45,7 @@ public static void Log<T>(this ILoggingContext<T> context, Expression<Action<T>>
Guard.Against.Null(context);
Guard.Against.Null(expression);

MethodCallExpression methodCallExpression = (expression.Body as MethodCallExpression)!;
MethodCallExpression methodCallExpression = expression.Body as MethodCallExpression;
Guard.Against.Null(methodCallExpression, nameof(methodCallExpression));

string methodName = methodCallExpression.Method.Name;
Expand Down Expand Up @@ -81,7 +83,7 @@ public static TResult Log<T, TResult>(this ILoggingContext<T> context, Expressio
Guard.Against.Null(context, nameof(context));
Guard.Against.Null(expression, nameof(expression));

MethodCallExpression methodCallExpression = (expression.Body as MethodCallExpression)!;
MethodCallExpression methodCallExpression = expression.Body as MethodCallExpression;
Guard.Against.Null(methodCallExpression, nameof(methodCallExpression));

string methodName = methodCallExpression.Method.Name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public ServiceConfigurationContext(IServiceCollection services)
public object this[string key]
{
get => this.Items.TryGetValue(key, out object obj) ? obj : null;
set => this.Items[key] = value!;
set => this.Items[key] = value;
}

/// <inheritdoc />
Expand Down
14 changes: 7 additions & 7 deletions tests/Fluxera.Extensions.Hosting.UnitTests/HostingModuleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void ShouldCallConfigure()
TestApplicationModule module = descriptor.Instance as TestApplicationModule;

module.Should().NotBeNull();
module!.ConfigureWasCalled.Should().BeTrue();
module.ConfigureWasCalled.Should().BeTrue();
}

[Test]
Expand All @@ -25,7 +25,7 @@ public void ShouldCallConfigureServices()
TestApplicationModule module = descriptor.Instance as TestApplicationModule;

module.Should().NotBeNull();
module!.ConfigureServicesWasCalled.Should().BeTrue();
module.ConfigureServicesWasCalled.Should().BeTrue();
}

[Test]
Expand All @@ -36,7 +36,7 @@ public void ShouldCallOnApplicationShutdown()
TestApplicationModule module = descriptor.Instance as TestApplicationModule;

module.Should().NotBeNull();
module!.OnApplicationShutdownWasCalled.Should().BeTrue();
module.OnApplicationShutdownWasCalled.Should().BeTrue();
}

[Test]
Expand All @@ -46,7 +46,7 @@ public void ShouldCallPostConfigure()
TestApplicationModule module = descriptor.Instance as TestApplicationModule;

module.Should().NotBeNull();
module!.PostConfigureWasCalled.Should().BeTrue();
module.PostConfigureWasCalled.Should().BeTrue();
}

[Test]
Expand All @@ -56,7 +56,7 @@ public void ShouldCallPostConfigureServices()
TestApplicationModule module = descriptor.Instance as TestApplicationModule;

module.Should().NotBeNull();
module!.PostConfigureServicesWasCalled.Should().BeTrue();
module.PostConfigureServicesWasCalled.Should().BeTrue();
}

[Test]
Expand All @@ -66,7 +66,7 @@ public void ShouldCallPreConfigure()
TestApplicationModule module = descriptor.Instance as TestApplicationModule;

module.Should().NotBeNull();
module!.PreConfigureWasCalled.Should().BeTrue();
module.PreConfigureWasCalled.Should().BeTrue();
}

[Test]
Expand All @@ -76,7 +76,7 @@ public void ShouldCallPreConfigureServices()
TestApplicationModule module = descriptor.Instance as TestApplicationModule;

module.Should().NotBeNull();
module!.PreConfigureServicesWasCalled.Should().BeTrue();
module.PreConfigureServicesWasCalled.Should().BeTrue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void Setup()
public void TearDown()
{
this.ApplicationLoader?.Shutdown();
this.ApplicationLoader = null!;
this.ApplicationLoader = null;
}
}
}

0 comments on commit f8ad9b7

Please sign in to comment.