Skip to content

Commit

Permalink
Bump target framework version
Browse files Browse the repository at this point in the history
  • Loading branch information
hadashiA committed Sep 21, 2023
1 parent f057ad1 commit c309da0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
7 changes: 5 additions & 2 deletions sandbox/ConsoleApp/ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../../opensource.snk</AssemblyOriginatorKeyFile>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Include="System.Text.Json" Version="4.7.1" />
<ProjectReference Include="..\..\src\ZString\ZString.csproj" />
<ProjectReference Include="..\..\src\ZString\ZString.csproj">
<SetTargetFramework>TargetFramework=netstandard2.1</SetTargetFramework>
</ProjectReference>
</ItemGroup>

</Project>
30 changes: 20 additions & 10 deletions sandbox/ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
using Cysharp.Text;
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Linq;
using System.Text;
// using System.Text.Formatting;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

namespace ConsoleApp
{
Expand All @@ -20,19 +15,34 @@ class Program
{
static void Main(string[] args)
{
// BenchmarkRunner.Run<JoinBenchmark>();
Run();
}

static void Run()
{
ZString.Join(",", "a", "b");
TimeSpan span = new TimeSpan(12, 34, 56);
Console.WriteLine($"string.Format: {string.Format(@"{0:h\,h\:mm\:ss}", span)}");


Console.WriteLine($"ZString.Format: {ZString.Format(@"{0:h\,h\:mm\:ss}", span)}");
}
}

public class JoinBenchmark
{
public string[] Source = new []{ "111", "222", "333"};
public const string Sp = ",";

[Benchmark]
public string StringJoin()
{
return string.Join(Sp, Source);
}


[Benchmark]
public string ZStringJoin()
{
return ZString.Join(Sp, Source);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ZString/ZString.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;netstandard2.0;net6.0;net7.0</TargetFrameworks>
<RootNamespace>Cysharp.Text</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
6 changes: 4 additions & 2 deletions tests/ZString.Tests/ZString.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>ZStringTests</RootNamespace>
<SignAssembly>true</SignAssembly>
Expand All @@ -23,7 +23,9 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\ZString\ZString.csproj" />
<ProjectReference Include="..\..\src\ZString\ZString.csproj">
<SetTargetFramework>TargetFramework=netstandard2.1</SetTargetFramework>
</ProjectReference>
</ItemGroup>

</Project>

0 comments on commit c309da0

Please sign in to comment.