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

Reduce target framework of Reqnroll to netstandard2.0 #130

Merged
merged 30 commits into from
May 21, 2024

Conversation

gasparnagy
Copy link
Contributor

@gasparnagy gasparnagy commented May 14, 2024

This PR reduces the target framework of the main Reqnroll package and many other packages to "netstandard2.0". This includes the generator project.

Related discussion: https://github.com/orgs/reqnroll/discussions/31

Besides a simpler compilation and code management, this also supports creating Reqnroll packages using single target (netstandard2.0) projects. Multi-target projects are still allowed.

All supported frameworks (.NET 4.6.2+, .NET 6.0, .NET 7.0, .NET 8.0) support .NET Standard 2.0, so this is not a breaking change.

The Reqnroll.Tools.MsBuild.Generation project is still multi-target, because msbuild.exe and Visual Studio still compiles the projects using .NET Framework (.NET 4.8) and the netstandard2.0 version of the CodeDom dependency is not compatible with .NET 4.8 (we need the copy of the .NET Framework version of the CodeDom assembly). As the Reqnroll.Tools.MsBuild.Generation is a leaf project (no one has a project reference to it), this does not generate further needs for multi-targeting.

Finally the following projects have multi-target:

  • Reqnroll.Tools.MsBuild.Generation - as described above
  • Reqnroll.Verify.ReqnrollPlugin - because the Verify dependency has no netstandard2.0 support
  • Reqnroll.SpecFlowCompatibility.ReqnrollPlugin and the related generator project - because we support app.config handling only for .NET Framework

The System.Runtime.Loader package we use for plugin assembly loading on modern .NET versions is not compatible with .NET Framework and we have to fall back to Assembly.LoadFrom. This was done so far with an #if pragma, now it is abstracted away with the IPluginAssemblyLoader interface and the appropriate implementation is registered (PlatformHelper.RegisterPluginAssemblyLoader).

Checklist:

  • I have added an entry to the changelog. (mandatory)
  • I have extended the documentation

@gasparnagy gasparnagy force-pushed the simplify-target-fw branch from b02c5b8 to ae7c86a Compare May 14, 2024 17:14
@gasparnagy gasparnagy changed the title Reduce target framework of Reqnroll project to netstandard2.0 Reduce target framework of Reqnroll and other runtime projects to netstandard2.0 May 14, 2024
@gasparnagy gasparnagy force-pushed the simplify-target-fw branch from 6399a98 to 81d203c Compare May 15, 2024 09:20
@gasparnagy gasparnagy force-pushed the simplify-target-fw branch from c3e0608 to 9ac1ca9 Compare May 15, 2024 14:08
@gasparnagy gasparnagy marked this pull request as ready for review May 15, 2024 15:41
@gasparnagy gasparnagy changed the title Reduce target framework of Reqnroll and other runtime projects to netstandard2.0 Reduce target framework of Reqnroll to netstandard2.0 May 15, 2024
@gasparnagy gasparnagy added this to the v2 milestone May 15, 2024
@gasparnagy
Copy link
Contributor Author

I did some extra exploratory testing and it seems to work.

@gasparnagy gasparnagy merged commit 36d355f into main May 21, 2024
4 checks passed
@gasparnagy gasparnagy deleted the simplify-target-fw branch May 21, 2024 09:33
gasparnagy added a commit that referenced this pull request May 22, 2024
…ons-dependencyinjection-plugin

* origin/main: (21 commits)
  Fix #56 autofac ambiguous stepdef and hook required #127 issue (#139)
  Reduce target framework of Reqnroll to netstandard2.0 (#130)
  Fix StackOverflowException when using [StepArgumentTransformation] with same input and output type (#136)
  MsTest: Replace DelayedFixtureTearDown special case with ClassCleanupBehavior.EndOfClass (#128)
  Temporarily disabled tests until #132 is resolved
  Add NUnit & xUnit core tests to portability suite
  Capture ExecutionContext after every binding invoke (#126)
  small improvement in CodeDomHelper to be able to chain async calls
  fix method name sources in UnitTestFeatureGenerator
  External data plugin, support for JSON files  (#118)
  UnitTests: Check if SDK version is installed and if not ignore the test (#109)
  Fix 111 ignore attr not inherited from rule (#113)
  Update README.md (#110)
  Fix 81 - modified CucumberExpressionParameterTypeRegistry to handle multiple custom types used as cucumber expressions when those types share the same short name. (#104)
  Update index.md
  Simplify test project targets (#105)
  Make SystemTests temp folder configurable and use NUGET_PACKAGES env var to override global NuGet folder
  Fleshing out Generation System Tests (2) (#99)
  Fix for 81 - Cucumber Expression using Enums errors when two enums exist with the same short name (#100)
  Include BoDi to Reqnroll package (#91) (#95)
  ...

# Conflicts:
#	Reqnroll.sln
#	Tests/Reqnroll.PluginTests/Reqnroll.PluginTests.csproj
gasparnagy added a commit that referenced this pull request May 22, 2024
…hread-container

* origin/main:
  Extract cucumber expression detection heuristic to an interface
  fix test artifact folder calculation
  Restructure solution folders (#141)
  cleanup CHANGELOG.md
  ignore generated file
  remove generated file
  bump version
  Add Microsoft.Extensions.DependencyInjection integration plugin (#94)
  Fix #56 autofac ambiguous stepdef and hook required #127 issue (#139)
  Reduce target framework of Reqnroll to netstandard2.0 (#130)
  Fix StackOverflowException when using [StepArgumentTransformation] with same input and output type (#136)

# Conflicts:
#	CHANGELOG.md
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.

1 participant