Skip to content

Commit

Permalink
Target LTS versions of .NET (v6.0, v8.0).
Browse files Browse the repository at this point in the history
Drop direct support for net7.0. Update NuGet packages to latest.
  • Loading branch information
bgrainger committed Jul 9, 2024
1 parent ed4dad4 commit 69e72b1
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up .NET 7.0
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x
- name: Restore
run: dotnet restore
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup Condition=" '$(BuildNumber)' != '' ">
Expand Down
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "latestFeature"
}
}
10 changes: 10 additions & 0 deletions src/BsDiff/BinaryPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ public static class BinaryPatch
public static void Create(ReadOnlySpan<byte> oldData, ReadOnlySpan<byte> newData, Stream output)
{
// check arguments
#if NET6_0_OR_GREATER
ArgumentNullException.ThrowIfNull(output);
#else
if (output is null)
throw new ArgumentNullException(nameof(output));
#endif
if (!output.CanSeek)
throw new ArgumentException("Output stream must be seekable.", nameof(output));
if (!output.CanWrite)
Expand Down Expand Up @@ -222,12 +226,18 @@ 0 32 Header
public static void Apply(Stream input, Func<Stream> openPatchStream, Stream output)
{
// check arguments
#if NET6_0_OR_GREATER
ArgumentNullException.ThrowIfNull(input);
ArgumentNullException.ThrowIfNull(openPatchStream);
ArgumentNullException.ThrowIfNull(output);
#else
if (input is null)
throw new ArgumentNullException(nameof(input));
if (openPatchStream is null)
throw new ArgumentNullException(nameof(openPatchStream));
if (output is null)
throw new ArgumentNullException(nameof(output));
#endif

/*
File format:
Expand Down
6 changes: 3 additions & 3 deletions src/BsDiff/BsDiff.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<Description>.NET port of bsdiff, Colin Pervical's binary diff/patch utility, in 100% managed code.</Description>
<PackageId>BsDiff</PackageId>
Expand All @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="IndexRange" Version="1.0.2" PrivateAssets="All" />
<PackageReference Include="IndexRange" Version="1.0.3" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/BsDiffTool/BsDiffTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Description>Port of bsdiff to .NET.</Description>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/BsPatchTool/BsPatchTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Description>Port of bspatch to .NET.</Description>
</PropertyGroup>

Expand Down
10 changes: 5 additions & 5 deletions tests/BsDiff.Tests/BsDiff.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
<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.10.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<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.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit 69e72b1

Please sign in to comment.