Bläddra i källkod

Move managed client to separate nuget.

release/3.x.x
Christian Kratky 6 år sedan
förälder
incheckning
b05cb0d2ea
19 ändrade filer med 156 tillägg och 31 borttagningar
  1. +3
    -3
      Build/MQTTnet.AspNetCore.nuspec
  2. +53
    -0
      Build/MQTTnet.Extensions.ManagedClient.nuspec
  3. +11
    -11
      Build/MQTTnet.Extensions.Rpc.nuspec
  4. +4
    -1
      Build/MQTTnet.nuspec
  5. +9
    -1
      Build/build.ps1
  6. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ApplicationMessageProcessedEventArgs.cs
  7. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/IManagedMqttClient.cs
  8. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/IManagedMqttClientOptions.cs
  9. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/IManagedMqttClientStorage.cs
  10. +31
    -0
      Extensions/MQTTnet.Extensions.ManagedClient/MQTTnet.Extensions.ManagedClient.csproj
  11. +11
    -0
      Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttApplicationMessage.cs
  12. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs
  13. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientExtensions.cs
  14. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientOptions.cs
  15. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientOptionsBuilder.cs
  16. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientStorageManager.cs
  17. +24
    -0
      Extensions/MQTTnet.Extensions.ManagedClient/MqttFactoryExtensions.cs
  18. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ReconnectionResult.cs
  19. +0
    -5
      Frameworks/MQTTnet.NetStandard/Client/IMqttClientFactory.cs

+ 3
- 3
Build/MQTTnet.AspNetCore.nuspec Visa fil

@@ -2,7 +2,7 @@
<package >
<metadata>
<id>MQTTnet.AspNetCore</id>
<version>2.7.5</version>
<version>0.0.0</version>
<authors>Christian Kratky</authors>
<owners>Christian Kratky</owners>
<licenseUrl>https://github.com/chkr1011/MQTTnet/blob/master/LICENSE</licenseUrl>
@@ -10,13 +10,13 @@
<iconUrl>https://raw.githubusercontent.com/chkr1011/MQTTnet/master/Images/Logo_128x128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is a support library to integrate MQTTnet into AspNetCore.</description>
<releaseNotes>* Updated to MQTTnet 2.7.5.
<releaseNotes>* Updated to MQTTnet 2.8.0.
</releaseNotes>
<copyright>Copyright Christian Kratky 2016-2018</copyright>
<tags>MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M ESP Smart Home Cities Automation Xamarin</tags>
<dependencies>
<group targetFramework="netstandard2.0">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
</dependencies>
</metadata>


+ 53
- 0
Build/MQTTnet.Extensions.ManagedClient.nuspec Visa fil

@@ -0,0 +1,53 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>MQTTnet.Extensions.ManagedClient</id>
<version>0.0.0</version>
<authors>Christian Kratky</authors>
<owners>Christian Kratky</owners>
<licenseUrl>https://github.com/chkr1011/MQTTnet/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/chkr1011/MQTTnet</projectUrl>
<iconUrl>https://raw.githubusercontent.com/chkr1011/MQTTnet/master/Images/Logo_128x128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is an extension library which provides a managed MQTT client with additional features using MQTTnet.</description>
<releaseNotes>* Updated to MQTTnet 2.8.0.
</releaseNotes>
<copyright>Copyright Christian Kratky 2016-2018</copyright>
<tags>MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M ESP Smart Home Cities Automation Xamarin</tags>
<dependencies>
<group targetFramework="netstandard2.0">
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="netstandard1.3">
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="uap10.0">
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="net452">
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="net461">
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
</dependencies>
</metadata>

<files>
<!-- .NET Standard 1.3 -->
<file src="..\Extensions\MQTTnet.Extensions.ManagedClient\bin\Release\netstandard1.3\MQTTnet.Extensions.ManagedClient.*" target="lib\netstandard1.3\"/>

<!-- .NET Standard 2.0 -->
<file src="..\Extensions\MQTTnet.Extensions.ManagedClient\bin\Release\netstandard2.0\MQTTnet.Extensions.ManagedClient.*" target="lib\netstandard2.0\"/>

<!-- Universal Windows -->
<file src="..\Extensions\MQTTnet.Extensions.ManagedClient\bin\Release\uap10.0\MQTTnet.Extensions.ManagedClient.*" target="lib\uap10.0\"/>

<!-- .NET Framework -->
<file src="..\Extensions\MQTTnet.Extensions.ManagedClient\bin\Release\net452\MQTTnet.Extensions.ManagedClient.*" target="lib\net452\"/>
<file src="..\Extensions\MQTTnet.Extensions.ManagedClient\bin\Release\net461\MQTTnet.Extensions.ManagedClient.*" target="lib\net461\"/>
</files>
</package>

+ 11
- 11
Build/MQTTnet.Extensions.Rpc.nuspec Visa fil

@@ -2,46 +2,46 @@
<package >
<metadata>
<id>MQTTnet.Extensions.Rpc</id>
<version>2.7.5</version>
<version>0.0.0</version>
<authors>Christian Kratky</authors>
<owners>Christian Kratky</owners>
<licenseUrl>https://github.com/chkr1011/MQTTnet/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/chkr1011/MQTTnet</projectUrl>
<iconUrl>https://raw.githubusercontent.com/chkr1011/MQTTnet/master/Images/Logo_128x128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is a extension library which allows executing synchronous device calls including a response using MQTTnet.</description>
<releaseNotes>* Updated to MQTTnet 2.7.5.
<description>This is an extension library which allows executing synchronous device calls including a response using MQTTnet.</description>
<releaseNotes>* Updated to MQTTnet 2.8.0.
</releaseNotes>
<copyright>Copyright Christian Kratky 2016-2018</copyright>
<tags>MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M ESP Smart Home Cities Automation Xamarin</tags>
<dependencies>
<group targetFramework="netstandard2.0">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="netstandard1.3">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="uap10.0">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="net452">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="net461">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
</dependencies>
</metadata>

<files>
<!-- .NET Standard 1.3 -->
<file src="..\Extensions\MQTTnet.Extensions.Rpc\bin\Release\MQTTnet.Extensions.Rpc.*" target="lib\netstandard1.3\"/>
<file src="..\Extensions\MQTTnet.Extensions.Rpc\bin\Release\netstandard1.3\MQTTnet.Extensions.Rpc.*" target="lib\netstandard1.3\"/>

<!-- .NET Standard 2.0 -->
<file src="..\Extensions\MQTTnet.Extensions.Rpc\bin\Release\MQTTnet.Extensions.Rpc.*" target="lib\netstandard2.0\"/>
<file src="..\Extensions\MQTTnet.Extensions.Rpc\bin\Release\netstandard2.0\MQTTnet.Extensions.Rpc.*" target="lib\netstandard2.0\"/>

<!-- Universal Windows -->
<file src="..\Extensions\MQTTnet.Extensions.Rpc\bin\Release\uap10.0\MQTTnet.Extensions.Rpc.*" target="lib\uap10.0\"/>


+ 4
- 1
Build/MQTTnet.nuspec Visa fil

@@ -2,7 +2,7 @@
<package >
<metadata>
<id>MQTTnet</id>
<version>2.8.0</version>
<version>0.0.0</version>
<authors>Christian Kratky</authors>
<owners>Christian Kratky</owners>
<licenseUrl>https://github.com/chkr1011/MQTTnet/blob/master/LICENSE</licenseUrl>
@@ -17,6 +17,9 @@
* [Core] The adapter now has an _Endpoint_ definition as string containing remote IP and port.
* [Client] Received messages are now processed completely in the worker thread without creating new Tasks.
* [Client] Fixed wrong calculation for sending keep alive packets (thanks to @cstichlberger)
* [Client] A clean disconnect (via DisconnectAsync) will no longer throw an exception.
* [ManagedClient] The managed client is moved to a separate nuget package.
* [ManagedClient] Added an own message format with extended properties like ID.
* [ManagedClient] Fixed a loading issue of stored application messages (thanks to @JTrotta).
* [Server] Added support for other WebSocket sub protocol formats like mqttv-3.1.1 (thanks to @israellot).
* [Server] The takeover of an existing client sessions is now treated as a _clean_ disconnect of the previous client.


+ 9
- 1
Build/build.ps1 Visa fil

@@ -26,10 +26,18 @@ if ($path) {
&$msbuild ..\Extensions\MQTTnet.Extensions.Rpc\MQTTnet.Extensions.Rpc.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard2.0" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Extensions\MQTTnet.Extensions.Rpc\MQTTnet.Extensions.Rpc.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="uap10.0" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"

Remove-Item .\NuGet -Force -Recurse -ErrorAction SilentlyContinue
# Build the Managed Client extension
&$msbuild ..\Extensions\MQTTnet.Extensions.ManagedClient\MQTTnet.Extensions.ManagedClient.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="net452" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Extensions\MQTTnet.Extensions.ManagedClient\MQTTnet.Extensions.ManagedClient.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="net461" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Extensions\MQTTnet.Extensions.ManagedClient\MQTTnet.Extensions.ManagedClient.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard1.3" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Extensions\MQTTnet.Extensions.ManagedClient\MQTTnet.Extensions.ManagedClient.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard2.0" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Extensions\MQTTnet.Extensions.ManagedClient\MQTTnet.Extensions.ManagedClient.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="uap10.0" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"

Remove-Item .\NuGet -Force -Recurse -ErrorAction SilentlyContinue

New-Item -ItemType Directory -Force -Path .\NuGet
.\NuGet.exe pack MQTTnet.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $nugetVersion
.\NuGet.exe pack MQTTnet.AspNetCore.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $nugetVersion
.\NuGet.exe pack MQTTnet.Extensions.Rpc.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $nugetVersion
.\NuGet.exe pack MQTTnet.Extensions.ManagedClient.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $nugetVersion
}

Frameworks/MQTTnet.NetStandard/ManagedClient/ApplicationMessageProcessedEventArgs.cs → Extensions/MQTTnet.Extensions.ManagedClient/ApplicationMessageProcessedEventArgs.cs Visa fil

@@ -1,6 +1,6 @@
using System;

namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{
public class ApplicationMessageProcessedEventArgs : EventArgs
{

Frameworks/MQTTnet.NetStandard/ManagedClient/IManagedMqttClient.cs → Extensions/MQTTnet.Extensions.ManagedClient/IManagedMqttClient.cs Visa fil

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using MQTTnet.Client;

namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{
public interface IManagedMqttClient : IApplicationMessageReceiver, IApplicationMessagePublisher, IDisposable
{

Frameworks/MQTTnet.NetStandard/ManagedClient/IManagedMqttClientOptions.cs → Extensions/MQTTnet.Extensions.ManagedClient/IManagedMqttClientOptions.cs Visa fil

@@ -1,7 +1,7 @@
using System;
using MQTTnet.Client;

namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{
public interface IManagedMqttClientOptions
{

Frameworks/MQTTnet.NetStandard/ManagedClient/IManagedMqttClientStorage.cs → Extensions/MQTTnet.Extensions.ManagedClient/IManagedMqttClientStorage.cs Visa fil

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;

namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{
public interface IManagedMqttClientStorage
{

+ 31
- 0
Extensions/MQTTnet.Extensions.ManagedClient/MQTTnet.Extensions.ManagedClient.csproj Visa fil

@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.3;netstandard2.0;net452;net461;uap10.0</TargetFrameworks>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<FileVersion>0.0.0.0</FileVersion>
<Product />
<Company />
<Authors />
<PackageId />
<Version>0.0.0.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<NugetTargetMoniker>UAP,Version=v10.0</NugetTargetMoniker>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.17134.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<TargetFrameworkIdentifier>.NETCore</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<DefineConstants>$(DefineConstants);WINDOWS_UWP</DefineConstants>
<DefaultLanguage>en</DefaultLanguage>
<LanguageTargets>$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets</LanguageTargets>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Frameworks\MQTTnet.NetStandard\MQTTnet.NetStandard.csproj" />
</ItemGroup>

</Project>

+ 11
- 0
Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttApplicationMessage.cs Visa fil

@@ -0,0 +1,11 @@
using System;

namespace MQTTnet.Extensions.ManagedClient
{
public class ManagedMqttApplicationMessage
{
public Guid Id { get; set; } = Guid.NewGuid();

public MqttApplicationMessage ApplicationMessage { get; set; }
}
}

Frameworks/MQTTnet.NetStandard/ManagedClient/ManagedMqttClient.cs → Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs Visa fil

@@ -10,7 +10,7 @@ using MQTTnet.Exceptions;
using MQTTnet.Internal;
using MQTTnet.Protocol;

namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{
public class ManagedMqttClient : IManagedMqttClient
{

Frameworks/MQTTnet.NetStandard/ManagedClient/ManagedMqttClientExtensions.cs → Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientExtensions.cs Visa fil

@@ -2,7 +2,7 @@
using System.Threading.Tasks;
using MQTTnet.Protocol;

namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{
public static class ManagedMqttClientExtensions
{

Frameworks/MQTTnet.NetStandard/ManagedClient/ManagedMqttClientOptions.cs → Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientOptions.cs Visa fil

@@ -1,7 +1,7 @@
using System;
using MQTTnet.Client;

namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{
public class ManagedMqttClientOptions : IManagedMqttClientOptions
{

Frameworks/MQTTnet.NetStandard/ManagedClient/ManagedMqttClientOptionsBuilder.cs → Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientOptionsBuilder.cs Visa fil

@@ -1,7 +1,7 @@
using System;
using MQTTnet.Client;

namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{
public class ManagedMqttClientOptionsBuilder
{

Frameworks/MQTTnet.NetStandard/ManagedClient/ManagedMqttClientStorageManager.cs → Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientStorageManager.cs Visa fil

@@ -4,7 +4,7 @@ using System.Threading;
using System.Threading.Tasks;
using MQTTnet.Internal;

namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{
public class ManagedMqttClientStorageManager
{

+ 24
- 0
Extensions/MQTTnet.Extensions.ManagedClient/MqttFactoryExtensions.cs Visa fil

@@ -0,0 +1,24 @@
using System;
using MQTTnet.Client;
using MQTTnet.Diagnostics;

namespace MQTTnet.Extensions.ManagedClient
{
public static class MqttFactoryExtensions
{
public static IManagedMqttClient CreateManagedMqttClient(this IMqttClientFactory factory)
{
if (factory == null) throw new ArgumentNullException(nameof(factory));

return new ManagedMqttClient(factory.CreateMqttClient(), new MqttNetLogger().CreateChildLogger());
}

public static IManagedMqttClient CreateManagedMqttClient(this IMqttClientFactory factory, IMqttNetLogger logger)
{
if (factory == null) throw new ArgumentNullException(nameof(factory));
if (logger == null) throw new ArgumentNullException(nameof(logger));

return new ManagedMqttClient(factory.CreateMqttClient(), logger.CreateChildLogger());
}
}
}

Frameworks/MQTTnet.NetStandard/ManagedClient/ReconnectionResult.cs → Extensions/MQTTnet.Extensions.ManagedClient/ReconnectionResult.cs Visa fil

@@ -1,4 +1,4 @@
namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{
public enum ReconnectionResult
{

+ 0
- 5
Frameworks/MQTTnet.NetStandard/Client/IMqttClientFactory.cs Visa fil

@@ -1,5 +1,4 @@
using MQTTnet.Diagnostics;
using MQTTnet.ManagedClient;

namespace MQTTnet.Client
{
@@ -8,9 +7,5 @@ namespace MQTTnet.Client
IMqttClient CreateMqttClient();

IMqttClient CreateMqttClient(IMqttNetLogger logger);
IManagedMqttClient CreateManagedMqttClient();

IManagedMqttClient CreateManagedMqttClient(IMqttNetLogger logger);
}
}

Laddar…
Avbryt
Spara