From 911a466fef318819435f22a86f1d6517c9a06c6c Mon Sep 17 00:00:00 2001 From: martincostello Date: Thu, 13 Dec 2018 13:37:52 +0000 Subject: [PATCH 1/2] Add NuGet package for Microsoft DI Add a new NuGet package to provide glue between JustSaying and Microsoft.Extensions.DependencyInjection. Resolves #474. --- Build.ps1 | 3 ++- .../IServiceCollectionExtensions.cs | 3 --- ...tensions.DependencyInjection.Microsoft.csproj | 16 ++++++++++++++++ .../ServiceProviderResolver.cs | 5 +++-- .../JustSaying.TestingFramework.csproj | 1 + JustSaying.sln | 6 ++++++ JustSaying/JustSaying.csproj | 4 +--- build.sh | 2 +- 8 files changed, 30 insertions(+), 10 deletions(-) rename {JustSaying/Microsoft/Extensions/DependencyInjection => JustSaying.Extensions.DependencyInjection.Microsoft}/IServiceCollectionExtensions.cs (98%) create mode 100644 JustSaying.Extensions.DependencyInjection.Microsoft/JustSaying.Extensions.DependencyInjection.Microsoft.csproj rename {JustSaying/Fluent => JustSaying.Extensions.DependencyInjection.Microsoft}/ServiceProviderResolver.cs (89%) diff --git a/Build.ps1 b/Build.ps1 index 37863ccb7..f058b8c20 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -14,7 +14,8 @@ $sdkFile = Join-Path $solutionPath "global.json" $libraryProjects = @( (Join-Path $solutionPath "JustSaying\JustSaying.csproj"), - (Join-Path $solutionPath "JustSaying.Models\JustSaying.Models.csproj") + (Join-Path $solutionPath "JustSaying.Models\JustSaying.Models.csproj"), + (Join-Path $solutionPath "JustSaying.Extensions.DependencyInjection.Microsoft\JustSaying.Extensions.DependencyInjection.Microsoft.csproj") ) $testProjects = @( diff --git a/JustSaying/Microsoft/Extensions/DependencyInjection/IServiceCollectionExtensions.cs b/JustSaying.Extensions.DependencyInjection.Microsoft/IServiceCollectionExtensions.cs similarity index 98% rename from JustSaying/Microsoft/Extensions/DependencyInjection/IServiceCollectionExtensions.cs rename to JustSaying.Extensions.DependencyInjection.Microsoft/IServiceCollectionExtensions.cs index 0a0c8f9e2..2fa01e206 100644 --- a/JustSaying/Microsoft/Extensions/DependencyInjection/IServiceCollectionExtensions.cs +++ b/JustSaying.Extensions.DependencyInjection.Microsoft/IServiceCollectionExtensions.cs @@ -18,9 +18,6 @@ namespace Microsoft.Extensions.DependencyInjection [EditorBrowsable(EditorBrowsableState.Never)] public static class IServiceCollectionExtensions { - // TODO This is here for convenience while protyping, would probably live elsewhere - // so we don't need to force the dependency on MS' DI types - /// /// Adds JustSaying services to the service collection. /// diff --git a/JustSaying.Extensions.DependencyInjection.Microsoft/JustSaying.Extensions.DependencyInjection.Microsoft.csproj b/JustSaying.Extensions.DependencyInjection.Microsoft/JustSaying.Extensions.DependencyInjection.Microsoft.csproj new file mode 100644 index 000000000..c2c631bd9 --- /dev/null +++ b/JustSaying.Extensions.DependencyInjection.Microsoft/JustSaying.Extensions.DependencyInjection.Microsoft.csproj @@ -0,0 +1,16 @@ + + + true + Microsoft.Extensions.DependencyInjection + netstandard2.0;net461 + + + + + + + + + + + diff --git a/JustSaying/Fluent/ServiceProviderResolver.cs b/JustSaying.Extensions.DependencyInjection.Microsoft/ServiceProviderResolver.cs similarity index 89% rename from JustSaying/Fluent/ServiceProviderResolver.cs rename to JustSaying.Extensions.DependencyInjection.Microsoft/ServiceProviderResolver.cs index 43a70fd23..af06c8ad6 100644 --- a/JustSaying/Fluent/ServiceProviderResolver.cs +++ b/JustSaying.Extensions.DependencyInjection.Microsoft/ServiceProviderResolver.cs @@ -1,8 +1,9 @@ using System; +using JustSaying.Fluent; using JustSaying.Messaging.MessageHandling; using Microsoft.Extensions.DependencyInjection; -namespace JustSaying.Fluent +namespace JustSaying { /// /// A class that implements and @@ -13,7 +14,7 @@ internal sealed class ServiceProviderResolver : IServiceResolver, IHandlerResolv /// /// Initializes a new instance of the class. /// - /// The to use. + /// The to use. internal ServiceProviderResolver(IServiceProvider serviceProvider) { ServiceProvider = serviceProvider; diff --git a/JustSaying.TestingFramework/JustSaying.TestingFramework.csproj b/JustSaying.TestingFramework/JustSaying.TestingFramework.csproj index 7417ee64a..441187302 100644 --- a/JustSaying.TestingFramework/JustSaying.TestingFramework.csproj +++ b/JustSaying.TestingFramework/JustSaying.TestingFramework.csproj @@ -4,6 +4,7 @@ + diff --git a/JustSaying.sln b/JustSaying.sln index e9385f689..0ac4859f7 100644 --- a/JustSaying.sln +++ b/JustSaying.sln @@ -48,6 +48,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEM .github\ISSUE_TEMPLATE\feature_request.md = .github\ISSUE_TEMPLATE\feature_request.md EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JustSaying.Extensions.DependencyInjection.Microsoft", "JustSaying.Extensions.DependencyInjection.Microsoft\JustSaying.Extensions.DependencyInjection.Microsoft.csproj", "{1B9BB1E2-E46B-4E2B-A172-61ABA8B35B62}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -78,6 +80,10 @@ Global {F7B166C4-B4B8-4B99-9038-63E964D2CABB}.Debug|Any CPU.Build.0 = Debug|Any CPU {F7B166C4-B4B8-4B99-9038-63E964D2CABB}.Release|Any CPU.ActiveCfg = Release|Any CPU {F7B166C4-B4B8-4B99-9038-63E964D2CABB}.Release|Any CPU.Build.0 = Release|Any CPU + {1B9BB1E2-E46B-4E2B-A172-61ABA8B35B62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1B9BB1E2-E46B-4E2B-A172-61ABA8B35B62}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1B9BB1E2-E46B-4E2B-A172-61ABA8B35B62}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1B9BB1E2-E46B-4E2B-A172-61ABA8B35B62}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/JustSaying/JustSaying.csproj b/JustSaying/JustSaying.csproj index f6d7bda39..eef5c8b29 100644 --- a/JustSaying/JustSaying.csproj +++ b/JustSaying/JustSaying.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;net461 @@ -12,11 +12,9 @@ - - diff --git a/build.sh b/build.sh index 0d9915f5b..3668f6292 100755 --- a/build.sh +++ b/build.sh @@ -20,8 +20,8 @@ if [ "$CI" != "" -a "$TRAVIS_OS_NAME" == "linux" ]; then export AWS_SERVICE_URL="http://localhost:4100" fi -dotnet restore JustSaying.sln --verbosity minimal || exit 1 dotnet build JustSaying/JustSaying.csproj --output $artifacts --configuration $configuration --framework "netstandard2.0" || exit 1 +dotnet build JustSaying.Extensions.DependencyInjection.Microsoft/JustSaying.Extensions.DependencyInjection.Microsoft.csproj --output $artifacts --configuration $configuration --framework "netstandard2.0" || exit 1 dotnet test ./JustSaying.UnitTests/JustSaying.UnitTests.csproj dotnet test ./JustSaying.IntegrationTests/JustSaying.IntegrationTests.csproj From 98cb4a70b42f240acec34271cdad49c737b7b3de Mon Sep 17 00:00:00 2001 From: martincostello Date: Sat, 15 Dec 2018 16:29:38 +0000 Subject: [PATCH 2/2] Add package description Add a relevant package description. --- .../JustSaying.Extensions.DependencyInjection.Microsoft.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/JustSaying.Extensions.DependencyInjection.Microsoft/JustSaying.Extensions.DependencyInjection.Microsoft.csproj b/JustSaying.Extensions.DependencyInjection.Microsoft/JustSaying.Extensions.DependencyInjection.Microsoft.csproj index c2c631bd9..734efacc0 100644 --- a/JustSaying.Extensions.DependencyInjection.Microsoft/JustSaying.Extensions.DependencyInjection.Microsoft.csproj +++ b/JustSaying.Extensions.DependencyInjection.Microsoft/JustSaying.Extensions.DependencyInjection.Microsoft.csproj @@ -1,5 +1,6 @@ - + + JustSaying extensions for Microsoft.Extensions.DependencyInjection. true Microsoft.Extensions.DependencyInjection netstandard2.0;net461