Skip to content

Commit

Permalink
Added .NET 8.0 build target
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianeicher committed Dec 27, 2023
1 parent 90c9cb2 commit 2203e58
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 22 deletions.
2 changes: 1 addition & 1 deletion doc/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pushd $PSScriptRoot

function Run-DotNet {
..\0install.ps1 run --batch --version 6.0.. https://apps.0install.net/dotnet/sdk.xml @args
..\0install.ps1 run --batch --version 8.0.. https://apps.0install.net/dotnet/sdk.xml @args
if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
}

Expand Down
2 changes: 1 addition & 1 deletion doc/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd `dirname $0`
if command -v dotnet > /dev/null 2> /dev/null; then
dotnet="dotnet"
else
dotnet="../0install.sh run --version 6.0.. https://apps.0install.net/dotnet/sdk.xml"
dotnet="../0install.sh run --version 8.0.. https://apps.0install.net/dotnet/sdk.xml"
fi

# Build docs
Expand Down
2 changes: 1 addition & 1 deletion doc/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
],
"properties": {
"TargetFramework": "net6.0"
"TargetFramework": "net8.0"
},
"namespaceLayout": "nested",
"dest": "api"
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<!-- Build configuration -->
<LangVersion>preview</LangVersion>
<LangVersion>12.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
<Nullable>annotations</Nullable>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<OutputType>Library</OutputType>
Expand Down
11 changes: 6 additions & 5 deletions src/TypedRest.OAuth/TypedRest.OAuth.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
<!-- Dependencies -->
<ItemGroup>
<PackageReference Include="IdentityModel" Version="6.2.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="7.0.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0' Or '$(TargetFramework)'=='netstandard2.1'">
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.32" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<ItemGroup Condition="$(TargetFramework)=='net6.0'">
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework)!='net6.0'">
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
</ItemGroup>

</Project>
5 changes: 4 additions & 1 deletion src/TypedRest.SystemTextJson/TypedRest.SystemTextJson.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
<ItemGroup>
<ProjectReference Include="..\TypedRest\TypedRest.csproj" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="$(TargetFramework)=='net6.0'">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework)!='net6.0'">
<PackageReference Include="System.Text.Json" Version="8.0.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/TypedRest/TaskExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ namespace TypedRest;
public static class TaskExtensions
{
/// <summary>
/// Convenience wrapper for <see cref="Task.ConfigureAwait"/><c>(false)</c>.
/// Convenience wrapper for <see cref="Task.ConfigureAwait(bool)"/><c>(false)</c>.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ConfiguredTaskAwaitable NoContext(this Task task)
=> task.ConfigureAwait(continueOnCapturedContext: false);

/// <summary>
/// Convenience wrapper for <see cref="Task{T}.ConfigureAwait"/><c>(false)</c>.
/// Convenience wrapper for <see cref="Task{TResult}.ConfigureAwait(bool)"/><c>(false)</c>.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ConfiguredTaskAwaitable<TResult> NoContext<TResult>(this Task<TResult> task)
Expand Down
9 changes: 8 additions & 1 deletion src/TypedRest/TypedRest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Resta.UriTemplates" Version="1.4.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="7.0.2" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework)=='net6.0'">
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="6.0.25" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework)!='net6.0'">
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<!-- Project properties -->
<PropertyGroup>
<RootNamespace>TypedRest</RootNamespace>
<TargetFrameworks>net48;net6.0</TargetFrameworks>
<TargetFrameworks>net48;net8.0</TargetFrameworks>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<IsPackable>False</IsPackable>
<DeterministicSourcePaths>False</DeterministicSourcePaths>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework)=='net6.0'">
<PropertyGroup Condition="$(TargetFramework)=='net8.0'">
<Nullable>enable</Nullable>
</PropertyGroup>

Expand All @@ -26,7 +26,7 @@
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="RichardSzalay.MockHttp" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6" />
Expand Down
2 changes: 1 addition & 1 deletion src/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ErrorActionPreference = "Stop"
pushd $PSScriptRoot

function Run-DotNet {
..\0install.ps1 run --batch --version 6.0.. https://apps.0install.net/dotnet/sdk.xml @args
..\0install.ps1 run --batch --version 8.0.. https://apps.0install.net/dotnet/sdk.xml @args
if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
}

Expand Down
2 changes: 1 addition & 1 deletion src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd `dirname $0`
if command -v dotnet > /dev/null 2> /dev/null; then
dotnet="dotnet"
else
dotnet="../0install.sh run --version 6.0.. https://apps.0install.net/dotnet/sdk.xml"
dotnet="../0install.sh run --version 8.0.. https://apps.0install.net/dotnet/sdk.xml"
fi

# Build
Expand Down
2 changes: 1 addition & 1 deletion src/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $ErrorActionPreference = "Stop"
pushd $PSScriptRoot

function Run-DotNet {
..\0install.ps1 run --batch --version 6.0..!6.1 https://apps.0install.net/dotnet/sdk.xml @args
..\0install.ps1 run --batch --version 8.0..!8.1 https://apps.0install.net/dotnet/sdk.xml @args
if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
}

Expand Down
4 changes: 2 additions & 2 deletions src/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ cd `dirname $0`
if command -v dotnet > /dev/null 2> /dev/null; then
dotnet="dotnet"
else
dotnet="../0install.sh run --version 6.0..!6.1 https://apps.0install.net/dotnet/sdk.xml"
dotnet="../0install.sh run --version 8.0..!8.1 https://apps.0install.net/dotnet/sdk.xml"
fi

# Unit tests (without .NET Framework)
$dotnet test --no-build --logger trx --configuration Release --framework net6.0 UnitTests/UnitTests.csproj
$dotnet test --no-build --logger trx --configuration Release --framework net8.0 UnitTests/UnitTests.csproj

0 comments on commit 2203e58

Please sign in to comment.