Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NuGet package for Microsoft DI #479

Merged
merged 2 commits into from
Dec 18, 2018
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
3 changes: 2 additions & 1 deletion Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

/// <summary>
/// Adds JustSaying services to the service collection.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>JustSaying extensions for Microsoft.Extensions.DependencyInjection.</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RootNamespace>Microsoft.Extensions.DependencyInjection</RootNamespace>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\JustSaying\JustSaying.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="1.1.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System;
using JustSaying.Fluent;
using JustSaying.Messaging.MessageHandling;
using Microsoft.Extensions.DependencyInjection;

namespace JustSaying.Fluent
namespace JustSaying
{
/// <summary>
/// A class that implements <see cref="IServiceResolver"/> and <see cref="IHandlerResolver"/>
Expand All @@ -13,7 +14,7 @@ internal sealed class ServiceProviderResolver : IServiceResolver, IHandlerResolv
/// <summary>
/// Initializes a new instance of the <see cref="ServiceProviderResolver"/> class.
/// </summary>
/// <param name="parent">The <see cref="IServiceProvider"/> to use.</param>
/// <param name="serviceProvider">The <see cref="IServiceProvider"/> to use.</param>
internal ServiceProviderResolver(IServiceProvider serviceProvider)
{
ServiceProvider = serviceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\JustSaying\JustSaying.csproj" />
<ProjectReference Include="..\JustSaying.Extensions.DependencyInjection.Microsoft\JustSaying.Extensions.DependencyInjection.Microsoft.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.5.1" />
Expand Down
6 changes: 6 additions & 0 deletions JustSaying.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions JustSaying/JustSaying.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>
Expand All @@ -12,11 +12,9 @@
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="1.1.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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