From bdadfa1c264f6ddf6e787a35868af4da80b97394 Mon Sep 17 00:00:00 2001 From: JanEggers Date: Sun, 12 Nov 2017 14:07:33 +0100 Subject: [PATCH] added net461 build --- Build/MQTTnet.nuspec | 9 +++++++++ Build/build.ps1 | 1 + .../Implementations/MqttServerAdapter.cs | 6 +++--- .../Implementations/MqttTcpChannel.cs | 8 ++++---- .../MQTTnet.Netstandard.csproj | 8 +++++++- .../MQTTnet.Test.NugetConsumption.csproj | 2 +- Tests/MQTTnet.Test.NugetConsumption/nuget.config | 15 --------------- 7 files changed, 25 insertions(+), 24 deletions(-) delete mode 100644 Tests/MQTTnet.Test.NugetConsumption/nuget.config diff --git a/Build/MQTTnet.nuspec b/Build/MQTTnet.nuspec index 1b01bfd..453c352 100644 --- a/Build/MQTTnet.nuspec +++ b/Build/MQTTnet.nuspec @@ -52,6 +52,12 @@ + + + + + + @@ -71,6 +77,9 @@ + + + \ No newline at end of file diff --git a/Build/build.ps1 b/Build/build.ps1 index 3efa157..1e47727 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -9,6 +9,7 @@ if ($path) { $msbuild = join-path $path 'MSBuild\15.0\Bin\MSBuild.exe' &$msbuild ..\Frameworks\MQTTnet.Netstandard\MQTTnet.Netstandard.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="net452" /p:FileVersion=$version /p:AssemblyVersion=$version /verbosity:m + &$msbuild ..\Frameworks\MQTTnet.Netstandard\MQTTnet.Netstandard.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="net461" /p:FileVersion=$version /p:AssemblyVersion=$version /verbosity:m &$msbuild ..\Frameworks\MQTTnet.Netstandard\MQTTnet.Netstandard.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard1.3" /p:FileVersion=$version /p:AssemblyVersion=$version /verbosity:m &$msbuild ..\Frameworks\MQTTnet.Netstandard\MQTTnet.Netstandard.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard2.0" /p:FileVersion=$version /p:AssemblyVersion=$version /verbosity:m &$msbuild ..\Frameworks\MQTTnet.Netstandard\MQTTnet.Netstandard.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="uap10.0" /p:FileVersion=$version /p:AssemblyVersion=$version /verbosity:m diff --git a/Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.cs b/Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.cs index a6e6251..e3f048d 100644 --- a/Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.cs +++ b/Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.cs @@ -1,4 +1,4 @@ -#if NET452 || NETSTANDARD1_3 || NETSTANDARD2_0 +#if NET452 || NET461 || NETSTANDARD1_3 || NETSTANDARD2_0 using System; using System.Net; using System.Net.Security; @@ -98,7 +98,7 @@ namespace MQTTnet.Implementations try { //todo: else branch can be used with min dependency NET46 -#if NET452 +#if NET452 || NET461 var clientSocket = await Task.Factory.FromAsync(_defaultEndpointSocket.BeginAccept, _defaultEndpointSocket.EndAccept, null).ConfigureAwait(false); #else var clientSocket = await _defaultEndpointSocket.AcceptAsync().ConfigureAwait(false); @@ -122,7 +122,7 @@ namespace MQTTnet.Implementations { try { -#if NET452 +#if NET452 || NET461 var clientSocket = await Task.Factory.FromAsync(_tlsEndpointSocket.BeginAccept, _tlsEndpointSocket.EndAccept, null).ConfigureAwait(false); #else var clientSocket = await _tlsEndpointSocket.AcceptAsync().ConfigureAwait(false); diff --git a/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs b/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs index 2bf418b..a7e4026 100644 --- a/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs +++ b/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs @@ -1,4 +1,4 @@ -#if NET452 || NETSTANDARD1_3 || NETSTANDARD2_0 +#if NET452 || NET461 || NETSTANDARD1_3 || NETSTANDARD2_0 using System; using System.Net.Security; using System.Net.Sockets; @@ -17,7 +17,7 @@ namespace MQTTnet.Implementations private readonly MqttClientTcpOptions _options; //todo: this can be used with min dependency NetStandard1.6 -#if NET452 +#if NET452 || NET461 // ReSharper disable once MemberCanBePrivate.Global // ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global public static int BufferSize { get; set; } = 4096 * 20; // Can be changed for fine tuning by library user. @@ -59,7 +59,7 @@ namespace MQTTnet.Implementations } //todo: else brach can be used with min dependency NET46 -#if NET452 +#if NET452 || NET461 await Task.Factory.FromAsync(_socket.BeginConnect, _socket.EndConnect, _options.Server, _options.GetPort(), null).ConfigureAwait(false); #else await _socket.ConnectAsync(_options.Server, _options.GetPort()).ConfigureAwait(false); @@ -144,7 +144,7 @@ namespace MQTTnet.Implementations //need two streams otherwise read and write have to be synchronized //todo: if branch can be used with min dependency NetStandard1.6 -#if NET452 +#if NET452 || NET461 SendStream = new BufferedStream(stream, BufferSize); ReceiveStream = new BufferedStream(stream, BufferSize); #else diff --git a/Frameworks/MQTTnet.NetStandard/MQTTnet.Netstandard.csproj b/Frameworks/MQTTnet.NetStandard/MQTTnet.Netstandard.csproj index 19d1ce0..41c30d3 100644 --- a/Frameworks/MQTTnet.NetStandard/MQTTnet.Netstandard.csproj +++ b/Frameworks/MQTTnet.NetStandard/MQTTnet.Netstandard.csproj @@ -1,7 +1,7 @@  - netstandard1.3;netstandard2.0;net452;uap10.0 + netstandard1.3;netstandard2.0;net452;net461;uap10.0 MQTTnet MQTTnet 2.5.0.0 @@ -68,4 +68,10 @@ + + + + + + \ No newline at end of file diff --git a/Tests/MQTTnet.Test.NugetConsumption/MQTTnet.Test.NugetConsumption.csproj b/Tests/MQTTnet.Test.NugetConsumption/MQTTnet.Test.NugetConsumption.csproj index 3844ef8..5368005 100644 --- a/Tests/MQTTnet.Test.NugetConsumption/MQTTnet.Test.NugetConsumption.csproj +++ b/Tests/MQTTnet.Test.NugetConsumption/MQTTnet.Test.NugetConsumption.csproj @@ -6,7 +6,7 @@ - + diff --git a/Tests/MQTTnet.Test.NugetConsumption/nuget.config b/Tests/MQTTnet.Test.NugetConsumption/nuget.config deleted file mode 100644 index 65d399f..0000000 --- a/Tests/MQTTnet.Test.NugetConsumption/nuget.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - \ No newline at end of file