Skip to content

Commit

Permalink
Updated fastpack to .net 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Scordo committed May 13, 2024
1 parent 3cd4065 commit b08fe91
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 46 deletions.
12 changes: 6 additions & 6 deletions src/FastPack.Benchmarks/FastPack.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.1" />
<PackageReference Include="HashDepot" Version="2.0.3" />
<PackageReference Include="K4os.Hash.xxHash" Version="1.0.7" />
<PackageReference Include="Standart.Hash.xxHash.Signed" Version="4.0.4" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.12" />
<PackageReference Include="HashDepot" Version="3.1.0" />
<PackageReference Include="K4os.Hash.xxHash" Version="1.0.8" />
<PackageReference Include="Standart.Hash.xxHash.Signed" Version="4.0.5" />
<PackageReference Include="System.Data.HashFunction.xxHash" Version="2.0.0" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions src/FastPack.Lib/FastPack.Lib.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<RootNamespace>FastPack.Lib</RootNamespace>
<AssemblyName>FastPack.Lib</AssemblyName>
<Company>Quanos Solutions GmbH</Company>
Expand Down Expand Up @@ -35,14 +35,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DotNet.Glob" Version="3.1.3" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
<PackageReference Include="Standart.Hash.xxHash.Signed" Version="4.0.4" />
<PackageReference Include="System.Text.Json" Version="6.0.5" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="6.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="FastPack, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a58082cf1bccfaa66f099aaf52c3b64ca38267f5b809f52cba53938079ba280cf65373089373ba048b2ca9d07cbc32385eaddfc872bf2e33ce7481d0ab8dc480b2a039933258bed8b028bfb10f772d8551751a772dfb7a13a0ee0b2a50accf85b4dbc0298a93f5937f040981d16fb35a2c4802b551f8aedde3839b9789e58cab" />
Expand Down
8 changes: 4 additions & 4 deletions src/FastPack.TestFramework/FastPack.TestFramework.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" TreatAsLocalProperty="SelfContained;PublishTrimmed;RuntimeIdentifier">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<IsPackable>false</IsPackable>
Expand Down Expand Up @@ -46,9 +46,9 @@


<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/FastPack.Tests/FastPack.Lib/Actions/InfoActionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private async Task RunWithOptions(InfoOptions options)

int runResult = await infoAction.Run();

Assert.AreEqual(0, runResult);
Assert.Equals(0, runResult);

// verify method calls
unpackerMock.Verify(u => u.GetManifestFromStream(It.IsAny<Stream>()), Times.Once);
Expand Down
8 changes: 4 additions & 4 deletions src/FastPack.Tests/FastPack.Lib/Actions/UnpackActionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public async Task UnpackPredefinedFupPackage()
await unpackAction.Run();
string extractedFilePath = Path.Combine(outputDirectory, "FluentAssertions.dll");
Assert.IsTrue(File.Exists(extractedFilePath));
Assert.That(File.Exists(extractedFilePath));
string fileHash = await CryptoUtil.CalculateFileHash(new XXHashProvider(), extractedFilePath);
Assert.AreEqual(FluentAssertionsFileHash, fileHash);
Assert.Equals(FluentAssertionsFileHash, fileHash);
});
});
}
Expand All @@ -60,10 +60,10 @@ public async Task UnpackPredefinedFupPackageRepackAndUnpackAgain()
await unpackAction2.Run();
string extractedFilePath = Path.Combine(targetDirectory, "FluentAssertions.dll");
Assert.IsTrue(File.Exists(extractedFilePath));
Assert.That(File.Exists(extractedFilePath));
string fileHash = await CryptoUtil.CalculateFileHash(new XXHashProvider(), extractedFilePath);
Assert.AreEqual(FluentAssertionsFileHash, fileHash);
Assert.Equals(FluentAssertionsFileHash, fileHash);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public async Task TestProcessData()
produced => produced.Value,
Environment.ProcessorCount,
1);
Assert.AreEqual(expected, sum);
Assert.AreEqual(0, currentSize);
Assert.Equals(expected, sum);
Assert.Equals(0, currentSize);
}

[Test]
Expand Down Expand Up @@ -85,7 +85,7 @@ public async Task TestProcessData_ManyConsumersOneProducer()
produced => produced.Value,
1,
Environment.ProcessorCount);
Assert.AreEqual(expected, sum);
Assert.AreEqual(0, currentSize);
Assert.Equals(expected, sum);
Assert.Equals(0, currentSize);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using FastPack.Lib.TypeExtensions;
using FastPack.TestFramework.Common;
using NUnit.Framework;
using NUnit.Framework.Legacy;

namespace FastPack.Tests.FastPack.Lib;

Expand Down Expand Up @@ -35,7 +36,7 @@ public async Task TestProcessData()
},
Environment.ProcessorCount,
1);
Assert.AreEqual(expected, sum);
Assert.Equals(expected, sum);
}

[Test]
Expand Down Expand Up @@ -72,15 +73,15 @@ public async Task TestProcessDataWithParallelLimit()
{
Interlocked.Decrement(ref currentCountInQueue);
//Console.WriteLine($"Size: {currentSize}, Count: {currentCountInQueue}");
Assert.GreaterOrEqual(limit, currentSize);
ClassicAssert.GreaterOrEqual(limit, currentSize);
await Task.Delay(i.Size * 10);
sum += i.Value;
Interlocked.Add(ref currentSize, -1 * i.Size);
signal.Release();
},
Environment.ProcessorCount,
1);
Assert.AreEqual(expected, sum);
Assert.AreEqual(0, currentSize);
Assert.Equals(expected, sum);
Assert.Equals(0, currentSize);
}
}
16 changes: 8 additions & 8 deletions src/FastPack.Tests/FastPack.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" TreatAsLocalProperty="SelfContained;PublishTrimmed;RuntimeIdentifier">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<IsPackable>false</IsPackable>
Expand Down Expand Up @@ -36,24 +36,24 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.17.2">
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.31.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Moq" Version="4.18.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="Moq.Analyzers" Version="0.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1">
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JUnitTestLogger" Version="1.1.0" />
<PackageReference Include="System.Text.Json" Version="6.0.5" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NUnit.Framework.Legacy;

namespace FastPack.Tests.FastPack.Options.Parsers
{
Expand All @@ -19,7 +20,7 @@ public async Task Empty_Arguments_Are_No_Problem_For_Parse()
ArgumentsParser argumentsParser = CreateParser(new string[] { }, false);
bool result = await argumentsParser.Parse(new Dictionary<string, Func<string, Task<bool>>>());

Assert.IsTrue(result);
Assert.That(result);
}

[Test]
Expand All @@ -28,7 +29,7 @@ public async Task Missing_Mapping_Is_No_Problem_For_Parse_In_NonStrict_Mode()
ArgumentsParser argumentsParser = CreateParser(new string[] { "KEY_WITH_NO_MAPPING" }, false);
bool result = await argumentsParser.Parse(new Dictionary<string, Func<string, Task<bool>>>());

Assert.IsTrue(result);
Assert.That(result);
}

[Test]
Expand All @@ -38,7 +39,7 @@ public async Task Missing_Mapping_Returns_False_In_Strict_Mode()
ArgumentsParser argumentsParser = CreateParser(new[] { "KEY_WITH_NO_MAPPING" }, true, loggerMock.Object);

bool result = await argumentsParser.Parse(new Dictionary<string, Func<string, Task<bool>>>());
Assert.IsFalse(result);
ClassicAssert.IsFalse(result);

loggerMock.Verify(l => l.ErrorLine("Unknown parameter: KEY_WITH_NO_MAPPING"));
}
Expand All @@ -57,7 +58,7 @@ public async Task All_Parameters_Are_Processed()

bool result = await argumentsParser.Parse(parameterProcessingMap);

Assert.IsTrue(result);
Assert.That(result);
args.Should().BeEmpty("all parameters should be removed");
}

Expand Down
12 changes: 6 additions & 6 deletions src/FastPack/FastPack.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<Company>Quanos Solutions GmbH</Company>
<Authors>Quanos Solutions GmbH</Authors>
Expand Down Expand Up @@ -43,7 +43,7 @@
<None Remove="Properties\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -53,10 +53,10 @@
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="FastPack.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a58082cf1bccfaa66f099aaf52c3b64ca38267f5b809f52cba53938079ba280cf65373089373ba048b2ca9d07cbc32385eaddfc872bf2e33ce7481d0ab8dc480b2a039933258bed8b028bfb10f772d8551751a772dfb7a13a0ee0b2a50accf85b4dbc0298a93f5937f040981d16fb35a2c4802b551f8aedde3839b9789e58cab" />
<InternalsVisibleTo Include="FastPack.Windows.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a58082cf1bccfaa66f099aaf52c3b64ca38267f5b809f52cba53938079ba280cf65373089373ba048b2ca9d07cbc32385eaddfc872bf2e33ce7481d0ab8dc480b2a039933258bed8b028bfb10f772d8551751a772dfb7a13a0ee0b2a50accf85b4dbc0298a93f5937f040981d16fb35a2c4802b551f8aedde3839b9789e58cab"/>
<InternalsVisibleTo Include="FastPack.Linux.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a58082cf1bccfaa66f099aaf52c3b64ca38267f5b809f52cba53938079ba280cf65373089373ba048b2ca9d07cbc32385eaddfc872bf2e33ce7481d0ab8dc480b2a039933258bed8b028bfb10f772d8551751a772dfb7a13a0ee0b2a50accf85b4dbc0298a93f5937f040981d16fb35a2c4802b551f8aedde3839b9789e58cab"/>
<InternalsVisibleTo Include="FastPack.OSX.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a58082cf1bccfaa66f099aaf52c3b64ca38267f5b809f52cba53938079ba280cf65373089373ba048b2ca9d07cbc32385eaddfc872bf2e33ce7481d0ab8dc480b2a039933258bed8b028bfb10f772d8551751a772dfb7a13a0ee0b2a50accf85b4dbc0298a93f5937f040981d16fb35a2c4802b551f8aedde3839b9789e58cab"/>
<InternalsVisibleTo Include="DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7"/>
<InternalsVisibleTo Include="FastPack.Windows.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a58082cf1bccfaa66f099aaf52c3b64ca38267f5b809f52cba53938079ba280cf65373089373ba048b2ca9d07cbc32385eaddfc872bf2e33ce7481d0ab8dc480b2a039933258bed8b028bfb10f772d8551751a772dfb7a13a0ee0b2a50accf85b4dbc0298a93f5937f040981d16fb35a2c4802b551f8aedde3839b9789e58cab" />
<InternalsVisibleTo Include="FastPack.Linux.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a58082cf1bccfaa66f099aaf52c3b64ca38267f5b809f52cba53938079ba280cf65373089373ba048b2ca9d07cbc32385eaddfc872bf2e33ce7481d0ab8dc480b2a039933258bed8b028bfb10f772d8551751a772dfb7a13a0ee0b2a50accf85b4dbc0298a93f5937f040981d16fb35a2c4802b551f8aedde3839b9789e58cab" />
<InternalsVisibleTo Include="FastPack.OSX.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a58082cf1bccfaa66f099aaf52c3b64ca38267f5b809f52cba53938079ba280cf65373089373ba048b2ca9d07cbc32385eaddfc872bf2e33ce7481d0ab8dc480b2a039933258bed8b028bfb10f772d8551751a772dfb7a13a0ee0b2a50accf85b4dbc0298a93f5937f040981d16fb35a2c4802b551f8aedde3839b9789e58cab" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7" />
</ItemGroup>
<Target Name="AuthenticodeSignAssembly" AfterTargets="Compile" Condition="'$(SignFastpackAssemblies)' == 'true'">
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.100",
"version": "8.0.100",
"rollForward": "latestMajor"
}
}

0 comments on commit b08fe91

Please sign in to comment.