Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(*): cleanup unused usings, up .net8 #25

Merged
merged 7 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions DeflateCompressionTest/DeflateCompressionTest.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
<NoWarn>$(NoWarn);1701;1702;1705;1591</NoWarn>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<!-- Shared Package Versions -->
Expand Down
6 changes: 6 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
4 changes: 1 addition & 3 deletions Orleans.Persistence.Redis.E2E/Consts.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace Orleans.Persistence.Redis.E2E
namespace Orleans.Persistence.Redis.E2E
{
public static class Consts
{
Expand Down
7 changes: 1 addition & 6 deletions Orleans.Persistence.Redis.E2E/JsonSerializationTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using System;
using Microsoft.Extensions.Configuration;
using Orleans.Hosting;
using Microsoft.Extensions.Configuration;
using Orleans.Streams;
using Orleans.TestingHost;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;

namespace Orleans.Persistence.Redis.E2E
Expand Down
4 changes: 0 additions & 4 deletions Orleans.Persistence.Redis.E2E/MessagePackTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using Microsoft.Extensions.Configuration;
using Orleans.Hosting;
using Orleans.Persistence.Redis.Config;
using Orleans.Persistence.Redis.Serialization;
using Orleans.Streams;
using Orleans.TestingHost;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xunit;

namespace Orleans.Persistence.Redis.E2E
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using Orleans.TestingHost;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;

Expand Down Expand Up @@ -75,9 +71,7 @@ public RedisOrleansSerializerCompressedSegmentedTest(ITestOutputHelper output) :

[Fact]
public async Task Test()
{
await PerformTest("SerializerCompressedSegmentedTest");
}
=> await PerformTest("SerializerCompressedSegmentedTest");
}

public class SiloBuilderConfiguratorOrleansSerializerDeflateCompressionSegmentedTest : RedisSegmentTests<SiloConfigurator.SiloBuilderConfiguratorOrleansSerializerDeflateCompressionSegmented>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Threading;
using Orleans.Providers;
using System.Threading.Tasks;
using Orleans.Providers;

namespace Orleans.Persistence.Redis.E2E.RedisSegmentTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Humanizer;
using Microsoft.Extensions.Configuration;
using Orleans.Hosting;
using Orleans.Persistence.Redis.Serialization;
using Orleans.TestingHost;
using System.Collections.Generic;

namespace Orleans.Persistence.Redis.E2E.RedisSegmentTests.SiloConfigurator
{
Expand Down
1 change: 0 additions & 1 deletion Orleans.Persistence.Redis.E2E/RedisTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Orleans.Streams;
using System.Threading.Tasks;
using Xunit;

namespace Orleans.Persistence.Redis.E2E
Expand Down
14 changes: 5 additions & 9 deletions Orleans.Persistence.Redis.E2E/TestBase.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using Microsoft.Extensions.Configuration;
using Orleans.Hosting;
using Orleans.TestingHost;
using StackExchange.Redis;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xunit;
using static StackExchange.Redis.ConnectionMultiplexer;

Expand Down Expand Up @@ -44,15 +41,14 @@ public Task DisposeAsync()

protected static async Task FlushDb()
{
using (var connection = await ConnectAsync(new ConfigurationOptions
await using var connection = await ConnectAsync(new ConfigurationOptions
{
EndPoints = { "localhost" },
AllowAdmin = true
}))
{
var server = connection.GetServer("localhost:6379");
await server.FlushAllDatabasesAsync();
}
});

var server = connection.GetServer("localhost:6379");
await server.FlushAllDatabasesAsync();
}
}

Expand Down
4 changes: 0 additions & 4 deletions Orleans.Persistence.Redis.E2E/TestGrain.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using Orleans.Providers;
using Orleans.Streams;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace Orleans.Persistence.Redis.E2E
{
Expand Down
9 changes: 4 additions & 5 deletions Orleans.Persistence.Redis/Compression/BrotliCompression.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.IO;
using System.IO.Compression;
using System.IO.Compression;

namespace Orleans.Persistence.Redis.Compression
{
Expand All @@ -9,7 +8,7 @@ public byte[] Decompress(byte[] bytes)
{
using var memoryStream = new MemoryStream(bytes);
using var outputStream = new MemoryStream();
using (var decompressStream = new Brotli.BrotliStream(memoryStream, CompressionMode.Decompress))
using (var decompressStream = new BrotliStream(memoryStream, CompressionMode.Decompress))
{
decompressStream.CopyTo(outputStream);
}
Expand All @@ -20,12 +19,12 @@ public byte[] Decompress(byte[] bytes)
public byte[] Compress(byte[] bytes)
{
using var memoryStream = new MemoryStream();
using (var brotliStream = new Brotli.BrotliStream(memoryStream, CompressionMode.Compress))
using (var brotliStream = new BrotliStream(memoryStream, CompressionMode.Compress))
{
brotliStream.Write(bytes, 0, bytes.Length);
}

return memoryStream.ToArray();
}
}
}
}
5 changes: 1 addition & 4 deletions Orleans.Persistence.Redis/Compression/DeflateCompression.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.IO.Compression;

namespace Orleans.Persistence.Redis.Compression
{
Expand Down
3 changes: 1 addition & 2 deletions Orleans.Persistence.Redis/Compression/GZipCompression.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.IO;
using System.IO.Compression;
using System.IO.Compression;

namespace Orleans.Persistence.Redis.Compression
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.IO;
using System.IO.Compression;
using System.IO.Compression;

namespace Orleans.Persistence.Redis.Compression
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using Orleans.Runtime;
using Orleans.Serialization;
using Orleans.Storage;
using System;
using JsonSerializer = Orleans.Persistence.Redis.Serialization.JsonSerializer;
using OrleansSerializer = Orleans.Persistence.Redis.Serialization.OrleansSerializer;

Expand Down
3 changes: 0 additions & 3 deletions Orleans.Persistence.Redis/Config/RedisStorageOptions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using Orleans.Persistence.Redis.Compression;
using Orleans.Persistence.Redis.Serialization;
using System;
using System.Collections.Generic;
using Microsoft.Extensions.Options;
using Orleans.Hosting;

namespace Orleans.Persistence.Redis.Config
{
Expand Down
2 changes: 0 additions & 2 deletions Orleans.Persistence.Redis/Core/DbConnection.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Microsoft.Extensions.Logging;
using Orleans.Persistence.Redis.Config;
using StackExchange.Redis;
using System;
using System.Threading.Tasks;

namespace Orleans.Persistence.Redis.Core
{
Expand Down
4 changes: 0 additions & 4 deletions Orleans.Persistence.Redis/Core/GrainStateStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@
using Orleans.Persistence.Redis.Utils;
using Orleans.Storage;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace Orleans.Persistence.Redis.Core
{
Expand Down
5 changes: 1 addition & 4 deletions Orleans.Persistence.Redis/Core/IGrainStateStore.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Threading.Tasks;

namespace Orleans.Persistence.Redis.Core
namespace Orleans.Persistence.Redis.Core
{
public interface IGrainStateStore
{
Expand Down
3 changes: 0 additions & 3 deletions Orleans.Persistence.Redis/Core/RedisGrainStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
using Orleans.Persistence.Redis.Utils;
using Orleans.Runtime;
using Orleans.Storage;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Orleans.Persistence.Redis.Core
{
Expand Down
1 change: 0 additions & 1 deletion Orleans.Persistence.Redis/Core/ValueStopwatch.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// ref: https://github.com/aspnet/Extensions/blob/master/src/Shared/src/ValueStopwatch/ValueStopwatch.cs

using System;
using System.Diagnostics;

namespace Orleans.Persistence.Redis.Core
Expand Down
9 changes: 4 additions & 5 deletions Orleans.Persistence.Redis/Orleans.Persistence.Redis.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<PackageId>Sucrose.Orleans.Persistence.Redis</PackageId>
<Product>Sucrose.Orleans.Persistence.Redis</Product>
<RepositoryUrl>https://github.com/jonathansant/Orleans.Persistence.Redis</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Brotli.NET" Version="2.1.1" />
<PackageReference Include="MessagePack" Version="2.1.143" />
<!--<PackageReference Include="Brotli.NET" Version="2.1.1" />-->
<PackageReference Include="MessagePack" Version="2.5.140" />
<PackageReference Include="Microsoft.Orleans.Runtime" Version="7.2.2" />
<PackageReference Include="Microsoft.Orleans.Sdk" Version="7.2.2" />
<PackageReference Include="StackExchange.Redis" Version="2.2.62" />
<PackageReference Include="StackExchange.Redis" Version="2.7.17" />
<PackageReference Include="System.Data.HashFunction.xxHash" Version="2.0.0" />
<PackageReference Include="ByteSize" Version="2.0.0" />
<PackageReference Include="ByteSize" Version="2.1.2" />
</ItemGroup>

</Project>
2 changes: 0 additions & 2 deletions Orleans.Persistence.Redis/Serialization/BrotliSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Orleans.Serialization;
using System.IO;
using System.IO.Compression;
using BrotliStream = Brotli.BrotliStream;

namespace Orleans.Persistence.Redis.Serialization
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Orleans.Serialization;
using System.IO;
using System.IO.Compression;

namespace Orleans.Persistence.Redis.Serialization
Expand Down
4 changes: 1 addition & 3 deletions Orleans.Persistence.Redis/Serialization/ISerializer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace Orleans.Persistence.Redis.Serialization
namespace Orleans.Persistence.Redis.Serialization
{
public interface IHumanReadableSerializer
{
Expand Down
1 change: 0 additions & 1 deletion Orleans.Persistence.Redis/Serialization/JsonSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Newtonsoft.Json;
using Orleans.Persistence.Redis.Compression;
using System;

namespace Orleans.Persistence.Redis.Serialization
{
Expand Down
2 changes: 0 additions & 2 deletions Orleans.Persistence.Redis/Utils/ObjectExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Newtonsoft.Json;
using System.Data.HashFunction.xxHash;
using System.IO;
using System.Text;
using System.Threading.Tasks;

namespace Orleans.Persistence.Redis.Utils
{
Expand Down
3 changes: 1 addition & 2 deletions Orleans.Persistence.Redis/Utils/ReflectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Concurrent;
using System.Text;

namespace Orleans.Persistence.Redis.Utils
Expand Down
4 changes: 1 addition & 3 deletions Samples/RedisApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Threading.Tasks;
using StackExchange.Redis;
using StackExchange.Redis;

namespace RedisApp
{
Expand Down
3 changes: 1 addition & 2 deletions Samples/RedisApp/RedisApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="StackExchange.Redis" Version="2.1.58" />
<PackageReference Include="StackExchange.Redis" Version="2.7.17" />
</ItemGroup>

</Project>
Loading
Loading