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

Format NSubstitute.csproj layout + remove unusable code for net4.5 #761

Merged
merged 3 commits into from
Dec 25, 2023
Merged

Conversation

Romfos
Copy link
Contributor

@Romfos Romfos commented Dec 24, 2023

Changes:

  • Format NSubstitute.csproj layout
  • Minimize NoWarn section (some nowarn are no longer relevant)
  • Update default version to 5.0.0
  • Remove some dead code for net fx 4.5
  • Remove Microsoft.SourceLink.GitHub (starting from .net 8 included in sdk)

NSubstitute.csproj layout was updated to more classical:

  1. Common PropertyGroups
  2. Conditional PropertyGroups
  3. ItemGroups
  4. Conditional ItemGroups

note: no product changes, no need to release new nuget package

@Romfos Romfos marked this pull request as ready for review December 24, 2023 12:08
@Romfos Romfos changed the title Format NSubstitute.csproj layout + remove unusable code Format NSubstitute.csproj layout + remove unusable code for net4.5 Dec 24, 2023
Copy link
Member

@alexandrnikitin alexandrnikitin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you!

Remove Microsoft.SourceLink.GitHub (starting from .net 8 included in sdk)

One caveat is we need to use .NET 8 SDK for release builds. cc @dtchepak

@@ -247,21 +247,12 @@ private static object FromException(object value, Exception exception)

private static Task TaskFromException(Exception ex)
{
#if NET45
return new Task(() => throw ex);
#else
return Task.FromException(ex);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we don't need a wrapper method after the change and this can be inlined

Copy link
Contributor Author

@Romfos Romfos Dec 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are totally right, done

@alexandrnikitin alexandrnikitin merged commit 4d262d3 into nsubstitute:main Dec 25, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants