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 8cc9381
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 71 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@ jobs:
os: [win-x64, linux-x64, osx-x64]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Build ${{ matrix.os }}
working-directory: ./src
run: dotnet publish -r ${{ matrix.os }} -c Release -o ../output/${{ matrix.os }} --verbosity q --self-contained True -p:PublishTrimmed=True -p:IncludeNativeLibrariesForSelfExtract=True -p:EnableCompressionInSingleFile=True ./FastPack/FastPack.csproj
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: FastPack executable
path: |
output/**/*
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Build ${{ matrix.os }}
working-directory: ./src
run: dotnet publish -r ${{ matrix.os }} -c Release -o ../output/${{ matrix.os }} --verbosity q --self-contained True -p:PublishTrimmed=True -p:IncludeNativeLibrariesForSelfExtract=True -p:EnableCompressionInSingleFile=True ./FastPack/FastPack.csproj
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: FastPack executable
path: |
output/**/*
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Install dependencies
working-directory: ./src
run: dotnet restore
- name: Test
working-directory: ./src
run: dotnet test --no-restore --verbosity normal
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Install dependencies
working-directory: ./src
run: dotnet restore
- name: Test
working-directory: ./src
run: dotnet test --no-restore --verbosity normal
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
3 changes: 2 additions & 1 deletion src/FastPack.Tests/FastPack.Lib/Actions/InfoActionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NUnit.Framework.Legacy;

namespace FastPack.Tests.FastPack.Lib.Actions
{
Expand Down Expand Up @@ -130,7 +131,7 @@ private async Task RunWithOptions(InfoOptions options)

int runResult = await infoAction.Run();

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

// verify method calls
unpackerMock.Verify(u => u.GetManifestFromStream(It.IsAny<Stream>()), Times.Once);
Expand Down
9 changes: 5 additions & 4 deletions src/FastPack.Tests/FastPack.Lib/Actions/UnpackActionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NUnit.Framework.Legacy;

namespace FastPack.Tests.FastPack.Lib.Actions
{
Expand All @@ -33,10 +34,10 @@ await TestUtil.UseFileWithRandomNameFromTestData("IntegrationData/example.fup",
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);
ClassicAssert.AreEqual(FluentAssertionsFileHash, fileHash);
});
});
}
Expand All @@ -60,10 +61,10 @@ await TestUtil.UseRandomTempDirectory(async targetDirectory => {
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);
ClassicAssert.AreEqual(FluentAssertionsFileHash, fileHash);
});
});
});
Expand Down
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 @@ -47,8 +48,8 @@ await LimitParallelProducerConsumer.ProcessData<ParallelProducerConsumerTestItem
produced => produced.Value,
Environment.ProcessorCount,
1);
Assert.AreEqual(expected, sum);
Assert.AreEqual(0, currentSize);
ClassicAssert.AreEqual(expected, sum);
ClassicAssert.AreEqual(0, currentSize);
}

[Test]
Expand Down Expand Up @@ -85,7 +86,7 @@ await LimitParallelProducerConsumer.ProcessData<ParallelProducerConsumerTestItem
produced => produced.Value,
1,
Environment.ProcessorCount);
Assert.AreEqual(expected, sum);
Assert.AreEqual(0, currentSize);
ClassicAssert.AreEqual(expected, sum);
ClassicAssert.AreEqual(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 @@ await ParallelProducerConsumer.ProcessData<int, int>(numbers, async i =>
},
Environment.ProcessorCount,
1);
Assert.AreEqual(expected, sum);
ClassicAssert.AreEqual(expected, sum);
}

[Test]
Expand Down Expand Up @@ -72,15 +73,15 @@ await ParallelProducerConsumer.ProcessData<ParallelProducerConsumerTestItem, Par
{
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);
ClassicAssert.AreEqual(expected, sum);
ClassicAssert.AreEqual(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 8cc9381

Please sign in to comment.