From a4c7fb03546093f78bc6f2a8841abc5a5a4c77f8 Mon Sep 17 00:00:00 2001 From: Thomas Bruderer Date: Wed, 14 Sep 2022 11:09:57 +0200 Subject: [PATCH 1/3] Update change-case to Funcky 3 --- Directory.Build.props | 7 +++++++ .../Messerli.ChangeCase.Test.csproj | 2 -- Messerli.ChangeCase/Messerli.ChangeCase.csproj | 7 +++---- .../StringCaseExtensions.Private.cs | 11 ++++------- .../StringCaseExtensions.SplitResult.cs | 4 +--- Packages.props | 14 +++++++------- global.json | 4 ++-- 7 files changed, 24 insertions(+), 25 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 23b6e65..8975b79 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,12 @@ + + 10.0 + enable + true + enable + false + Messerli Informatik AG MIT OR Apache-2.0 diff --git a/Messerli.ChangeCase.Test/Messerli.ChangeCase.Test.csproj b/Messerli.ChangeCase.Test/Messerli.ChangeCase.Test.csproj index 0a8aea8..d67a70e 100644 --- a/Messerli.ChangeCase.Test/Messerli.ChangeCase.Test.csproj +++ b/Messerli.ChangeCase.Test/Messerli.ChangeCase.Test.csproj @@ -1,8 +1,6 @@  net5.0 - enable - false diff --git a/Messerli.ChangeCase/Messerli.ChangeCase.csproj b/Messerli.ChangeCase/Messerli.ChangeCase.csproj index f9847f3..63959ca 100644 --- a/Messerli.ChangeCase/Messerli.ChangeCase.csproj +++ b/Messerli.ChangeCase/Messerli.ChangeCase.csproj @@ -1,12 +1,11 @@  - netstandard2.0;net5.0 - 9.0 - enable + netstandard2.0;net6.0 Messerli.ChangeCase + true Transform a string between different casings. Utility Casing - 1.1.0 + 1.2.0 true snupkg diff --git a/Messerli.ChangeCase/StringCaseExtensions.Private.cs b/Messerli.ChangeCase/StringCaseExtensions.Private.cs index 8d944a0..5bb358a 100644 --- a/Messerli.ChangeCase/StringCaseExtensions.Private.cs +++ b/Messerli.ChangeCase/StringCaseExtensions.Private.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Funcky; +using Funcky; using Funcky.Extensions; using Funcky.Monads; @@ -30,7 +27,7 @@ private static ExtractElement SelectSplitStrategy(string identifier) private static Option SplitOnCasing(string identifier, int startIndex) => startIndex >= identifier.Length - ? Option.None() + ? Option.None : ExtractByCasing(identifier, startIndex); private static Option ExtractByCasing(string identifier, int startIndex) @@ -78,7 +75,7 @@ private static bool NextIsAbbreviation(string identifier, int startIndex) private static Option SplitOnSeparators(string identifier, int startIndex) => startIndex > identifier.Length - ? Option.None() + ? Option.None : ExtractBySeparator(identifier, startIndex); private static SplitResult ExtractBySeparator(string identifier, int startIndex) @@ -105,7 +102,7 @@ private static string JoinStrings(this IEnumerable strings, string separ private static IEnumerable SplitBy(this string text, ExtractElement extractNext) => Sequence - .Generate(new SplitResult(0, string.Empty), previous => extractNext(text, previous.NextStartIndex)) + .Successors(extractNext(text, 0), previous => extractNext(text, previous.NextStartIndex)) .Select(r => r.Result); private static int GetIndex(ValueWithIndex value) diff --git a/Messerli.ChangeCase/StringCaseExtensions.SplitResult.cs b/Messerli.ChangeCase/StringCaseExtensions.SplitResult.cs index 8693ea6..9faacb9 100644 --- a/Messerli.ChangeCase/StringCaseExtensions.SplitResult.cs +++ b/Messerli.ChangeCase/StringCaseExtensions.SplitResult.cs @@ -1,6 +1,4 @@ -using Funcky.Monads; - -namespace Messerli.ChangeCase +namespace Messerli.ChangeCase { public static partial class StringCaseExtensions { diff --git a/Packages.props b/Packages.props index 5c94d1f..54a3bc4 100644 --- a/Packages.props +++ b/Packages.props @@ -1,16 +1,16 @@ - + - + - - - - - + + + + + diff --git a/global.json b/global.json index fb0a392..ebd4051 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "sdk": { - "version": "5.0.100", + "version": "6.0.400", "rollForward": "feature" }, "msbuild-sdks": { - "Microsoft.Build.CentralPackageVersions" : "2.0.79" + "Microsoft.Build.CentralPackageVersions" : "2.1.3" } } From 5e69c95c49a52c852883804b052b764c642e4423 Mon Sep 17 00:00:00 2001 From: Thomas Bruderer Date: Wed, 14 Sep 2022 11:18:11 +0200 Subject: [PATCH 2/3] Fix Tests and Add Deterministic Builds --- .github/workflows/build.yml | 16 ++++++++++++++++ Directory.Build.props | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e63074b..e9710e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,3 +22,19 @@ jobs: run: dotnet build --configuration Release --no-restore /p:FodyGenerateXsd=false /p:TreatWarningsAsErrors=true - name: Run Tests run: dotnet test --configuration Release --no-build + + nupkg: + name: Generate NuGet Packages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-dotnet@v1 + name: Install Current .NET SDK + - name: Generate NuGet Packages + run: dotnet pack --configuration Release --output nupkg + - uses: actions/upload-artifact@v2 + if: success() && github.ref == 'refs/heads/main' + with: + name: nupkg + path: nupkg/* + retention-days: 1 \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 8975b79..902e3d4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -16,4 +16,12 @@ + + true + true + true + + + + From 590822b71f7c54d9e02ffab2cec8f5c9f92307a4 Mon Sep 17 00:00:00 2001 From: Thomas Bruderer Date: Wed, 14 Sep 2022 11:32:53 +0200 Subject: [PATCH 3/3] Fix last issues --- Messerli.ChangeCase.Test/Messerli.ChangeCase.Test.csproj | 2 +- Messerli.ChangeCase.sln | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Messerli.ChangeCase.Test/Messerli.ChangeCase.Test.csproj b/Messerli.ChangeCase.Test/Messerli.ChangeCase.Test.csproj index d67a70e..13aeefa 100644 --- a/Messerli.ChangeCase.Test/Messerli.ChangeCase.Test.csproj +++ b/Messerli.ChangeCase.Test/Messerli.ChangeCase.Test.csproj @@ -1,6 +1,6 @@  - net5.0 + net6.0 diff --git a/Messerli.ChangeCase.sln b/Messerli.ChangeCase.sln index 2325034..f4cb8d6 100644 --- a/Messerli.ChangeCase.sln +++ b/Messerli.ChangeCase.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30907.101 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{50491EE5-F685-4F7B-ABC3-FAF5D7E46F99}" ProjectSection(SolutionItems) = preProject