Skip to content

Commit

Permalink
Merge pull request #1349 from justeattakeaway/hwoodiwiss-net-8-tfm
Browse files Browse the repository at this point in the history
Add .NET 8 TFM
  • Loading branch information
slang25 authored Feb 19, 2024
2 parents 6cbbd0d + 04ac779 commit e8aa7e3
Show file tree
Hide file tree
Showing 21 changed files with 825 additions and 19 deletions.
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="1.1.0" Condition=" '$(TargetFramework)' == 'net461' " />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" Condition=" '$(TargetFramework)' == 'netstandard2.0' " />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" Condition=" '$(TargetFramework)' == 'net8.0' " />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
<PackageVersion Include="StructureMap" Version="4.6.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<IsShipping>true</IsShipping>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSayingWithAwsConfig(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfiguration configuration, System.Action<JustSaying.MessagingBusBuilder, System.IServiceProvider> builderConfig) -> void
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSayingWithAwsConfig(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfiguration configuration, System.Action<JustSaying.MessagingBusBuilder> builderConfig) -> void
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsShipping>true</IsShipping>
<RootNamespace>Microsoft.Extensions.DependencyInjection</RootNamespace>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\JustSaying\JustSaying.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSaying(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSaying(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string region) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSaying(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<JustSaying.MessagingBusBuilder, System.IServiceProvider> configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSaying(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<JustSaying.MessagingBusBuilder> configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSayingHandler<TMessage, THandler>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSayingHandlers<TMessage>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Collections.Generic.IEnumerable<JustSaying.Messaging.MessageHandling.IHandlerAsync<TMessage>> handlers) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.ConfigureJustSaying(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<JustSaying.MessagingBusBuilder> configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<RootNamespace>StructureMap</RootNamespace>
<!-- StructureMap is not strong-named, so this assembly also cannot be -->
<SignAssembly>false</SignAssembly>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\JustSaying\JustSaying.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
static StructureMap.ConfigurationExpressionExtensions.AddJustSaying(this StructureMap.ConfigurationExpression registry) -> void
static StructureMap.ConfigurationExpressionExtensions.AddJustSaying(this StructureMap.ConfigurationExpression registry, string region) -> void
static StructureMap.ConfigurationExpressionExtensions.AddJustSaying(this StructureMap.ConfigurationExpression registry, System.Action<JustSaying.MessagingBusBuilder, StructureMap.IContext> configure) -> void
static StructureMap.ConfigurationExpressionExtensions.AddJustSaying(this StructureMap.ConfigurationExpression registry, System.Action<JustSaying.MessagingBusBuilder> configure) -> void
static StructureMap.RegistryExtensions.AddJustSayingHandler<TMessage, THandler>(this StructureMap.Registry registry) -> void
StructureMap.ConfigurationExpressionExtensions
StructureMap.RegistryExtensions
2 changes: 1 addition & 1 deletion src/JustSaying.Models/JustSaying.Models.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsShipping>true</IsShipping>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Using Remove="System.Net.Http" />
Expand Down
15 changes: 15 additions & 0 deletions src/JustSaying.Models/PublicAPI/net8.0/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
JustSaying.Models.Message
JustSaying.Models.Message.Conversation.get -> string
JustSaying.Models.Message.Conversation.set -> void
JustSaying.Models.Message.Id.get -> System.Guid
JustSaying.Models.Message.Id.set -> void
JustSaying.Models.Message.Message() -> void
JustSaying.Models.Message.RaisingComponent.get -> string
JustSaying.Models.Message.RaisingComponent.set -> void
JustSaying.Models.Message.SourceIp.get -> string
JustSaying.Models.Message.Tenant.get -> string
JustSaying.Models.Message.Tenant.set -> void
JustSaying.Models.Message.TimeStamp.get -> System.DateTime
JustSaying.Models.Message.TimeStamp.set -> void
JustSaying.Models.Message.Version.get -> string
virtual JustSaying.Models.Message.UniqueKey() -> string
Empty file.
8 changes: 7 additions & 1 deletion src/JustSaying/AwsTools/MessageHandling/PublishException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

namespace JustSaying.AwsTools.MessageHandling;

#if !NET8_0_OR_GREATER
[Serializable]
#endif
public class PublishException : Exception
{
public PublishException() : base("Failed to publish message")
Expand All @@ -17,7 +21,9 @@ public PublishException(string message, Exception inner) : base(message, inner)
{
}

#if !NET8_0_OR_GREATER
protected PublishException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

namespace JustSaying.AwsTools.QueueCreation;

#if !NET8_0_OR_GREATER
[Serializable]
#endif
public class ConfigurationErrorsException : Exception
{
public ConfigurationErrorsException() : base("Invalid configuration")
Expand All @@ -17,7 +21,9 @@ public ConfigurationErrorsException(string message, Exception inner) : base(mess
{
}

#if !NET8_0_OR_GREATER
protected ConfigurationErrorsException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
#endif
}
6 changes: 6 additions & 0 deletions src/JustSaying/HandlerNotRegisteredWithContainerException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

namespace JustSaying;

#if !NET8_0_OR_GREATER
[Serializable]
#endif
public class HandlerNotRegisteredWithContainerException : Exception
{
public HandlerNotRegisteredWithContainerException() : base("Handler not registered with container")
Expand All @@ -17,7 +21,9 @@ public HandlerNotRegisteredWithContainerException(string message, Exception inne
{
}

#if !NET8_0_OR_GREATER
protected HandlerNotRegisteredWithContainerException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
#endif
}
2 changes: 1 addition & 1 deletion src/JustSaying/JustSaying.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsShipping>true</IsShipping>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\JustSaying.Models\JustSaying.Models.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

namespace JustSaying.Messaging.MessageSerialization;

#if !NET8_0_OR_GREATER
[Serializable]
#endif
public class MessageFormatNotSupportedException : Exception
{
public MessageFormatNotSupportedException() : base("Message format not supported")
Expand All @@ -17,7 +21,9 @@ public MessageFormatNotSupportedException(string message, Exception innerExcepti
{
}

#if !NET8_0_OR_GREATER
protected MessageFormatNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ namespace JustSaying.Messaging.MessageSerialization;
/// </summary>
public class SystemTextJsonSerializer : IMessageSerializer
{
private static readonly JsonSerializerOptions DefaultJsonSerializerOptions = new()
{
#if NET8_0_OR_GREATER
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
#else
IgnoreNullValues = true,
#endif
Converters =
{
new JsonStringEnumConverter(),
},
};

private readonly JsonSerializerOptions _options;

/// <summary>
Expand All @@ -26,17 +39,7 @@ public SystemTextJsonSerializer()
/// <param name="options">The optional <see cref="JsonSerializerOptions"/> to use.</param>
public SystemTextJsonSerializer(JsonSerializerOptions options)
{
if (options == null)
{
options = new JsonSerializerOptions
{
IgnoreNullValues = true
};

options.Converters.Add(new JsonStringEnumConverter());
}

_options = options;
_options = options ?? DefaultJsonSerializerOptions;
}

/// <inheritdoc />
Expand Down
Loading

0 comments on commit e8aa7e3

Please sign in to comment.