-
-
Notifications
You must be signed in to change notification settings - Fork 1
Add Dotnet Implementation #81
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
base: main
Are you sure you want to change the base?
Changes from all commits
8104b9e
8a7a7e9
281e078
8360374
5aa6c09
3327bcf
0c69735
828599e
cec1a90
65c2338
d37f949
327fed7
dca52dc
a1fa5f4
ab4ede1
ce11f7f
aacc93e
863fcd2
3d69e28
4dc864a
6b546ca
08fe99f
af036e9
9462171
8155e67
164c983
19d95b5
d2f2b43
83b504b
32e6634
669d655
d925be3
e6b20db
ccef650
d35a534
6aedb35
e7f6db1
4fd7cd9
cd39810
6ff92ec
a18fe36
c2436c7
5835e96
182cd5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: Release NuGet | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ release/* ] | ||
|
|
||
| jobs: | ||
| publish-nuget: | ||
| name: Publish package to NuGet.org | ||
| # Failing on `ubuntu-24.04` (https://github.com/cucumber/gherkin/issues/349) | ||
| runs-on: ubuntu-22.04 | ||
| environment: Release | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v5 | ||
| with: | ||
| dotnet-version: 9.0.x | ||
| - uses: cucumber/action-publish-nuget@v1.0.0 | ||
| with: | ||
| nuget-api-key: ${{ secrets.NUGET_API_KEY }} | ||
| working-directory: "dotnet" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: test-dotnet | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - renovate/** | ||
| paths: | ||
| - dotnet/** | ||
| - testdata/** | ||
| - .github/** | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - dotnet/** | ||
| - testdata/** | ||
| - .github/** | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| test-dotnet: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-dotnet@v5 | ||
| with: | ||
| dotnet-version: | | ||
| 8.0.x | ||
| 9.0.x | ||
| - run: dotnet test | ||
| working-directory: dotnet | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ This is a polyglot repo with several languages adhering to a common suite of acc | |
|
|
||
| - Java (reference) | ||
| - JavaScript | ||
| - C# (.NET) | ||
|
|
||
| Java is the reference implementation in the sense that it is responsible for generating the fixtures that are used in the acceptance tests to verify all implementations. | ||
|
|
||
|
|
@@ -22,12 +23,12 @@ So your playbook for adding a method would be something like: | |
|
|
||
| Choosing which type to use in another language based on what we did in Java is an inexact science. This table defines all the decisions we've made so far: | ||
|
|
||
| | Java | JavaScript | | ||
| |---------------------|-------------------------| | ||
| | `Optional<T>` | `T \| undefined`[^1] | | ||
| | `List<T>` | `ReadonlyArray<T>` | | ||
| | `Map<K, V>` | `Map<K, V>` | | ||
| | `Map<K, V>` | `Record<K, V>` | | ||
| | `List<Entry<T, V>>` | `ReadonlyArray<[T, V]>` | | ||
| | Java | JavaScript | C# | | ||
| |---------------------|-------------------------|-------------------------| | ||
| | `Optional<T>` | `T \| undefined`[^1] | `T?` | | ||
| | `List<T>` | `ReadonlyArray<T>` | `List<T>` | | ||
| | `Map<K, V>` | `Map<K, V>` | `Dictionary<K, V>` | | ||
| | `Map<K, V>` | `Record<K, V>` | `Dictionary<K, V>` | | ||
| | `List<Entry<T, V>>` | `ReadonlyArray<[T, V]>` | `List<Entry<T, V>>` | | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I took that as an example of a kvp. Perhaps the .NET example should be
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Yes, I would mention |
||
|
|
||
| [^1]: See <https://github.com/sindresorhus/meta/discussions/7> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| root=true | ||
|
|
||
| [*] | ||
| indent_style=space | ||
| end_of_line=crlf | ||
| charset=utf-8 | ||
|
|
||
| [*.{csproj,props}] | ||
| indent_size=2 | ||
|
|
||
| [*.cs] | ||
| indent_size=4 | ||
| insert_final_newline = true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,180 @@ | ||
| ## Ignore Visual Studio temporary files, build results, and | ||
| ## files generated by popular Visual Studio add-ons. | ||
|
|
||
| # User-specific files | ||
| *.suo | ||
| *.user | ||
| *.sln.docstates | ||
| *.ide | ||
|
|
||
| # Build results | ||
|
|
||
| [Dd]ebug/ | ||
| [Rr]elease/ | ||
| x64/ | ||
| build/ | ||
| [Oo]bj/ | ||
| */**/bin | ||
|
|
||
| # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets | ||
| !packages/*/build/ | ||
|
|
||
| # MSTest test Results | ||
| [Tt]est[Rr]esult*/ | ||
| [Bb]uild[Ll]og.* | ||
|
|
||
| *_i.c | ||
| *_p.c | ||
| *.ilk | ||
| *.meta | ||
| *.obj | ||
| *.pch | ||
| *.pdb | ||
| *.pgc | ||
| *.pgd | ||
| *.rsp | ||
| *.sbr | ||
| *.tlb | ||
| *.tli | ||
| *.tlh | ||
| *.tmp | ||
| *.tmp_proj | ||
| *.log | ||
| *.vspscc | ||
| *.vssscc | ||
| .builds | ||
| *.pidb | ||
| *.log | ||
| *.scc | ||
|
|
||
| # Visual C++ cache files | ||
| ipch/ | ||
| *.aps | ||
| *.ncb | ||
| *.opensdf | ||
| *.sdf | ||
| *.cachefile | ||
|
|
||
| # Visual Studio profiler | ||
| *.psess | ||
| *.vsp | ||
| *.vspx | ||
|
|
||
| # Guidance Automation Toolkit | ||
| *.gpState | ||
|
|
||
| # ReSharper is a .NET coding add-in | ||
| _ReSharper*/ | ||
| *.[Rr]e[Ss]harper | ||
|
|
||
| # TeamCity is a build add-in | ||
| _TeamCity* | ||
|
|
||
| # DotCover is a Code Coverage Tool | ||
| *.dotCover | ||
|
|
||
| # NCrunch | ||
| *.ncrunch* | ||
| .*crunch*.local.xml | ||
|
|
||
| # Installshield output folder | ||
| [Ee]xpress/ | ||
|
|
||
| # DocProject is a documentation generator add-in | ||
| DocProject/buildhelp/ | ||
| DocProject/Help/*.HxT | ||
| DocProject/Help/*.HxC | ||
| DocProject/Help/*.hhc | ||
| DocProject/Help/*.hhk | ||
| DocProject/Help/*.hhp | ||
| DocProject/Help/Html2 | ||
| DocProject/Help/html | ||
|
|
||
| # Click-Once directory | ||
| publish/ | ||
|
|
||
| # Publish Web Output | ||
| *.Publish.xml | ||
|
|
||
| # NuGet Packages Directory | ||
| ## TODO: If you have NuGet Package Restore enabled, uncomment the next line | ||
| #packages/ | ||
|
|
||
| # Windows Azure Build Output | ||
| csx | ||
| *.build.csdef | ||
|
|
||
| # Windows Store app package directory | ||
| AppPackages/ | ||
|
|
||
| # Others | ||
| sql/ | ||
| *.Cache | ||
| ClientBin/ | ||
| [Ss]tyle[Cc]op.* | ||
| ~$* | ||
| *~ | ||
| *.dbmdl | ||
| *.[Pp]ublish.xml | ||
| *.pfx | ||
| *.publishsettings | ||
|
|
||
| # RIA/Silverlight projects | ||
| Generated_Code/ | ||
|
|
||
| # Backup & report files from converting an old project file to a newer | ||
| # Visual Studio version. Backup files are not needed, because we have git ;-) | ||
| _UpgradeReport_Files/ | ||
| Backup*/ | ||
| UpgradeLog*.XML | ||
| UpgradeLog*.htm | ||
|
|
||
| # SQL Server files | ||
| App_Data/*.mdf | ||
| App_Data/*.ldf | ||
|
|
||
|
|
||
| #LightSwitch generated files | ||
| GeneratedArtifacts/ | ||
| _Pvt_Extensions/ | ||
| ModelManifest.xml | ||
|
|
||
| # ========================= | ||
| # Windows detritus | ||
| # ========================= | ||
|
|
||
| # Windows image file caches | ||
| Thumbs.db | ||
| ehthumbs.db | ||
|
|
||
| # Folder config file | ||
| Desktop.ini | ||
|
|
||
| # Recycle Bin used on file shares | ||
| $RECYCLE.BIN/ | ||
|
|
||
| # Mac desktop service store files | ||
| .DS_Store | ||
|
|
||
| packages/ | ||
| acceptance/ | ||
| output/ | ||
| .built | ||
| .compared | ||
| .sln_built_debug | ||
| *.userprefs | ||
| *.nupkg | ||
| Gherkin.NuGetPackages/bin/ | ||
| .build* | ||
| .built* | ||
| .vscode | ||
| .run_tests | ||
| .generated | ||
| .packed | ||
| .tested | ||
| .fixprotoc | ||
| .vs/ | ||
|
|
||
| # ======================== | ||
| # Query project specific ignore settings | ||
| Query/QueryTest/testdata/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please save this file as SLNX instead? Will be easier to maintain long term. |
||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 17 | ||
| VisualStudioVersion = 17.14.36221.1 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cucumber.Query", "Query\Cucumber.Query.csproj", "{01EF081E-A17A-4630-9C7D-40BA4BE3F9BC}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cucumber.QueryTest", "QueryTest\Cucumber.QueryTest.csproj", "{F0EA5832-C5B7-42CF-9BDB-6EE21C589C8B}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution ITems", "Solution ITems", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" | ||
| ProjectSection(SolutionItems) = preProject | ||
| Directory.Build.props = Directory.Build.props | ||
| EndProjectSection | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {01EF081E-A17A-4630-9C7D-40BA4BE3F9BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {01EF081E-A17A-4630-9C7D-40BA4BE3F9BC}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {01EF081E-A17A-4630-9C7D-40BA4BE3F9BC}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {01EF081E-A17A-4630-9C7D-40BA4BE3F9BC}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {F0EA5832-C5B7-42CF-9BDB-6EE21C589C8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {F0EA5832-C5B7-42CF-9BDB-6EE21C589C8B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {F0EA5832-C5B7-42CF-9BDB-6EE21C589C8B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {F0EA5832-C5B7-42CF-9BDB-6EE21C589C8B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {923928DC-6FB0-4C25-9B2B-721A9B60C602} | ||
| EndGlobalSection | ||
| EndGlobal | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <Project> | ||
|
|
||
| <PropertyGroup> | ||
| <LangVersion>13</LangVersion> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
| </Project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) Cucumber Ltd | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get rid of the build error, I think this should be changed to 10.0.x only (also the release workflow) and the test project should be net10