Skip to content

Add support for .netstandard2.1#101

Merged
springcomp merged 4 commits intojmespath-community:masterfrom
jmajoor:netstandard
Apr 6, 2024
Merged

Add support for .netstandard2.1#101
springcomp merged 4 commits intojmespath-community:masterfrom
jmajoor:netstandard

Conversation

@jmajoor
Copy link
Contributor

@jmajoor jmajoor commented Apr 4, 2024

This PR is related to #100
There are 2 parts.

  • Add netstandard2.1 as additional target.
    This part simply adds netstandard2.1 as an additional multi-target framework.
    Though this removes the vulnerabilities from netstandard1.3, the package has a dependency on gppg/gplex which remains dependent on netstandard1.3
  • Migrate to YaccLexTools
    The current gppg/gplex dependency is no longer maintained. Migrating to YaccLexTools provides several benefits.
    • Up-to-date / maintained package
    • No runtime dependencies (and no vulnerabilities).

The first part is pretty straightforward as it only needs to add netstandard2.1 as another framework target.
The second part is more involved. In particular as dotnet-ylt doesn't support netstandard1.3.
The YaccLexTool generates the following files:

  • JmesPathParser.g.cs
  • JmesPathScanner.g.cs
  • GplexBuffers.cs
  • ShiftReduceParserCode.cs

The last 2 are basically just runtime support and not related to the .lex and .y definitions.
Both GplexBuffers and ShiftReduceParserCode are using some Exception constructors that are not present in netstandard1.3.

The generated files have been checked in into the net13 folder and slightly modified to make them compile with 1.3.
The build process will use the generated files for net45 and netstandard 2.1 and use the modified files for 1.3.

This build complexity was chosen to remain compatible with netstandard 1.3.

If netstandard 1.3 is no longer required then this net13 subfolder can be removed.

The following test suites have been run successfully:

  • tools\jmespathnet.compliance\regression
  • tools\jmespathnet.compliance\jmespath.test\tests
  • tests\jmespathnet.tests

I only added the creation of the netstandard 2.1 package to the appveyor.yml. It makes some references to Any CPU which seems outdated, but I don't know the build environment that is used and therefore didn't want to change that.

The result of this PR is that is now supports netstandard2.1, net45, and netstandard1.3 and has no longer any dependencies on 3rd party packages in its runtime.

jmajoor added 2 commits April 3, 2024 10:41
To keep .netstandard1.3 support the generated GplexBuffers and ShiftReducePareser are checked in with a few minor conditional changes. For net45 and standard 2.1 the generated files will be use, for netstandard 1.3 the modified files (which normally won't change unless YaccLexTools changes them).
@jmajoor jmajoor mentioned this pull request Apr 4, 2024
jmajoor added 2 commits April 5, 2024 13:23
Make PubhbackQueue internal
Remove tabs from appveyor.yml
Code consistency for csproj
@jmajoor jmajoor requested a review from springcomp April 5, 2024 22:07
@springcomp
Copy link
Collaborator

Awesome contribution.
Thanks a lot for your time and work.

@springcomp springcomp merged commit e44af11 into jmespath-community:master Apr 6, 2024
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