mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 21:38:16 +08:00
Add support for .NET 7.0
This commit is contained in:

committed by
Patrik Svensson

parent
02f9d26473
commit
7dce4af552
@ -110,7 +110,7 @@ internal static class EnumerableExtensions
|
||||
return source.Select((value, index) => func(value, index));
|
||||
}
|
||||
|
||||
#if !NET5_0_OR_GREATER
|
||||
#if !NET6_0_OR_GREATER
|
||||
public static IEnumerable<(TFirst First, TSecond Second)> Zip<TFirst, TSecond>(
|
||||
this IEnumerable<TFirst> source, IEnumerable<TSecond> first)
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ internal static class StringBuilderExtensions
|
||||
public static void AppendSpan(this StringBuilder builder, ReadOnlySpan<char> span)
|
||||
{
|
||||
// NetStandard 2 lacks the override for StringBuilder to add the span. We'll need to convert the span
|
||||
// to a string for it, but for .NET 5.0 or newer we'll use the override.
|
||||
// to a string for it, but for .NET 6.0 or newer we'll use the override.
|
||||
#if NETSTANDARD2_0
|
||||
builder.Append(span.ToString());
|
||||
#else
|
||||
|
@ -64,8 +64,8 @@ internal static class ColorSystemDetector
|
||||
return false;
|
||||
}
|
||||
|
||||
#if NET5_0_OR_GREATER
|
||||
// The reason we're not always using this, is because it will return wrong values on other runtimes than .NET 5+
|
||||
#if NET6_0_OR_GREATER
|
||||
// The reason we're not always using this, is because it will return wrong values on other runtimes than .NET 6+
|
||||
// See https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/5.0/environment-osversion-returns-correct-version
|
||||
var version = Environment.OSVersion.Version;
|
||||
major = version.Major;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
|
||||
<TargetFrameworks>net7.0;net6.0;netstandard2.0</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<IsPackable>true</IsPackable>
|
||||
<NoWarn>SA1633</NoWarn>
|
||||
@ -19,7 +19,7 @@
|
||||
<PackageReference Include="System.Memory" Version="4.5.5" />
|
||||
<PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.160" PrivateAssets="all" />
|
||||
<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[$(AnnotatedReferenceAssemblyVersion)]" />
|
||||
<PackageReference Include="Nullable" Version="1.3.0">
|
||||
<PackageReference Include="Nullable" Version="1.3.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
Reference in New Issue
Block a user