Skip to content

Commit

Permalink
Merge pull request #244 from jbogard/netstandard20
Browse files Browse the repository at this point in the history
Adding netstandard2.0 support plus more tests
  • Loading branch information
jbogard authored Mar 20, 2018
2 parents 73d7104 + 8c87a3c commit 99b77d8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ $versionSuffix = @{ $true = "--version-suffix=$($suffix)"; $false = ""}[$suffix
echo "build: Package version suffix is $suffix"
echo "build: Build version suffix is $buildSuffix"

exec { & dotnet build MediatR.sln -c Release --version-suffix=$buildSuffix -v q /nologo }
exec { & dotnet build MediatR.sln -c Release --version-suffix=$buildSuffix }

Push-Location -Path .\test\MediatR.Tests

exec { & dotnet xunit -configuration Release --fx-version 2.0.0 }
exec { & dotnet xunit -configuration Release --no-build }

Pop-Location

Expand Down
4 changes: 2 additions & 2 deletions samples/MediatR.Examples/MediatR.Examples.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard1.1</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
<AssemblyName>MediatR.Examples</AssemblyName>
<PackageId>MediatR.Examples</PackageId>
</PropertyGroup>
Expand All @@ -20,7 +20,7 @@
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.1' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
<PackageReference Include="System.Collections" Version="4.3.0" />
<PackageReference Include="System.Linq" Version="4.3.0" />
Expand Down
6 changes: 3 additions & 3 deletions src/MediatR/MediatR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup>
<Description>Simple, unambitious mediator implementation in .NET</Description>
<Copyright>Copyright Jimmy Bogard</Copyright>
<VersionPrefix>4.0.1</VersionPrefix>
<VersionPrefix>4.1.0</VersionPrefix>
<Authors>Jimmy Bogard</Authors>
<TargetFrameworks>net45;netstandard1.1</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.3;netstandard2.0</TargetFrameworks>
<AssemblyName>MediatR</AssemblyName>
<PackageId>MediatR</PackageId>
<PackageTags>mediator;request;response;queries;commands;notifications</PackageTags>
Expand All @@ -16,7 +16,7 @@
<RepositoryUrl>git://github.com/jbogard/mediatr</RepositoryUrl>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion test/MediatR.Tests/GenericTypeConstraintsTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Reflection;
using System.Threading;

namespace MediatR.Tests
Expand Down Expand Up @@ -31,7 +32,7 @@ public GenericTypeRequestHandlerTestClass()
{
IsIRequest = typeof(IRequest).IsAssignableFrom(typeof(TRequest));
IsIRequestT = typeof(TRequest).GetInterfaces()
.Any(x => x.IsGenericType &&
.Any(x => x.GetTypeInfo().IsGenericType &&
x.GetGenericTypeDefinition() == typeof(IRequest<>));

IsIBaseRequest = typeof(IBaseRequest).IsAssignableFrom(typeof(TRequest));
Expand Down
12 changes: 6 additions & 6 deletions test/MediatR.Tests/MediatR.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>net461;netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
<AssemblyName>MediatR.Tests</AssemblyName>
<PackageId>MediatR.Tests</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>

<ItemGroup>
Expand All @@ -14,8 +13,9 @@
<ItemGroup>
<PackageReference Include="xunit" Version="2.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
<PackageReference Include="Shouldly" Version="3.0.0" />
<PackageReference Include="structuremap" Version="4.5.3" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
Expand All @@ -24,8 +24,8 @@
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<RuntimeFrameworkVersion>2.0.3</RuntimeFrameworkVersion>
</PropertyGroup>

</Project>

0 comments on commit 99b77d8

Please sign in to comment.