Skip to content

Commit 3938cb7

Browse files
authored
Add Dotnet Implementation (#219)
1 parent 9de9e29 commit 3938cb7

27 files changed

+1208
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release NuGet
2+
3+
on:
4+
push:
5+
branches: [ release/* ]
6+
7+
jobs:
8+
publish-nuget:
9+
name: Publish package to NuGet.org
10+
# Failing on `ubuntu-24.04` (https://github.com/cucumber/gherkin/issues/349)
11+
runs-on: ubuntu-22.04
12+
environment: Release
13+
steps:
14+
- uses: actions/checkout@v5
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v5
17+
with:
18+
dotnet-version: 9.0.x
19+
- uses: cucumber/action-publish-nuget@v1.0.0
20+
with:
21+
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
22+
working-directory: "dotnet"

.github/workflows/test-dotnet.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: test-dotnet
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- renovate/**
8+
paths:
9+
- dotnet/**
10+
- testdata/**
11+
- .github/**
12+
pull_request:
13+
branches:
14+
- main
15+
paths:
16+
- dotnet/**
17+
- testdata/**
18+
- .github/**
19+
workflow_call:
20+
21+
jobs:
22+
test-dotnet:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v5
26+
- uses: actions/setup-dotnet@v5
27+
with:
28+
dotnet-version: |
29+
8.0.x
30+
9.0.x
31+
- run: dotnet test
32+
working-directory: dotnet

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
- Render the empty tag expression as an empty string ([#222](https://github.com/cucumber/tag-expressions/pull/222))
1111
- Improve error message for missing operands ([#221](https://github.com/cucumber/tag-expressions/pull/221))
1212

13+
- [.NET] Add a .NET implementation
14+
1315
## [8.0.0] - 2025-10-14
1416
### Fixed
1517
- [Perl] Fix building release artifacts ([#214](https://github.com/cucumber/tag-expressions/pull/214))

dotnet/.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root=true
2+
3+
[*]
4+
indent_style=space
5+
end_of_line=crlf
6+
charset=utf-8
7+
8+
[*.{csproj,props}]
9+
indent_size=2
10+
11+
[*.cs]
12+
indent_size=4
13+
insert_final_newline = true

dotnet/.gitignore

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.sln.docstates
8+
*.ide
9+
10+
# Build results
11+
12+
[Dd]ebug/
13+
[Rr]elease/
14+
x64/
15+
build/
16+
[Oo]bj/
17+
*/**/bin
18+
19+
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
20+
!packages/*/build/
21+
22+
# MSTest test Results
23+
[Tt]est[Rr]esult*/
24+
[Bb]uild[Ll]og.*
25+
26+
*_i.c
27+
*_p.c
28+
*.ilk
29+
*.meta
30+
*.obj
31+
*.pch
32+
*.pdb
33+
*.pgc
34+
*.pgd
35+
*.rsp
36+
*.sbr
37+
*.tlb
38+
*.tli
39+
*.tlh
40+
*.tmp
41+
*.tmp_proj
42+
*.log
43+
*.vspscc
44+
*.vssscc
45+
.builds
46+
*.pidb
47+
*.log
48+
*.scc
49+
50+
# Visual C++ cache files
51+
ipch/
52+
*.aps
53+
*.ncb
54+
*.opensdf
55+
*.sdf
56+
*.cachefile
57+
58+
# Visual Studio profiler
59+
*.psess
60+
*.vsp
61+
*.vspx
62+
63+
# Guidance Automation Toolkit
64+
*.gpState
65+
66+
# ReSharper is a .NET coding add-in
67+
_ReSharper*/
68+
*.[Rr]e[Ss]harper
69+
70+
# TeamCity is a build add-in
71+
_TeamCity*
72+
73+
# DotCover is a Code Coverage Tool
74+
*.dotCover
75+
76+
# NCrunch
77+
*.ncrunch*
78+
.*crunch*.local.xml
79+
80+
# Installshield output folder
81+
[Ee]xpress/
82+
83+
# DocProject is a documentation generator add-in
84+
DocProject/buildhelp/
85+
DocProject/Help/*.HxT
86+
DocProject/Help/*.HxC
87+
DocProject/Help/*.hhc
88+
DocProject/Help/*.hhk
89+
DocProject/Help/*.hhp
90+
DocProject/Help/Html2
91+
DocProject/Help/html
92+
93+
# Click-Once directory
94+
publish/
95+
96+
# Publish Web Output
97+
*.Publish.xml
98+
99+
# NuGet Packages Directory
100+
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
101+
#packages/
102+
103+
# Windows Azure Build Output
104+
csx
105+
*.build.csdef
106+
107+
# Windows Store app package directory
108+
AppPackages/
109+
110+
# Others
111+
sql/
112+
*.Cache
113+
ClientBin/
114+
[Ss]tyle[Cc]op.*
115+
~$*
116+
*~
117+
*.dbmdl
118+
*.[Pp]ublish.xml
119+
*.pfx
120+
*.publishsettings
121+
122+
# RIA/Silverlight projects
123+
Generated_Code/
124+
125+
# Backup & report files from converting an old project file to a newer
126+
# Visual Studio version. Backup files are not needed, because we have git ;-)
127+
_UpgradeReport_Files/
128+
Backup*/
129+
UpgradeLog*.XML
130+
UpgradeLog*.htm
131+
132+
# SQL Server files
133+
App_Data/*.mdf
134+
App_Data/*.ldf
135+
136+
137+
#LightSwitch generated files
138+
GeneratedArtifacts/
139+
_Pvt_Extensions/
140+
ModelManifest.xml
141+
142+
# =========================
143+
# Windows detritus
144+
# =========================
145+
146+
# Windows image file caches
147+
Thumbs.db
148+
ehthumbs.db
149+
150+
# Folder config file
151+
Desktop.ini
152+
153+
# Recycle Bin used on file shares
154+
$RECYCLE.BIN/
155+
156+
# Mac desktop service store files
157+
.DS_Store
158+
159+
packages/
160+
acceptance/
161+
output/
162+
.built
163+
.compared
164+
.sln_built_debug
165+
*.userprefs
166+
*.nupkg
167+
Gherkin.NuGetPackages/bin/
168+
.build*
169+
.built*
170+
.vscode
171+
.run_tests
172+
.generated
173+
.packed
174+
.tested
175+
.fixprotoc
176+
.vs/
177+
178+
# ========================

dotnet/Cucumber.TagExpressions.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36616.10
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cucumber.TagExpressions", "TagExpressions\Cucumber.TagExpressions.csproj", "{0BDD57B5-52F9-4866-8031-C84E41138453}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cucumber.TagExpressionsTest", "TagExpressionsTest\Cucumber.TagExpressionsTest.csproj", "{EBEAC0FF-9EA0-4065-B39E-B9C4C29EE48A}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{0BDD57B5-52F9-4866-8031-C84E41138453}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{0BDD57B5-52F9-4866-8031-C84E41138453}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{0BDD57B5-52F9-4866-8031-C84E41138453}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{0BDD57B5-52F9-4866-8031-C84E41138453}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{EBEAC0FF-9EA0-4065-B39E-B9C4C29EE48A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{EBEAC0FF-9EA0-4065-B39E-B9C4C29EE48A}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{EBEAC0FF-9EA0-4065-B39E-B9C4C29EE48A}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{EBEAC0FF-9EA0-4065-B39E-B9C4C29EE48A}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {0789D1F0-C759-4F1D-BED0-F55A1E05100B}
30+
EndGlobalSection
31+
EndGlobal

dotnet/Cucumber.TagExpressions.snk

596 Bytes
Binary file not shown.

dotnet/Directory.Build.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<LangVersion>13</LangVersion>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
8+
</PropertyGroup>
9+
10+
</Project>

dotnet/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Cucumber Ltd
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

dotnet/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[![NuGet Version](https://img.shields.io/nuget/v/Cucumber.TagExpressions)](https://www.nuget.org/packages/Cucumber.TagExpressions)
2+
3+
# Cucumber Tag Expressions for .NET
4+
5+
[The docs are here](https://cucumber.io/docs/cucumber/api/#tag-expressions).

0 commit comments

Comments
 (0)