Skip to content

Commit

Permalink
[xma] Updated Xamarin.Messaging to 3.0.13 (#21767)
Browse files Browse the repository at this point in the history
Xamarin.Messaging major version 3 means the replacement of the
underlying MQTT library used for message communication. We've replaced
the System.Net.Mqtt with MQTTnet (repo under the dotnet org). More
details here: xamarin/Xamarin.Messaging#818

For this reason, we also need to remove any System.Net.Mqtt reference
from signing lists or ILMerge, and add MQTTnet instead.

This PR also removes the System.Security.Cryptography.ProtectedData
runtime implementation handling, since the new version used by Messaging
(8.0.0) doesn't include a specific Windows runtime implementation, so we
don't need to do this extra MSBuild handling to reference the right
assemblies anymore
  • Loading branch information
mauroa authored Dec 19, 2024
1 parent c06fba6 commit aa3ac14
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 16 deletions.
3 changes: 1 addition & 2 deletions dotnet/Workloads/SignList.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
<Skip Include="tools\msbuild\iOS\ws2_32.dll" />
<!-- Broker.zip -->
<Skip Include="Broker\Newtonsoft.Json.dll" />
<Skip Include="Broker\System.Net.Mqtt.dll" />
<Skip Include="Broker\System.Net.Mqtt.Server.dll" />
<Skip Include="Broker\MQTTnet.dll" />
<Skip Include="Broker\System.Reactive.dll" />
<Skip Include="Broker\System.Runtime.CompilerServices.Unsafe.dll" />
<Skip Include="Broker\System.Security.Cryptography.ProtectedData.dll" />
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
https://dev.azure.com/azure-public/vside/_artifacts/feed/xamarin-impl/NuGet/Xamarin.Messaging.Client/
-->
<MessagingVersion Condition="'$(MessagingVersion)' == ''">[2.2.10]</MessagingVersion>
<MessagingVersion Condition="'$(MessagingVersion)' == ''">[3.0.13]</MessagingVersion>
<HotRestartVersion>[1.1.7]</HotRestartVersion>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)../Directory.Build.props" />
Expand Down
3 changes: 1 addition & 2 deletions msbuild/ILMerge.targets
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.ComponentModel.Annotations'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.ComponentModel.Composition'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Diagnostics.Tracer'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Net.Mqtt'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Net.Mqtt.Server'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'MQTTnet'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Reactive'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Security.Cryptography.ProtectedData'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Text.Encoding.CodePages'" />
Expand Down
4 changes: 0 additions & 4 deletions msbuild/Messaging/Xamarin.Messaging.Build/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Mqtt" publicKeyToken="ac60ebe5a5220e27" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.2.274.0" newVersion="0.2.274.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
1 change: 1 addition & 0 deletions msbuild/Xamarin.MacDev.Tasks/MsBuildTasks/Exec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Xamarin.Messaging.Build.Client;
using System.Security;
using System.Reactive.Linq;
using Xamarin.Messaging.Ssh;

// Disable until we get around to enable + fix any issues.
#nullable disable
Expand Down
8 changes: 1 addition & 7 deletions msbuild/Xamarin.MacDev.Tasks/Xamarin.MacDev.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,15 @@

<Import Project="$(MSBuildThisFileDirectory)..\ILMerge.targets" />

<!-- Replaces the ProtectedData assembly by the runtime implementation -->
<Target Name="CopyRuntimeAssemblies" BeforeTargets="ILRepack">
<ItemGroup>
<ReferenceCopyLocalToRemove Include="@(ReferenceCopyLocalPaths)" Condition="'%(FileName)' == 'System.Text.Encoding.CodePages'" />
<ReferenceCopyLocalToRemove Include="@(ReferenceCopyLocalPaths)" Condition="'%(FileName)' == 'System.Security.Cryptography.ProtectedData'" />

<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalToRemove)" />

<ReferencePathToRemove Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Text.Encoding.CodePages'" />
<ReferencePathToRemove Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Security.Cryptography.ProtectedData'" />

<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalToRemove)" />
<ReferencePath Remove="@(ReferencePathToRemove)" />

<ReferencePathToAdd Include="@(RuntimeTargetsCopyLocalItems)" Condition="'%(RuntimeIdentifier)' == 'win' And '%(FileName)' == 'System.Text.Encoding.CodePages'" />
<ReferencePathToAdd Include="@(RuntimeTargetsCopyLocalItems)" Condition="'%(RuntimeIdentifier)' == 'win' And '%(FileName)' == 'System.Security.Cryptography.ProtectedData'" />

<ReferencePath Include="@(ReferencePathToAdd)">
<DestinationSubDirectory />
Expand Down

10 comments on commit aa3ac14

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.