Skip to content
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: 3 additions & 0 deletions BreakingChanges.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
5.0.0 Release
Now suported platfroms are .NET 6+, .NET Framework 4.6.2+, .NET Standard 2.0

4.0.0 Release
================

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 5.0.0 (Pending)
* [UPDATE][BREAKING] Drop unsupported platfroms. Now suported platfroms are .NET 6+, .NET Framework 4.6.2+, .NET Standard 2.0

### 4.4.0 (Jul 2022)
* [FIX] Fix issue checking for constructor args on null object. Thanks to @phongphanq, and @appel1! Thanks also to
@Mandroide for code review. (#683, #685)
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<PropertyGroup>
<TargetIsNetFx Condition="$(TargetFramework.StartsWith('net4'))">true</TargetIsNetFx>
<TargetIsNet5OrNewer Condition="'$(TargetFramework)' == 'net5.0' Or '$(TargetFramework)' == 'net6.0'">true</TargetIsNet5OrNewer>
<TargetIsNet5OrNewer Condition="'$(TargetFramework)' == 'net6.0'">true</TargetIsNet5OrNewer>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand All @@ -15,7 +15,7 @@
</PropertyGroup>

<ItemGroup Condition="'$(TargetIsNetFx)' == 'true'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
</ItemGroup>

</Project>
11 changes: 4 additions & 7 deletions build/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,17 @@ target "TestCodeFromDocs" <| fun _ ->
let csproj = """
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net46</TargetFrameworks>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="NUnit" Version="3.8.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\NSubstitute\NSubstitute.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>
"""
let projPath = outputCodePath </> "Docs.csproj"
Expand Down
25 changes: 6 additions & 19 deletions src/NSubstitute/NSubstitute.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,22 @@
<PackageProjectUrl>https://nsubstitute.github.io/</PackageProjectUrl>
<PackageLicenseExpression>BSD-3-Clause</PackageLicenseExpression>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\docs\images\nsubstitute-100x100.png" Pack="true" PackagePath="icon.png" Visible="false" />
</ItemGroup>

<PropertyGroup>
<TargetFrameworks>netstandard1.3;netstandard2.0;net45;net46;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;netstandard2.0;net462</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<PackageReference Include="System.Linq.Queryable" Version="4.3.0-*" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0-*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3' or '$(TargetIsNetFx)' == 'true'">
<PackageReference Include="Castle.Core" Version="4.4.1-*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetIsNet5OrNewer)' == 'true'">
<ItemGroup>
<PackageReference Include="Castle.Core" Version="5.0.0-*" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' != 'netstandard1.3' ">
<DefineConstants>$(DefineConstants);SYSTEM_REFLECTION_CUSTOMATTRIBUTES_IS_ARRAY</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetIsNet5OrNewer)' != 'true'">
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.3.0-*" />
</ItemGroup>

<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand All @@ -58,10 +49,6 @@
<NoWarn Condition="'$(TargetIsNet5OrNewer)' != 'true'">$(NoWarn);CS8632</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.3.0-*" Condition="'$(TargetIsNet5OrNewer)' != 'true'" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetIsNet5OrNewer)' == 'true'">
<DefineConstants>$(DefineConstants);SYSTEM_DIAGNOSTICS_CODEANALYSIS_NULLABILITY</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using NSubstitute.Core;
using System;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using NSubstitute.Core;

namespace NSubstitute.Routing.Handlers
{
Expand Down Expand Up @@ -39,12 +37,7 @@ private bool ReturnsDynamic(ICall call)
}

bool isDynamic;
#if SYSTEM_REFLECTION_CUSTOMATTRIBUTES_IS_ARRAY
isDynamic = returnParameter.GetCustomAttributes(DynamicAttributeType, inherit: false).Length != 0;
#else
var customAttributes = returnParameter.GetCustomAttributes(DynamicAttributeType, inherit: false);
isDynamic = customAttributes != null && customAttributes.Any();
#endif
return isDynamic;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net46;net45;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net462;net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetIsNetFx)' == 'true'">
Expand All @@ -18,8 +18,4 @@
<ProjectReference Include="..\..\src\NSubstitute\NSubstitute.csproj" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion tests/NSubstitute.Benchmarks/NSubstitute.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.4" />
<ProjectReference Include="..\..\src\NSubstitute\NSubstitute.csproj" />
</ItemGroup>
</Project>