Skip to content

Commit

Permalink
Merge pull request #162 from reactivemarbles/MigrateToReactiveMarbles
Browse files Browse the repository at this point in the history
Migrate code to ReactiveMarbles
  • Loading branch information
ChrisPulman authored May 18, 2024
2 parents 4da1337 + a1d6f5b commit 7ed718e
Show file tree
Hide file tree
Showing 84 changed files with 392 additions and 324 deletions.
11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

25 changes: 23 additions & 2 deletions .github/workflows/BuildDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
- name: 'Run: Compile, Deploy'
run: ./build.cmd Compile Deploy
- name: 'Run: Compile'
run: ./build.cmd Compile
env:
NuGetApiKey: ${{ secrets.NUGET_API_KEY }}

Expand All @@ -62,7 +62,21 @@ jobs:
with:
name: output
path: output

- name: Pack
run: dotnet pack --configuration=${{ env.configuration }} --verbosity=minimal --no-restore
working-directory: src

# Decode the base 64 encoded pfx and save the Signing_Certificate
- name: Sign NuGet packages
shell: pwsh
run: |
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.SIGNING_CERTIFICATE }}")
[IO.File]::WriteAllBytes("GitHubActionsWorkflow.pfx", $pfx_cert_byte)
$secure_password = ConvertTo-SecureString ${{ secrets.SIGN_CERTIFICATE_PASSWORD }} –asplaintext –force
Import-PfxCertificate -FilePath GitHubActionsWorkflow.pfx -Password $secure_password -CertStoreLocation Cert:\CurrentUser\My
nuget sign -Timestamper http://timestamp.digicert.com -CertificateFingerprint ${{ secrets.SIGN_CERTIFICATE_HASH }} **/*.nupkg
- name: Changelog
uses: glennawatson/ChangeLog@v1
id: changelog
Expand All @@ -76,3 +90,10 @@ jobs:
release_name: ${{ steps.nbgv.outputs.SemVer2 }}
body: |
${{ steps.changelog.outputs.commitLog }}
- name: NuGet Push
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
SOURCE_URL: https://api.nuget.org/v3/index.json
run: |
dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg
2 changes: 1 addition & 1 deletion .nuke/parameters.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "./build.schema.json",
"Solution": "src/CP.Extensions.Hosting.sln"
"Solution": "src/Extensions.Hosting.sln"
}
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
<Nullable>enable</Nullable>
<PackageIcon>logo.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>Compatability with Net 6 / 7 / 8 and net462</PackageReleaseNotes>
<PackageReleaseNotes>Compatability with Net 6 / 8 and net462</PackageReleaseNotes>
<PackageTags>Microsoft;Extensions;Hosting;Rx;ReactiveUI;net;netstandard</PackageTags>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
<AnalysisLevel>latest</AnalysisLevel>

<PackageProjectUrl>https://github.com/ChrisPulman/CP.Extensions.Hosting</PackageProjectUrl>
<RepositoryUrl>https://github.com/ChrisPulman/CP.Extensions.Hosting</RepositoryUrl>
<PackageProjectUrl>https://github.com/reactivemarbles/Extensions.Hosting</PackageProjectUrl>
<RepositoryUrl>https://github.com/reactivemarbles/Extensions.Hosting</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<!--https://devblogs.microsoft.com/dotnet/producing-packages-with-source-link/-->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down
Binary file modified Images/logo.ico
Binary file not shown.
Binary file modified Images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 26 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# CP.Extensions.Hosting
NOTE: The namespacing has been changed to ReactiveMarbles.Extensions.Hosting. Please update your references to the new namespace.

# ReactiveMarbles.Extensions.Hosting
An Extension of the Microsoft.Extensions.Hosting library with the aim of allowing windows applications to use the hosting base.

#### CP.Extensions.Hosting.Identity.EntityFrameworkCore.Sqlite
#### ReactiveMarbles.Extensions.Hosting.Identity.EntityFrameworkCore.Sqlite
![Nuget](https://img.shields.io/nuget/v/CP.Extensions.Hosting.Identity.EntityFrameworkCore.Sqlite) ![Nuget](https://img.shields.io/nuget/dt/CP.Extensions.Hosting.Identity.EntityFrameworkCore.Sqlite)

```C#
Expand All @@ -15,7 +17,7 @@ An Extension of the Microsoft.Extensions.Hosting library with the aim of allowin
})
```

#### CP.Extensions.Hosting.Identity.EntityFrameworkCore.SqlServer
#### ReactiveMarbles.Extensions.Hosting.Identity.EntityFrameworkCore.SqlServer
![Nuget](https://img.shields.io/nuget/v/CP.Extensions.Hosting.Identity.EntityFrameworkCore.SqlServer) ![Nuget](https://img.shields.io/nuget/dt/CP.Extensions.Hosting.Identity.EntityFrameworkCore.SqlServer)

```C#
Expand All @@ -29,13 +31,13 @@ An Extension of the Microsoft.Extensions.Hosting library with the aim of allowin
})
```

#### CP.Extensions.Hosting.MainUIThread
#### ReactiveMarbles.Extensions.Hosting.MainUIThread
![Nuget](https://img.shields.io/nuget/v/CP.Extensions.Hosting.MainUIThread) ![Nuget](https://img.shields.io/nuget/dt/CP.Extensions.Hosting.MainUIThread)

Used to run the main UI thread in a Wpf / WinUI / WinForms application.


#### CP.Extensions.Hosting.Plugins
#### ReactiveMarbles.Extensions.Hosting.Plugins
![Nuget](https://img.shields.io/nuget/v/CP.Extensions.Hosting.Plugins) ![Nuget](https://img.shields.io/nuget/dt/CP.Extensions.Hosting.Plugins)

```C#
Expand Down Expand Up @@ -63,14 +65,14 @@ Used to run the main UI thread in a Wpf / WinUI / WinForms application.

```C#
/// <summary>
/// This plug-in configures the HostBuilderContext to have the hosted services from the online example
/// This plug-in configures the HostBuilderContext to have the hosted services
/// </summary>
public class Plugin : PluginBase<FirstService, SecondService, ThirdService>
{
}
```

#### CP.Extensions.Hosting.PluginService
#### ReactiveMarbles.Extensions.Hosting.PluginService
![Nuget](https://img.shields.io/nuget/v/CP.Extensions.Hosting.PluginService) ![Nuget](https://img.shields.io/nuget/dt/CP.Extensions.Hosting.PluginService)

```C#
Expand All @@ -79,31 +81,37 @@ await ServiceHost.Create(
args,
hb => hb, // Configure the HostBuilder
host => {}, // Configure the Host
nameSpace: "AICS.Plugin").ConfigureAwait(false);
nameSpace: "ReactiveMarbles.Plugin").ConfigureAwait(false);
```

#### CP.Extensions.Hosting.ReactiveUI.WinForms
#### ReactiveMarbles.Extensions.Hosting.ReactiveUI.WinForms
![Nuget](https://img.shields.io/nuget/v/CP.Extensions.Hosting.ReactiveUI.WinForms) ![Nuget](https://img.shields.io/nuget/dt/CP.Extensions.Hosting.ReactiveUI.WinForms)

```C#
.ConfigureSplatForMicrosoftDependencyResolver()
.ConfigureSplatForMicrosoftDependencyResolver()
.ConfigureWinForms<MainForm>()
.UseWinFormsLifetime()
```

#### CP.Extensions.Hosting.ReactiveUI.WinUI
#### ReactiveMarbles.Extensions.Hosting.ReactiveUI.WinUI
![Nuget](https://img.shields.io/nuget/v/CP.Extensions.Hosting.ReactiveUI.WinUI) ![Nuget](https://img.shields.io/nuget/dt/CP.Extensions.Hosting.ReactiveUI.WinUI)

```C#
.ConfigureSplatForMicrosoftDependencyResolver()
.ConfigureSplatForMicrosoftDependencyResolver()
.ConfigureWinUI<MainWindow>()
.UseWpfLifetime()
```

#### CP.Extensions.Hosting.ReactiveUI.Wpf
#### ReactiveMarbles.Extensions.Hosting.ReactiveUI.Wpf
![Nuget](https://img.shields.io/nuget/v/CP.Extensions.Hosting.ReactiveUI.Wpf) ![Nuget](https://img.shields.io/nuget/dt/CP.Extensions.Hosting.ReactiveUI.Wpf)

```C#
.ConfigureSplatForMicrosoftDependencyResolver()
.ConfigureSplatForMicrosoftDependencyResolver()
.ConfigureWpf<MainWindow>()
.UseWpfLifetime()
```

#### CP.Extensions.Hosting.SingleInstance
#### ReactiveMarbles.Extensions.Hosting.SingleInstance
![Nuget](https://img.shields.io/nuget/v/CP.Extensions.Hosting.SingleInstance) ![Nuget](https://img.shields.io/nuget/dt/CP.Extensions.Hosting.SingleInstance)

```C#
Expand All @@ -118,23 +126,23 @@ await ServiceHost.Create(
})
```

#### CP.Extensions.Hosting.WinForms
#### ReactiveMarbles.Extensions.Hosting.WinForms
![Nuget](https://img.shields.io/nuget/v/CP.Extensions.Hosting.WinForms) ![Nuget](https://img.shields.io/nuget/dt/CP.Extensions.Hosting.WinForms)

```C#
.ConfigureWinForms<MainForm>()
.UseWinFormsLifetime()
```

#### CP.Extensions.Hosting.WinUI
#### ReactiveMarbles.Extensions.Hosting.WinUI
![Nuget](https://img.shields.io/nuget/v/CP.Extensions.Hosting.WinUI) ![Nuget](https://img.shields.io/nuget/dt/CP.Extensions.Hosting.WinUI)

```C#
.ConfigureWinUI<MainWindow>()
.UseWpfLifetime()
```

#### CP.Extensions.Hosting.Wpf
#### ReactiveMarbles.Extensions.Hosting.Wpf
![Nuget](https://img.shields.io/nuget/v/CP.Extensions.Hosting.Wpf) ![Nuget](https://img.shields.io/nuget/dt/CP.Extensions.Hosting.Wpf)

```C#
Expand Down
14 changes: 0 additions & 14 deletions src/CP.Extensions.Hosting.MainUIThread/BaseUiContext.cs

This file was deleted.

15 changes: 0 additions & 15 deletions src/CP.Extensions.Hosting.WinForms/IWinFormsService.cs

This file was deleted.

11 changes: 0 additions & 11 deletions src/CP.Extensions.Hosting.WinForms/IWinFormsShell.cs

This file was deleted.

17 changes: 0 additions & 17 deletions src/CP.Extensions.Hosting.WinForms/Internals/WinFormsContext.cs

This file was deleted.

11 changes: 0 additions & 11 deletions src/CP.Extensions.Hosting.Wpf/IWpfShell.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>CP.Extensions.Hosting.Identity.EntityFrameworkCore.Sqlite</PackageId>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Chris Pulman. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// Copyright (c) 2019-2024 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
Expand All @@ -8,7 +9,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace CP.Extensions.Hosting.Identity.EntityFrameworkCore;
namespace ReactiveMarbles.Extensions.Hosting.Identity.EntityFrameworkCore;

/// <summary>
/// Host Builder Entity Framework Core Extensions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>CP.Extensions.Hosting.Identity.EntityFrameworkCore.SqlServer</PackageId>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Chris Pulman. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// Copyright (c) 2019-2024 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
Expand All @@ -8,7 +9,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace CP.Extensions.Hosting.Identity.EntityFrameworkCore;
namespace ReactiveMarbles.Extensions.Hosting.Identity.EntityFrameworkCore;

/// <summary>
/// Host Builder Entity Framework Core Extensions.
Expand Down
15 changes: 15 additions & 0 deletions src/Extensions.Hosting.MainUIThread/BaseUiContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2019-2024 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

namespace ReactiveMarbles.Extensions.Hosting.UiThread;

/// <inheritdoc />
public abstract class BaseUiContext : IUiContext
{
/// <inheritdoc />
public bool IsLifetimeLinked { get; set; }

/// <inheritdoc />
public bool IsRunning { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// Copyright (c) Chris Pulman. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// Copyright (c) 2019-2024 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using System;
using System.Threading;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace CP.Extensions.Hosting.UiThread;
namespace ReactiveMarbles.Extensions.Hosting.UiThread;

/// <summary>
/// This contains the base logic for the UI thread (WPF, WinForms).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net462;net6.0-windows;net8.0-windows</TargetFrameworks>
<PackageId>CP.Extensions.Hosting.MainUIThread</PackageId>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright (c) Chris Pulman. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// Copyright (c) 2019-2024 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

namespace CP.Extensions.Hosting.UiThread;
namespace ReactiveMarbles.Extensions.Hosting.UiThread;

/// <summary>
/// The UI context contains all information about a UI application and how it's started and stopped.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Copyright (c) Chris Pulman. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// Copyright (c) 2019-2024 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using Microsoft.Extensions.Logging;

namespace CP.Extensions.Hosting.PluginService;
namespace ReactiveMarbles.Extensions.Hosting.PluginService;

/// <summary>
/// DefaultLogger.
Expand Down
Loading

0 comments on commit 7ed718e

Please sign in to comment.