Skip to content

Commit 44165bb

Browse files
Target Framework Updates (#389)
* Reference to Cysharp ZString v2.6.0 package (#382) * Reference Cysharp `ZString` v2.6.0 in `SmartFormat` project (net461 target use the netstandard2.0 assemblies) * Remove project `SmartFormat.Zstring` * Move internal static class ZStringBuilderExtensions to namespace SmartFormat.ZString * Rename ZStringBuilderExtensions to ZStringBuilderUtilities * Exclude ZString wrappers from code coverage (#384) * Flag `ZStringBuilder` and `ZStringWriter`with `[ExcludeFromCodeCoverage]` * Add AltCoverAttributeFilter="ExcludeFromCodeCoverage" in CI tests * #380 Add net60 as additional target framework (#381) * #380 Add net 6 to STJ project and make other dependencies conditional * Optimize package properties. * Fix nullability and warning issues for Demo and Performance projects * chore: net60/ZString related housekeeping (#385) * Directory.Build.props: Remove duplicate entries from Demo and Performance projects * Enable NRT for Demo and Performance projects * Remove folder SmartFormat.ZString from former projects SmartFormat.ZString * Remove obsolete entries from SmartFormat.sln * Remove reference to former SmartFormat.ZString.dll from SmartFormat.csproj * Enable net60 for project SmartFormat (#387) * feat: Add net8.0 as a target framework (#388) * Mark CTOR overload (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) as obsolete (like it is in net8.0). * Update proprocessor directives and nuget packages * Change appveyor_build_worker_image to Ubuntu2204 * Add net8.0 as target framework * Update target framework net461 to net462 * Bump version to v3.4.0 --------- Co-authored-by: James Thompson <[email protected]>
1 parent c48f7c6 commit 44165bb

File tree

337 files changed

+3343
-69747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+3343
-69747
lines changed

.github/workflows/SonarCloud.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ jobs:
1313
# (PRs from forks can't access secrets other than secrets.GITHUB_TOKEN for security reasons)
1414
if: ${{ !github.event.pull_request.head.repo.fork }}
1515
env:
16-
version: '3.3.2'
17-
versionFile: '3.3.2'
16+
version: '3.4.0'
17+
versionFile: '3.4.0'
1818
steps:
1919
- name: Set up JDK 17
20-
uses: actions/setup-java@v3
20+
uses: actions/setup-java@v4
2121
with:
2222
distribution: 'microsoft'
2323
java-version: '17'
24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2525
with:
2626
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
2727
- name: Cache SonarCloud packages
28-
uses: actions/cache@v3
28+
uses: actions/cache@v4
2929
with:
3030
path: ~\sonar\cache
3131
key: ${{ runner.os }}-sonar
3232
restore-keys: ${{ runner.os }}-sonar
3333
- name: Cache SonarCloud scanner
3434
id: cache-sonar-scanner
35-
uses: actions/cache@v3
35+
uses: actions/cache@v4
3636
with:
3737
path: .\.sonar\scanner
3838
key: ${{ runner.os }}-sonar-scanner
@@ -61,7 +61,7 @@ jobs:
6161
echo "Packing Version: ${{ env.version }}, File Version: ${{ env.versionFile }}"
6262
dotnet pack ./src/SmartFormat.Deploy.sln /verbosity:minimal --configuration release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:ContinuousIntegrationBuild=true /p:PackageOutputPath=${{ github.workspace }}/artifacts /p:Version=${{ env.version }} /p:FileVersion=${{ env.versionFile }}
6363
- name: Upload Artifacts
64-
uses: actions/upload-artifact@v3
64+
uses: actions/upload-artifact@v4
6565
with:
6666
name: Packages_${{ env.version }}
6767
path: ${{ github.workspace }}/artifacts/

PkgReadMe.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ Custom source or formatter extensions can be added easily using simple interface
2222
* Custom formatting and source extensions are easy to integrate
2323
* Comprehensive documentation: current Wiki, complete xmldoc
2424

25-
### Supported Frameworks
26-
* .Net Framework 4.6.1 and later
27-
* .Net Standard 2.0
28-
* .Net Standard 2.1 and later for best optimizations
25+
### Note
26+
Use .Net Standard 2.1 and later for best optimizations
2927

3028
[![Paypal-Donations](https://img.shields.io/badge/Donate-PayPal-important.svg?style=flat-square)](https://www.paypal.com/donate?hosted_button_id=KSC3LRAR26AHN)

appveyor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ environment:
55
- job_name: windows
66
appveyor_build_worker_image: Visual Studio 2022
77
- job_name: linux
8-
appveyor_build_worker_image: Ubuntu
8+
appveyor_build_worker_image: Ubuntu2204
99
matrix:
1010
fast_finish: true
1111

@@ -23,7 +23,7 @@ for:
2323
- ps: dotnet restore SmartFormat.sln --verbosity quiet
2424
- ps: dotnet add .\SmartFormat.Tests\SmartFormat.Tests.csproj package AltCover
2525
- ps: |
26-
$version = "3.3.2"
26+
$version = "3.4.0"
2727
$versionFile = $version + "." + ${env:APPVEYOR_BUILD_NUMBER}
2828
2929
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
@@ -38,7 +38,7 @@ for:
3838
}
3939
test_script:
4040
- cmd: nuget install Appveyor.TestLogger
41-
- cmd: dotnet test --framework net6.0 --test-adapter-path:. --logger:Appveyor SmartFormat.sln /p:configuration=release /p:AltCover=true /p:AltCoverXmlReport="coverage.xml" /p:AltCover=true /p:AltCoverStrongNameKey="..\SmartFormat\SmartFormat.snk" /p:AltCoverAssemblyExcludeFilter="SmartFormat.Tests|SmartFormat.ZString|NUnit3.TestAdapter" /p:AltCoverLineCover="true"
41+
- cmd: dotnet test --framework net6.0 SmartFormat.sln /p:configuration=release /p:AltCover=true /p:AltCoverXmlReport="coverage.xml" /p:AltCoverStrongNameKey="..\SmartFormat\SmartFormat.snk" /p:AltCoverAssemblyExcludeFilter="SmartFormat.Tests|NUnit3.TestAdapter" /p:AltCoverAttributeFilter="ExcludeFromCodeCoverage" /p:AltCoverLineCover="true"
4242
- cmd: nuget install codecov -excludeversion
4343
- cmd: .\Codecov\Tools\win7-x86\codecov.exe -f ".\SmartFormat.Tests\coverage.net6.0.xml" -n net6.0win
4444
artifacts:
@@ -64,5 +64,5 @@ for:
6464
- dotnet add ./SmartFormat.Tests/SmartFormat.Tests.csproj package AltCover
6565
- dotnet build SmartFormat.sln /verbosity:minimal /t:rebuild /p:configuration=release /nowarn:CS1591,CS0618
6666
test_script:
67-
- dotnet test --no-build --framework net6.0 SmartFormat.sln /p:configuration=release /p:AltCover=true /p:AltCoverXmlReport="coverage.xml" /p:AltCover=true /p:AltCoverStrongNameKey="..\SmartFormat\SmartFormat.snk" /p:AltCoverAssemblyExcludeFilter="SmartFormat.Tests|SmartFormat.ZString|NUnit3.TestAdapter" /p:AltCoverLineCover="true"
67+
- dotnet test --no-build --framework net6.0 SmartFormat.sln /p:configuration=release /p:AltCover=true /p:AltCoverXmlReport="coverage.xml" /p:AltCoverStrongNameKey="..\SmartFormat\SmartFormat.snk" /p:AltCoverAssemblyExcludeFilter="SmartFormat.Tests|NUnit3.TestAdapter" /p:AltCoverAttributeFilter="ExcludeFromCodeCoverage" /p:AltCoverLineCover="true"
6868
- bash <(curl -s https://codecov.io/bash) -f ./SmartFormat.Tests/coverage.net6.0.xml -n net6.0linux

src/Demo/Demo.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net6.0-windows</TargetFramework>
5+
<TargetFrameworks>net6.0-windows</TargetFrameworks>
66
<UseWindowsForms>true</UseWindowsForms>
77
<ApplicationIcon>SmartFormat.Demo.ico</ApplicationIcon>
8-
<LangVersion>8.0</LangVersion>
8+
<NoWarn>$(NoWarn);1591,1573</NoWarn>
99
</PropertyGroup>
1010

1111
<ItemGroup>

src/Demo/Program.cs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
using System;
22
using System.Windows.Forms;
33

4-
namespace SmartFormat.Demo
4+
namespace SmartFormat.Demo;
5+
6+
internal static class Program
57
{
6-
static class Program
8+
/// <summary>
9+
/// The main entry point for the application.
10+
/// </summary>
11+
[STAThread]
12+
public static void Main()
713
{
8-
/// <summary>
9-
/// The main entry point for the application.
10-
/// </summary>
11-
[STAThread]
12-
static void Main()
13-
{
14-
Application.EnableVisualStyles();
15-
Application.SetCompatibleTextRenderingDefault(false);
16-
Application.Run(new SmartFormatDemo());
17-
}
14+
Application.EnableVisualStyles();
15+
Application.SetCompatibleTextRenderingDefault(false);
16+
Application.Run(new SmartFormatDemo());
1817
}
1918
}
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
using System;
1+
#nullable enable
2+
using System;
23
using System.Collections;
3-
#nullable enable
4-
namespace SmartFormat.Demo.Sample_Extensions
4+
5+
namespace Demo.Sample_Extensions;
6+
7+
public class ArgumentValidator
58
{
6-
public class ArgumentValidator
9+
public static void CheckForNullReference(object? argument, string argumentName)
710
{
8-
public static void CheckForNullReference(object? argument, string argumentName)
9-
{
10-
if (argument != null) return;
11-
throw new ArgumentNullException(argumentName);
12-
}
11+
if (argument != null) return;
12+
throw new ArgumentNullException(argumentName);
13+
}
1314

14-
public static void CheckForZeroValue(int argument, string argumentName)
15-
{
16-
if (argument != 0) return;
17-
throw new ArgumentOutOfRangeException(argumentName, argument, argumentName + " cannot be zero");
18-
}
15+
public static void CheckForZeroValue(int argument, string argumentName)
16+
{
17+
if (argument != 0) return;
18+
throw new ArgumentOutOfRangeException(argumentName, argument, argumentName + " cannot be zero");
19+
}
1920

20-
public static void CheckForEmpty(IEnumerable argument, string argumentName)
21-
{
22-
var enumerator = argument.GetEnumerator();
23-
if (enumerator.MoveNext()) return;
24-
throw new ArgumentException(argumentName + " cannot be empty", argumentName);
25-
}
21+
public static void CheckForEmpty(IEnumerable argument, string argumentName)
22+
{
23+
var enumerator = argument.GetEnumerator();
24+
if (enumerator.MoveNext()) return;
25+
throw new ArgumentException(argumentName + " cannot be empty", argumentName);
2626
}
2727
}

0 commit comments

Comments
 (0)