Skip to content

Commit 87843f3

Browse files
committed
fix build deps
1 parent d959e30 commit 87843f3

7 files changed

Lines changed: 13 additions & 24 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2727
<IsPackable>false</IsPackable>
2828
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
29+
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
2930
<PublicKey>00240000048000009400000006020000002400005253413100040000010001007791a689e9d8950b44a9a8886baad2ea180e7a8a854f158c9b98345ca5009cdd2362c84f368f1c3658c132b3c0f74e44ff16aeb2e5b353b6e0fe02f923a050470caeac2bde47a2238a9c7125ed7dab14f486a5a64558df96640933b9f2b6db188fc4a820f96dce963b662fa8864adbff38e5b4542343f162ecdc6dad16912fff</PublicKey>
3031
</PropertyGroup>
3132
<PropertyGroup Condition="'$(Configuration)' == 'Release'">

Directory.Packages.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0" />
1818
<!-- Packages only used in the solution, upgrade at will -->
1919
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
20-
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.1" />
20+
<!-- note: 3.0.x has SNK issue, see 66 in their repo -->
21+
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
2122
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="4.14.0" />
2223
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
2324
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />

src/StackExchange.Redis/TextWriterLogger.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,18 @@ public TextWriterLogger(TextWriter writer, ILogger? wrapped)
1717
_wrapped = wrapped;
1818
}
1919

20-
#if NET8_0_OR_GREATER
2120
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => NothingDisposable.Instance;
22-
#else
23-
public IDisposable BeginScope<TState>(TState state) => NothingDisposable.Instance;
24-
#endif
2521

2622
public bool IsEnabled(LogLevel logLevel) => _writer is not null || _wrapped is not null;
2723
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
2824
{
2925
_wrapped?.Log(logLevel, eventId, state, exception, formatter);
30-
if (_writer is TextWriter writer)
26+
if (_writer is { } writer)
3127
{
3228
lock (writer)
3329
{
3430
// We check here again because it's possible we've released below, and never want to write past releasing.
35-
if (_writer is TextWriter innerWriter)
31+
if (_writer is { } innerWriter)
3632
{
3733
innerWriter.Write($"{DateTime.UtcNow:HH:mm:ss.ffff}: ");
3834
innerWriter.WriteLine(formatter(state, exception));

tests/BasicTestBaseline/BasicTestBaseline.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<PackageReference Include="StackExchange.Redis" />
2020
<PackageReference Include="System.Collections.Immutable" />
2121
<PackageReference Include="System.Reflection.Metadata" />
22+
<PackageReference Include="System.IO.Compression" />
2223
</ItemGroup>
2324

2425
</Project>

tests/ConsoleTestBaseline/ConsoleTestBaseline.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414

1515
<ItemGroup>
1616
<PackageReference Include="StackExchange.Redis" />
17+
<PackageReference Include="System.IO.Compression" />
1718
</ItemGroup>
1819
</Project>

tests/StackExchange.Redis.Tests/LoggerTests.cs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,8 @@ private EnabledNullLogger() { }
4444
public static readonly ILogger Instance = new EnabledNullLogger();
4545

4646
public bool IsEnabled(LogLevel level) => true; // NullLogger now says "no", which breaks our counting
47-
#if NET10_0_OR_GREATER
47+
4848
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => this;
49-
#else
50-
public IDisposable BeginScope<TState>(TState state) => this;
51-
#endif
5249

5350
public void Log<TState>(
5451
LogLevel logLevel,
@@ -87,11 +84,8 @@ public class TestWrapperLogger(ILogger toWrap) : ILogger
8784
public int LogCount = 0;
8885
private ILogger Inner { get; } = toWrap;
8986

90-
#if NET8_0_OR_GREATER
9187
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => Inner.BeginScope(state);
92-
#else
93-
public IDisposable BeginScope<TState>(TState state) => Inner.BeginScope(state);
94-
#endif
88+
9589
public bool IsEnabled(LogLevel logLevel) => Inner.IsEnabled(logLevel);
9690
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
9791
{
@@ -105,11 +99,8 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
10599
/// </summary>
106100
private sealed class TestMultiLogger(params ILogger[] loggers) : ILogger
107101
{
108-
#if NET8_0_OR_GREATER
109102
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => null;
110-
#else
111-
public IDisposable BeginScope<TState>(TState state) => null!;
112-
#endif
103+
113104
public bool IsEnabled(LogLevel logLevel) => true;
114105
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
115106
{
@@ -129,11 +120,8 @@ private sealed class TestLogger : ILogger
129120
public TestLogger(LogLevel logLevel, TextWriter output) =>
130121
(_logLevel, _output) = (logLevel, output);
131122

132-
#if NET8_0_OR_GREATER
133123
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => null;
134-
#else
135-
public IDisposable BeginScope<TState>(TState state) => null!;
136-
#endif
124+
137125
public bool IsEnabled(LogLevel logLevel) => logLevel >= _logLevel;
138126
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
139127
{

toys/TestConsoleBaseline/TestConsoleBaseline.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net8.0;net461;net462;net47;net472</TargetFrameworks>
5+
<TargetFrameworks>net8.0;net461;net472</TargetFrameworks>
66
</PropertyGroup>
77

88
<PropertyGroup Condition="'$(Computername)'=='OCHO' or '$(Computername)'=='SKINK'">
@@ -15,5 +15,6 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="StackExchange.Redis" />
18+
<PackageReference Include="System.IO.Compression" />
1819
</ItemGroup>
1920
</Project>

0 commit comments

Comments
 (0)