Skip to content

Commit

Permalink
Wolverine libs can target .NET 8. Closes GH-636
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydmiller committed Nov 21, 2023
1 parent 68aa4a1 commit f28686a
Show file tree
Hide file tree
Showing 27 changed files with 54 additions and 52 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageIconUrl>https://github.com/JasperFx/wolverine/blob/main/docs/public/logo.png?raw=true</PackageIconUrl>
<PackageProjectUrl>http://github.com/jasperfx/wolverine</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<NoWarn>1570;1571;1572;1573;1574;1587;1591;1701;1702;1711;1735;0618</NoWarn>
<ImplicitUsings>true</ImplicitUsings>
<Version>1.11.1</Version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

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

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

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

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

<PropertyGroup>
<IsPackable>true</IsPackable>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<!-- Leave this be, needing to override the Directory defaults -->
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>

<Description>Fluent Validation middleware for Wolverine HTTP Endpoints</Description>
<DebugType>portable</DebugType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<!-- Leave this be, needing to override the Directory defaults -->
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>

<Description>Marten middleware and other helpers for Wolverine HTTP Endpoints</Description>
<DebugType>portable</DebugType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Wolverine.Http.Tests/Wolverine.Http.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
4 changes: 2 additions & 2 deletions src/Http/Wolverine.Http/HttpChain.EndpointBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ public RouteEndpoint BuildEndpoint()
if (ResourceType == null)
{
builder.RemoveStatusCodeResponse(200);
builder.Metadata.Add(new ProducesResponseTypeMetadata { StatusCode = 204, Type = null });
builder.Metadata.Add(new WolverineProducesResponseTypeMetadata { StatusCode = 204, Type = null });
}


// Set up OpenAPI data for ProblemDetails with status code 400 if not already exists
if (Middleware.SelectMany(x => x.Creates).Any(x => x.VariableType == typeof(ProblemDetails)))
{
if (!builder.Metadata.OfType<ProducesResponseTypeMetadata>()
if (!builder.Metadata.OfType<WolverineProducesResponseTypeMetadata>()
.Any(x => x.Type != null && x.Type.CanBeCastTo<ProblemDetails>()))
{
builder.Metadata.Add(new ProducesProblemDetailsResponseTypeMetadata());
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Wolverine.Http/IHttpAware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
builder.RemoveStatusCodeResponse(200);

var create = new MethodCall(method.DeclaringType!, method).Creates.FirstOrDefault()?.VariableType;
var metadata = new ProducesResponseTypeMetadata { Type = create, StatusCode = 201 };
var metadata = new WolverineProducesResponseTypeMetadata { Type = create, StatusCode = 201 };
builder.Metadata.Add(metadata);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Wolverine.Http.Resources;

internal class ProducesResponseTypeMetadata : IProducesResponseTypeMetadata
internal class WolverineProducesResponseTypeMetadata : IProducesResponseTypeMetadata
{
public Type? Type { get; init; }
public int StatusCode { get; init; }
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Wolverine.Http/Runtime/PublishingEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static void Configure(HttpChain chain)
chain.Metadata.Add(builder =>
{
// Adding and modifying data
builder.Metadata.Add(new ProducesResponseTypeMetadata { StatusCode = 202, Type = null });
builder.Metadata.Add(new WolverineProducesResponseTypeMetadata { StatusCode = 202, Type = null });
builder.RemoveStatusCodeResponse(200);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Wolverine.Http/Wolverine.Http.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>High Performance ASP.Net Core HTTP endpoints using the Wolverine runtime</Description>

<!-- Leave this be, needing to override the Directory defaults -->
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<DebugType>portable</DebugType>
<PackageId>WolverineFx.Http</PackageId>
<LangVersion>preview</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Http/WolverineWebApi/WolverineWebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<!-- Leave this alone -->
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ await _originalHost.WaitUntilAssignmentsChangeTo(w =>

var runtime2 = host2.GetRuntime();
await host2.InvokeMessageAndWaitAsync(new CheckAgentHealth());
await runtime2.Tracker.WaitUntilAssumesLeadershipAsync(5.Seconds());
await runtime2.Tracker.WaitUntilAssumesLeadershipAsync(15.Seconds());


await host2.WaitUntilAssignmentsChangeTo(w =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ await _originalHost.WaitUntilAssignmentsChangeTo(w =>

var runtime2 = host2.GetRuntime();
await host2.InvokeMessageAndWaitAsync(new CheckAgentHealth());
await runtime2.Tracker.WaitUntilAssumesLeadershipAsync(5.Seconds());
await runtime2.Tracker.WaitUntilAssumesLeadershipAsync(15.Seconds());


await host2.WaitUntilAssignmentsChangeTo(w =>
Expand Down
2 changes: 1 addition & 1 deletion src/Persistence/PersistenceTests/PersistenceTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<LangVersion>10</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Persistence/ScheduledJobTests/ScheduledJobTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
5 changes: 0 additions & 5 deletions src/Samples/PingPong/Pinger/Pinger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
<UserSecretsId>dotnet-Pinger-819CA4EE-78C2-4B8C-93A5-0F271BCB1705</UserSecretsId>
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Wolverine\Wolverine.csproj"/>
<ProjectReference Include="..\Messages\Messages.csproj"/>
Expand Down
4 changes: 0 additions & 4 deletions src/Samples/PingPongWithRabbitMq/Ponger/Ponger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Transports\RabbitMQ\Wolverine.RabbitMQ\Wolverine.RabbitMQ.csproj" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Testing/CoreTests/CoreTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.3.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.6.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.2" PrivateAssets="All" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>

<RootNamespace>Jasper.Pulsar.Tests</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<IsPackable>false</IsPackable>

Expand Down
46 changes: 30 additions & 16 deletions src/Wolverine/Wolverine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,41 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FastExpressionCompiler" Version="3.3.4" />
<PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageReference Include="FastExpressionCompiler" Version="4.0.0" />
<PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="12.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="[6.0.0,8.0.0)" />

<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="[6.0.0,8.0.0)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="[6.0.0,8.0.0)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="[6.0.0,8.0.0)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="[6.0.0,8.0.0)" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="[6.0.0,8.0.0)" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="[6.0.0,8.0.0)" />
<PackageReference Include="Oakton" Version="6.0.2" />

<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="[6.0.0,8.0.0)" />
<PackageReference Include="Oakton" Version="6.1.0" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />
<PackageReference Include="System.ComponentModel" Version="4.3.0" />
<PackageReference Include="JasperFx.CodeGeneration.Commands" Version="3.2.0" />
<PackageReference Include="JasperFx.RuntimeCompiler" Version="3.2.0" />
<PackageReference Include="JasperFx.Core" Version="1.4.3" />
<PackageReference Include="JasperFx.CodeGeneration.Commands" Version="3.4.0" />
<PackageReference Include="JasperFx.RuntimeCompiler" Version="3.4.0" />
<PackageReference Include="JasperFx.Core" Version="1.5.1" />
</ItemGroup>

<Import Project="../../Analysis.Build.props" />

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="[8.0.0,9.0.0)" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="[8.0.0,9.0.0)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="[8.0.0,9.0.0)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="[8.0.0,9.0.0)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="[8.0.0,9.0.0)" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="[8.0.0,9.0.0)" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="[8.0.0,9.0.0)" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="[8.0.0,9.0.0)" />
</ItemGroup>


<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="[6.0.0,9.0.0)" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="[6.0.0,9.0.0)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="[6.0.0,9.0.0)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="[6.0.0,9.0.0)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="[6.0.0,9.0.0)" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="[6.0.0,9.0.0)" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="[6.0.0,9.0.0)" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="[6.0.0,9.0.0)" />
</ItemGroup>

</Project>

0 comments on commit f28686a

Please sign in to comment.