diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..6ac46bb
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,109 @@
+# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
+
+name: 'CI'
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - 'main'
+ pull_request:
+ branches:
+ - '*'
+ release:
+ types:
+ - published
+
+env:
+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
+ DOTNET_NOLOGO: true
+ NuGetDirectory: ${{ github.workspace}}/nuget
+
+defaults:
+ run:
+ shell: pwsh
+
+jobs:
+ create_nuget:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0 # Get all history to allow automatic versioning using MinVer
+
+ - name: Setup .NET # Install the .NET SDK indicated in the global.json file
+ uses: actions/setup-dotnet@v3
+
+
+ - name: Release Pack (update release notes)
+ if: github.event_name == 'release'
+ env:
+ RELEASE_NAME: ${{ github.event.release.name }}
+ RELEASE_BODY: ${{ github.event.release.body }}
+ run: |
+ $name = $env:RELEASE_NAME
+ $body = $env:RELEASE_BODY
+ $releaseNotes = "# Release ${{ github.event.release.tag_name }}"
+
+ if($name){
+ $releaseNotes = $releaseNotes + " - " + $name
+ }
+ if($body){
+ $releaseNotes = $releaseNotes + "`r`n`r`n" + $body
+ }
+
+ Write-Host "`tSetting release notes to '$releaseNotes'"
+
+ dotnet pack --configuration Release --output ${{ env.NuGetDirectory }} -p:PackageReleaseNotes=$releaseNotes
+
+
+ - name: Non-release Pack
+ if: github.event_name != 'release'
+ run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }}
+
+ - uses: actions/upload-artifact@v3
+ with:
+ name: nuget
+ if-no-files-found: error
+ retention-days: 7
+ path: ${{ env.NuGetDirectory }}/*.nupkg
+
+ run_test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v3
+ - name: Run tests
+ run: dotnet test --configuration Release --logger "trx;LogFilePrefix=T"
+ - name: Upload test results
+ uses: actions/upload-artifact@v3
+ if: success() || failure() # run this step even if previous step failed
+ with:
+ name: TestResult
+ if-no-files-found: error
+ retention-days: 7
+ path: "**/*.trx"
+
+ deploy:
+ if: github.event_name == 'release' || (github.event_name == 'push' && github.ref_name == 'main')
+ runs-on: ubuntu-latest
+ needs: [ create_nuget, run_test ]
+ steps:
+ - uses: actions/download-artifact@v3
+ with:
+ name: nuget
+ path: ${{ env.NuGetDirectory }}
+
+ - name: Setup .NET Core
+ uses: actions/setup-dotnet@v3
+
+ - name: Publish NuGet package
+ env:
+ EVENT_NAME: ${{ github.event_name }}
+ run: |
+ $key = ($env:EVENT_NAME -eq 'release') ? "${{ secrets.NUGET_API_KEY }}" : "${{ secrets.GH_PACKAGE_REGISTRY_API_KEY }}"
+ $source = ($env:EVENT_NAME -eq 'release') ? "https://api.nuget.org/v3/index.json" : "https://nuget.pkg.github.com/MichalBrylka/index.json"
+
+ foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
+ dotnet nuget push $file --api-key "$key" --source "$source" --skip-duplicate
+ }
\ No newline at end of file
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 15d7a52..85c28ec 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -1,24 +1,13 @@
-# For most projects, this workflow file will not need changing; you simply need
-# to commit it to your repository.
-#
-# You may wish to alter this file to override the set of languages analyzed,
-# or to provide custom queries or build logic.
-#
-# ******** NOTE ********
-# We have attempted to detect the languages in your repository. Please check
-# the `language` matrix defined below to confirm you have the correct set of
-# supported CodeQL languages.
-#
name: "CodeQL"
on:
- push:
- branches: [ master ]
- pull_request:
- # The branches below must be a subset of the branches above
- branches: [ master ]
+ workflow_dispatch:
+ pull_request:
+ branches: [ main ]
schedule:
- - cron: '40 18 * * 0'
+ - cron: '40 16 * * 0'
+
+run-name: "QL"
jobs:
analyze:
@@ -28,40 +17,23 @@ jobs:
strategy:
fail-fast: false
matrix:
- language: [ 'csharp' ]
- # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
- # Learn more:
+ language: [ 'csharp' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@v1
+ uses: github/codeql-action/init@v2
with:
- languages: ${{ matrix.language }}
- # If you wish to specify custom queries, you can do so here or in a config file.
- # By default, queries listed here will override any specified in a config file.
- # Prefix the list here with "+" to use these queries and those in the config file.
- # queries: ./path/to/local/query, your-org/your-repo/queries@main
-
- # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
- # If this step fails, then you should remove it and run the build manually (see below)
- - name: Autobuild
- uses: github/codeql-action/autobuild@v1
-
- # ℹ️ Command-line programs to run using the OS shell.
- # 📚 https://git.io/JvXDl
+ languages: ${{ matrix.language }}
- # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
- # and modify them (or add more) to build your code if your project
- # uses a compiled language
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v3
- #- run: |
- # make bootstrap
- # make release
+ - run: dotnet build --configuration Release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v1
+ uses: github/codeql-action/analyze@v2
diff --git a/.github/workflows/license-scanning.yml b/.github/workflows/license-scanning.yml
new file mode 100644
index 0000000..553ff81
--- /dev/null
+++ b/.github/workflows/license-scanning.yml
@@ -0,0 +1,27 @@
+name: License Scanning
+
+on:
+ workflow_dispatch:
+ pull_request:
+ branches:
+ - '*'
+
+defaults:
+ run:
+ shell: pwsh
+
+
+jobs:
+ scan:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout tree
+ uses: actions/checkout@v4
+
+
+
+ - name: Run FOSSA scan and upload build data
+ uses: fossa-contrib/fossa-action@v3
+ with:
+ fossa-api-key: ${{ secrets.FOSSA_API_KEY }}
\ No newline at end of file
diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml
new file mode 100644
index 0000000..a45b26d
--- /dev/null
+++ b/.github/workflows/test-report.yml
@@ -0,0 +1,21 @@
+name: 'Test Report'
+on:
+ workflow_run:
+ workflows: ['CI']
+ types:
+ - completed
+
+run-name: "Test for '${{ github.event.workflow_run.head_commit.message }}'"
+
+jobs:
+ report:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: dorny/test-reporter@v1
+ with:
+ artifact: 'TestResult'
+ name: "Tests results"
+ reporter: dotnet-trx
+ path: "**/*.trx"
+ fail-on-error: 'true'
+ fail-on-empty: 'true'
\ No newline at end of file
diff --git a/Benchmarks/AggressionBasedBench.cs b/Benchmarks/AggressionBasedBench.cs
index ec7d67d..984f762 100644
--- a/Benchmarks/AggressionBasedBench.cs
+++ b/Benchmarks/AggressionBasedBench.cs
@@ -1,5 +1,4 @@
-using System.Diagnostics.CodeAnalysis;
-using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Attributes;
// ReSharper disable CommentTypo
diff --git a/Benchmarks/ArrayParserBench.cs b/Benchmarks/ArrayParserBench.cs
index 372bd1d..040d0fd 100644
--- a/Benchmarks/ArrayParserBench.cs
+++ b/Benchmarks/ArrayParserBench.cs
@@ -1,7 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Attributes;
using Nemesis.TextParsers;
// ReSharper disable CommentTypo
diff --git a/Benchmarks/BenchmarkInput.cs b/Benchmarks/BenchmarkInput.cs
index 684a7c3..45956c0 100644
--- a/Benchmarks/BenchmarkInput.cs
+++ b/Benchmarks/BenchmarkInput.cs
@@ -1,7 +1,5 @@
-using System;
-using System.Collections;
+using System.Collections;
using System.Globalization;
-using System.Linq;
namespace Benchmarks
{
diff --git a/Benchmarks/CollectionParserBench.cs b/Benchmarks/CollectionParserBench.cs
index 5ed2532..6d8d854 100644
--- a/Benchmarks/CollectionParserBench.cs
+++ b/Benchmarks/CollectionParserBench.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Buffers;
+using System.Buffers;
using System.ComponentModel;
using BenchmarkDotNet.Attributes;
using Nemesis.TextParsers;
diff --git a/Benchmarks/CollectionSerializerSlow.cs b/Benchmarks/CollectionSerializerSlow.cs
index 96dd32d..e5a6703 100644
--- a/Benchmarks/CollectionSerializerSlow.cs
+++ b/Benchmarks/CollectionSerializerSlow.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-using System.Reflection;
-using System.Text.RegularExpressions;
+using System.ComponentModel;
namespace Benchmarks
{
diff --git a/Benchmarks/DeconstructablesBench.cs b/Benchmarks/DeconstructablesBench.cs
index 8bff22a..13fb0d0 100644
--- a/Benchmarks/DeconstructablesBench.cs
+++ b/Benchmarks/DeconstructablesBench.cs
@@ -1,7 +1,5 @@
-using System;
-using System.ComponentModel;
+using System.ComponentModel;
using System.Globalization;
-using System.Linq;
using BenchmarkDotNet.Attributes;
using Nemesis.TextParsers;
using Nemesis.TextParsers.Utils;
diff --git a/Benchmarks/DynamicMethodGenerator.cs b/Benchmarks/DynamicMethodGenerator.cs
index 871c2d1..4c370cc 100644
--- a/Benchmarks/DynamicMethodGenerator.cs
+++ b/Benchmarks/DynamicMethodGenerator.cs
@@ -1,6 +1,4 @@
-using System;
-using System.Linq;
-using System.Reflection.Emit;
+using System.Reflection.Emit;
namespace Benchmarks
{
diff --git a/Benchmarks/EnumBench.cs b/Benchmarks/EnumBench.cs
index 21ed9eb..23f15bb 100644
--- a/Benchmarks/EnumBench.cs
+++ b/Benchmarks/EnumBench.cs
@@ -1,9 +1,4 @@
-using System;
-using System.IO;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Reflection.Emit;
-using System.Runtime.CompilerServices;
+using System.Reflection.Emit;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
diff --git a/Benchmarks/LinqBench/Linq_Count_Vs_Any.cs b/Benchmarks/LinqBench/Linq_Count_Vs_Any.cs
index 4e73330..7a4754f 100644
--- a/Benchmarks/LinqBench/Linq_Count_Vs_Any.cs
+++ b/Benchmarks/LinqBench/Linq_Count_Vs_Any.cs
@@ -1,6 +1,4 @@
using System.Buffers;
-using System.Collections.Generic;
-using System.Linq;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
diff --git a/Benchmarks/LinqBench/Linq_WhereAndFirst_Vs_First.cs b/Benchmarks/LinqBench/Linq_WhereAndFirst_Vs_First.cs
index 4b7b0aa..ff2aa0b 100644
--- a/Benchmarks/LinqBench/Linq_WhereAndFirst_Vs_First.cs
+++ b/Benchmarks/LinqBench/Linq_WhereAndFirst_Vs_First.cs
@@ -1,6 +1,4 @@
using System.Buffers;
-using System.Collections.Generic;
-using System.Linq;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
diff --git a/Benchmarks/MultiKeyDictionaryBench.cs b/Benchmarks/MultiKeyDictionaryBench.cs
index 50b2a88..1d0ffc7 100644
--- a/Benchmarks/MultiKeyDictionaryBench.cs
+++ b/Benchmarks/MultiKeyDictionaryBench.cs
@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
// ReSharper disable UseDeconstruction
// ReSharper disable SuggestVarOrType_SimpleTypes
diff --git a/Benchmarks/ParserBench.cs b/Benchmarks/ParserBench.cs
index 2e483e9..8d85317 100644
--- a/Benchmarks/ParserBench.cs
+++ b/Benchmarks/ParserBench.cs
@@ -1,7 +1,4 @@
-using System;
-using System.IO;
-using System.Linq;
-using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Attributes;
using Nemesis.TextParsers;
using Newtonsoft.Json;
diff --git a/Benchmarks/StructureOfArraysBench.cs b/Benchmarks/StructureOfArraysBench.cs
index bf500fd..334eeb7 100644
--- a/Benchmarks/StructureOfArraysBench.cs
+++ b/Benchmarks/StructureOfArraysBench.cs
@@ -1,6 +1,4 @@
-using System.Linq;
-
-using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Diagnosers;
// ReSharper disable MemberCanBePrivate.Local
diff --git a/Directory.Build.props b/Directory.Build.props
index 6eda337..967cd26 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,19 +1,13 @@
- 1.0.0
-
+ 0.0.1
+
12.0
enable
-
-
- Michał Bryłka, Leszek Kowalski
- MIT OR Apache-2.0
- Copyright (c) Michał Bryłka. Icon by http://www.iconka.com
+
false
- true
- https://github.com/nemesissoft/Nemesis.TextParsers
true
@@ -25,6 +19,20 @@
..\Nemesis.TextParsers.Public.snk
+
+
+ properties\icon.png
+
+
+
+ properties\README.md
+
+
+
+
+
+
+
diff --git a/Directory.Build.targets b/Directory.Build.targets
index 582e676..251abed 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -13,6 +13,25 @@
$(PackageDescription)
This package was built from the source at $(RepositoryUrl.TrimEnd('.git'))/tree/$(SourceRevisionId)
+
+ Michał Bryłka, Leszek Kowalski
+ MIT OR Apache-2.0
+ Copyright © Michał Bryłka. Icon by http://www.iconka.com
+ true
+ https://github.com/nemesissoft/Nemesis.TextParsers
+
+ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
+ true
+ true
+ embedded
+ true
+
+ properties\icon.png
+ properties\README.md
+
+ true
+
+
\ No newline at end of file
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 923f615..46c35e3 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -16,6 +16,12 @@
+
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
+
diff --git a/GetNetCoreVersions.ps1 b/GetNetCoreVersions.ps1
deleted file mode 100644
index 815261d..0000000
--- a/GetNetCoreVersions.ps1
+++ /dev/null
@@ -1,12 +0,0 @@
-Write-Host Path:
-(Get-Command dotnet).Path
-
-Write-Host
-
-Write-Host Runtimes:
-(dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'shared\Microsoft.NETCore.App')).Name
-
-Write-Host
-
-Write-Host SDK:
-(dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'sdk')).Name
\ No newline at end of file
diff --git a/LICENSE.txt b/LICENSE.txt
index 0b4795a..6511579 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2019 Nemesis
+Copyright (c) 2018-2023 Nemesis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/Nemesis.TextParsers.Tests/Infrastructure/SettingsPersistenceTests.cs b/Nemesis.TextParsers.ArchTests/Domain/SettingsPersistenceTests.cs
similarity index 94%
rename from Nemesis.TextParsers.Tests/Infrastructure/SettingsPersistenceTests.cs
rename to Nemesis.TextParsers.ArchTests/Domain/SettingsPersistenceTests.cs
index c301132..57de314 100644
--- a/Nemesis.TextParsers.Tests/Infrastructure/SettingsPersistenceTests.cs
+++ b/Nemesis.TextParsers.ArchTests/Domain/SettingsPersistenceTests.cs
@@ -5,7 +5,7 @@
using Microsoft.Extensions.Configuration;
using Nemesis.TextParsers.Settings;
-namespace Nemesis.TextParsers.Tests.Infrastructure;
+namespace Nemesis.TextParsers.ArchTests.Domain;
[TestFixture]
public class SettingsPersistenceTests
@@ -109,13 +109,14 @@ public void SettingsCanBeReadFromAndWrittenToJsonFile_UsingCodeGen(ISettings set
private static void SettingsPersistanceHelper(ISettings settings,
Func