From 175f50b248bac4853adb40c8dec0a8321a8dca6c Mon Sep 17 00:00:00 2001 From: Steven Giesel Date: Fri, 30 Aug 2024 23:59:54 +0200 Subject: [PATCH 1/4] Prepare for v2 --- .github/workflows/codeql.yml | 2 -- .github/workflows/create-release.yml | 2 -- .github/workflows/docs.yml | 2 -- .github/workflows/dotnet.yml | 2 -- CHANGELOG.md | 5 ++++ .../LinkDotNet.StringBuilder.csproj | 2 +- .../StringSyntaxAttribute.cs | 26 ------------------- .../LinkDotNet.StringBuilder.UnitTests.csproj | 2 +- 8 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 src/LinkDotNet.StringBuilder/StringSyntaxAttribute.cs diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0668653..cee3e06 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -27,8 +27,6 @@ jobs: - uses: actions/setup-dotnet@v4.2.0 with: dotnet-version: | - 6.0.x - 7.0.x 8.0.x 9.0.x diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index a75f605..3ac137e 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -37,8 +37,6 @@ jobs: uses: actions/setup-dotnet@v4.2.0 with: dotnet-version: | - 6.0.x - 7.0.x 8.0.x 9.0.x diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e0e6679..4220b4d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -18,8 +18,6 @@ jobs: uses: actions/setup-dotnet@v4.2.0 with: dotnet-version: | - 6.0.x - 7.0.x 8.0.x 9.0.x diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 04a5a95..281e9fc 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -17,8 +17,6 @@ jobs: uses: actions/setup-dotnet@v4.2.0 with: dotnet-version: | - 6.0.x - 7.0.x 8.0.x 9.0.x diff --git a/CHANGELOG.md b/CHANGELOG.md index b49ee0a..2a1ef2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ All notable changes to **ValueStringBuilder** will be documented in this file. T ## [Unreleased] +This is the `v2` release of the **ValueStringBuilder**. There aren't any noticeable changes. Only old framework versions were removed to make further development easier. + +### Removed +- Support for `net6.0` and `net7.0` was removed. + ## [1.22.0] - 2024-12-18 ### Added diff --git a/src/LinkDotNet.StringBuilder/LinkDotNet.StringBuilder.csproj b/src/LinkDotNet.StringBuilder/LinkDotNet.StringBuilder.csproj index 702d5eb..75563dd 100644 --- a/src/LinkDotNet.StringBuilder/LinkDotNet.StringBuilder.csproj +++ b/src/LinkDotNet.StringBuilder/LinkDotNet.StringBuilder.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0;net8.0;net9.0 + net8.0;net9.0 enable enable true diff --git a/src/LinkDotNet.StringBuilder/StringSyntaxAttribute.cs b/src/LinkDotNet.StringBuilder/StringSyntaxAttribute.cs deleted file mode 100644 index 7dcdbd7..0000000 --- a/src/LinkDotNet.StringBuilder/StringSyntaxAttribute.cs +++ /dev/null @@ -1,26 +0,0 @@ -#if NET6_0 -namespace System.Diagnostics.CodeAnalysis; - -/// Fake version of the StringSyntaxAttribute, which was introduced in .NET 7. -[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)] -[SuppressMessage("Design", "CA1019:Define accessors for attribute arguments", Justification = "The sole purpose is to have the same public surface as the class in .NET7 and above.")] -internal sealed class StringSyntaxAttribute : Attribute -{ - /// The syntax identifier for strings containing composite formats. - public const string CompositeFormat = nameof(CompositeFormat); - - /// - /// Initializes a new instance of the class. - /// - public StringSyntaxAttribute(string syntax) - { - } - - /// - /// Initializes a new instance of the class. - /// - public StringSyntaxAttribute(string syntax, params object?[] arguments) - { - } -} -#endif \ No newline at end of file diff --git a/tests/LinkDotNet.StringBuilder.UnitTests/LinkDotNet.StringBuilder.UnitTests.csproj b/tests/LinkDotNet.StringBuilder.UnitTests/LinkDotNet.StringBuilder.UnitTests.csproj index 21957f3..c047b36 100644 --- a/tests/LinkDotNet.StringBuilder.UnitTests/LinkDotNet.StringBuilder.UnitTests.csproj +++ b/tests/LinkDotNet.StringBuilder.UnitTests/LinkDotNet.StringBuilder.UnitTests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0;net8.0;net9.0 + net8.0;net9.0 enable false true From 76c7bba7ebaa374aa0bf67b1a0981edec7eb355a Mon Sep 17 00:00:00 2001 From: Steven Giesel Date: Thu, 2 Jan 2025 17:42:24 +0100 Subject: [PATCH 2/4] chore: Use xunit.v3 --- .../LinkDotNet.StringBuilder.Benchmarks.csproj | 2 +- .../LinkDotNet.StringBuilder.UnitTests.csproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/LinkDotNet.StringBuilder.Benchmarks/LinkDotNet.StringBuilder.Benchmarks.csproj b/tests/LinkDotNet.StringBuilder.Benchmarks/LinkDotNet.StringBuilder.Benchmarks.csproj index 816326f..c714f0a 100644 --- a/tests/LinkDotNet.StringBuilder.Benchmarks/LinkDotNet.StringBuilder.Benchmarks.csproj +++ b/tests/LinkDotNet.StringBuilder.Benchmarks/LinkDotNet.StringBuilder.Benchmarks.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable enable false diff --git a/tests/LinkDotNet.StringBuilder.UnitTests/LinkDotNet.StringBuilder.UnitTests.csproj b/tests/LinkDotNet.StringBuilder.UnitTests/LinkDotNet.StringBuilder.UnitTests.csproj index c047b36..ca3ea97 100644 --- a/tests/LinkDotNet.StringBuilder.UnitTests/LinkDotNet.StringBuilder.UnitTests.csproj +++ b/tests/LinkDotNet.StringBuilder.UnitTests/LinkDotNet.StringBuilder.UnitTests.csproj @@ -10,8 +10,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all From 438d4142c068c1dd275a8d594e18a34aed16b808 Mon Sep 17 00:00:00 2001 From: Steven Giesel Date: Thu, 2 Jan 2025 17:47:31 +0100 Subject: [PATCH 3/4] fix: Use Overload resolution for Span ctor (fixes #210) --- src/LinkDotNet.StringBuilder/ValueStringBuilder.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/LinkDotNet.StringBuilder/ValueStringBuilder.cs b/src/LinkDotNet.StringBuilder/ValueStringBuilder.cs index f1d8408..0a413ce 100644 --- a/src/LinkDotNet.StringBuilder/ValueStringBuilder.cs +++ b/src/LinkDotNet.StringBuilder/ValueStringBuilder.cs @@ -36,6 +36,9 @@ public ValueStringBuilder() /// /// Initial buffer for the string builder to begin with. [MethodImpl(MethodImplOptions.AggressiveInlining)] +#if NET9_0_OR_GREATER + [OverloadResolutionPriority(1)] +#endif public ValueStringBuilder(Span initialBuffer) { bufferPosition = 0; From 8bf8d1b3b14123dc49e81458e12d31e948d5e5e7 Mon Sep 17 00:00:00 2001 From: Steven Giesel Date: Thu, 2 Jan 2025 17:49:59 +0100 Subject: [PATCH 4/4] docs: added changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a1ef2b..61f24ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ This is the `v2` release of the **ValueStringBuilder**. There aren't any noticea ### Removed - Support for `net6.0` and `net7.0` was removed. +### Changed +- Added `OverloadResolutionPriority` for `Span` overload for the ctor to keep the current behavior. Reported by [@nsentinel])(https://github.com/nsentinel) in [#210](https://github.com/linkdotnet/StringBuilder/issues/210). + ## [1.22.0] - 2024-12-18 ### Added