Skip to content

Commit 65b1a32

Browse files
authored
Merge pull request #1047 from CommunityToolkit/dev/update-deps
Update NuGet packages and Windows SDK props
2 parents 3541038 + 5f2f817 commit 65b1a32

File tree

26 files changed

+72
-62
lines changed

26 files changed

+72
-62
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</Choose>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.146" PrivateAssets="All" />
28+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.9.50" PrivateAssets="All" IsImplicitlyReferenced="true" />
2929
</ItemGroup>
3030

3131
<Choose>

src/CommunityToolkit.Diagnostics/CommunityToolkit.Diagnostics.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
<!-- .NET Standard 2.0 doesn't have the Span<T> type -->
2020
<When Condition="'$(TargetFramework)' == 'netstandard2.0'">
2121
<ItemGroup>
22-
<PackageReference Include="System.Memory" Version="4.6.0" />
22+
<PackageReference Include="System.Memory" Version="4.6.3" />
2323
</ItemGroup>
2424
</When>
2525

2626
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
2727
<When Condition="'$(TargetFramework)' == 'netstandard2.1'">
2828
<ItemGroup>
29-
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
29+
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
3030
</ItemGroup>
3131
</When>
3232
</Choose>

src/CommunityToolkit.HighPerformance/Buffers/StringPool.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ public FixedSizePriorityMap(int capacity)
376376
/// <summary>
377377
/// Gets an <see cref="object"/> that can be used to synchronize access to the current instance.
378378
/// </summary>
379-
public object SyncRoot
379+
public readonly object SyncRoot
380380
{
381381
[MethodImpl(MethodImplOptions.AggressiveInlining)]
382382
get => this.buckets;
@@ -749,7 +749,7 @@ private void UpdateTimestamp(ref int heapIndex)
749749
/// a given number of nodes, those are all contiguous from the start of the array.
750750
/// </summary>
751751
[MethodImpl(MethodImplOptions.NoInlining)]
752-
private void UpdateAllTimestamps()
752+
private readonly void UpdateAllTimestamps()
753753
{
754754
int count = this.count;
755755
ref HeapEntry heapEntriesRef = ref this.heapEntries.DangerousGetReference();

src/CommunityToolkit.HighPerformance/CommunityToolkit.HighPerformance.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
<!-- .NET Standard 2.0 doesn't have the Span<T>, HashCode and ValueTask types -->
3232
<ItemGroup>
3333
<PackageReference Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
34-
<PackageReference Include="System.Memory" Version="4.6.0" />
35-
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.0" />
36-
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
34+
<PackageReference Include="System.Memory" Version="4.6.3" />
35+
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
36+
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
3737
</ItemGroup>
3838

3939
<!-- On .NET Standard 2.0, the unit test project also needs access to internals -->
@@ -45,7 +45,7 @@
4545
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
4646
<When Condition="'$(TargetFramework)' == 'netstandard2.1'">
4747
<ItemGroup>
48-
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
48+
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
4949
</ItemGroup>
5050
</When>
5151
</Choose>

src/CommunityToolkit.Mvvm.SourceGenerators/Helpers/HashCode.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private void Add(int value)
134134
/// Gets the resulting hashcode from the current instance.
135135
/// </summary>
136136
/// <returns>The resulting hashcode from the current instance.</returns>
137-
public int ToHashCode()
137+
public readonly int ToHashCode()
138138
{
139139
uint length = this.length;
140140
uint position = length % 4;
@@ -165,12 +165,12 @@ public int ToHashCode()
165165
/// <inheritdoc/>
166166
[Obsolete("HashCode is a mutable struct and should not be compared with other HashCodes. Use ToHashCode to retrieve the computed hash code.", error: true)]
167167
[EditorBrowsable(EditorBrowsableState.Never)]
168-
public override int GetHashCode() => throw new NotSupportedException();
168+
public override readonly int GetHashCode() => throw new NotSupportedException();
169169

170170
/// <inheritdoc/>
171171
[Obsolete("HashCode is a mutable struct and should not be compared with other HashCodes.", error: true)]
172172
[EditorBrowsable(EditorBrowsableState.Never)]
173-
public override bool Equals(object? obj) => throw new NotSupportedException();
173+
public override readonly bool Equals(object? obj) => throw new NotSupportedException();
174174

175175
/// <summary>
176176
/// Rotates the specified value left by the specified number of bits.

src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.WindowsSdk.targets

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
- The recommended Windows SDK package for UWP projects using the .NET 9 SDK (with UWP XAML projections).
2828
- The recommended Windows SDK package for WindowsAppSDK projects (ie. without UWP XAML projections).
2929
-->
30-
<_MvvmToolkitWindowsSdkPackageMinBuild>38</_MvvmToolkitWindowsSdkPackageMinBuild>
31-
<_MvvmToolkitWindowsSdkPackageRecommendedUwpBuild>54</_MvvmToolkitWindowsSdkPackageRecommendedUwpBuild>
32-
<_MvvmToolkitWindowsSdkPackageRecommendedWindowsAppSDKBuild>53</_MvvmToolkitWindowsSdkPackageRecommendedWindowsAppSDKBuild>
30+
<_MvvmToolkitWindowsSdkPackageMinBuild>56</_MvvmToolkitWindowsSdkPackageMinBuild>
31+
<_MvvmToolkitWindowsSdkPackageRecommendedUwpBuild>57</_MvvmToolkitWindowsSdkPackageRecommendedUwpBuild>
32+
<_MvvmToolkitWindowsSdkPackageRecommendedWindowsAppSDKBuild>56</_MvvmToolkitWindowsSdkPackageRecommendedWindowsAppSDKBuild>
3333

3434
<!-- Switch on the recommended one based on configuration -->
3535
<_MvvmToolkitWindowsSdkPackageRecommendedBuild>$(_MvvmToolkitWindowsSdkPackageMinBuild)</_MvvmToolkitWindowsSdkPackageRecommendedBuild>
@@ -82,7 +82,7 @@
8282
Condition="'@(_MvvmToolkitCompatibleWindowsSdkPackages)' == ''"
8383
Code="MVVMTKCFG0003"
8484
HelpLink="https://aka.ms/mvvmtoolkit/errors/mvvmtkcfg0003"
85-
Text="This version of the MVVM Toolkit requires 'Microsoft.Windows.SDK.NET.Ref' version '$(_MvvmToolkitWindowsSdkPackageRequired)' or later. Please update to .NET SDK 8.0.109, 8.0.305 or 8.0.402 (or later). Alternatively, use a temporary 'Microsoft.Windows.SDK.NET.Ref' reference, which can be done by setting the 'WindowsSdkPackageVersion' property in your .csproj file. For your project configuration, it is recommended to set the package version to '$(_MvvmToolkitWindowsSdkPackageRecommended)'." />
85+
Text="This version of the MVVM Toolkit requires 'Microsoft.Windows.SDK.NET.Ref' version '$(_MvvmToolkitWindowsSdkPackageRequired)' or later. Please update the .NET SDK in use to 8.0.405 (or later) or 9.0.102 (or later). Alternatively, use a temporary 'Microsoft.Windows.SDK.NET.Ref' reference, which can be done by setting the 'WindowsSdkPackageVersion' property in your .csproj file. For your project configuration, it is recommended to set the package version to '$(_MvvmToolkitWindowsSdkPackageRecommended)'." />
8686
</Target>
8787

8888
</Project>

src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
because we need the source generators in CsWinRT to generate the supporting interop code for AOT).
1010
-->
1111
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0-windows10.0.17763.0'))">
12-
<WindowsSdkPackageVersion>10.0.17763.53</WindowsSdkPackageVersion>
12+
<WindowsSdkPackageVersion>10.0.17763.56</WindowsSdkPackageVersion>
1313

1414
<!--
1515
We're only referencing CsWinRT for the source generators, we don't need to read any WinRT metadata.
@@ -42,16 +42,16 @@
4242

4343
<!-- .NET Standard 2.0 doesn't have the Span<T> and IAsyncEnumerable<T> types -->
4444
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
45-
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
45+
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.10" />
4646
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
47-
<PackageReference Include="System.Memory" Version="4.6.0" />
48-
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
47+
<PackageReference Include="System.Memory" Version="4.6.3" />
48+
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
4949
</ItemGroup>
5050

5151
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
5252
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
5353
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
54-
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
54+
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
5555
</ItemGroup>
5656

5757
<!-- Include the ILLink file (to properly trim configuration switches in publish builds) -->
@@ -61,7 +61,7 @@
6161

6262
<!-- Reference CsWinRT when targeting Windows, to get the latest source generators -->
6363
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0-windows10.0.17763.0'))">
64-
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" PrivateAssets="all" />
64+
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.2.0" PrivateAssets="all" />
6565
</ItemGroup>
6666

6767
<!-- Reference the various multi-targeted versions of the source generator project (one per Roslyn version), and the code fixer -->

src/CommunityToolkit.Mvvm/Messaging/IMessengerExtensions.Observables.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
7-
// This file has two types which implement interfaces that can be projected to WInRT, ie.
8-
// 'Observable<TMessage>.Recipient' and 'Observable<TMessage, TToken>.Recipient', which
9-
// implement 'IDisposable' (which is projected to 'IClosable'). These types are not meant
10-
// to be used in interop scenarios (including in eg. bindings), as they're only meant to
11-
// be used by code behind interacting with System.Reactive APIs. As such, we skip marking
12-
// them partial, as we don't need CCW vtables to be generated for them.
13-
#pragma warning disable CsWinRT1028
6+
#if NET8_0_OR_GREATER && WINDOWS
7+
using WinRT;
8+
#endif
149

1510
namespace CommunityToolkit.Mvvm.Messaging;
1611

@@ -81,6 +76,9 @@ public IDisposable Subscribe(IObserver<TMessage> observer)
8176
/// <summary>
8277
/// An <see cref="IRecipient{TMessage}"/> implementation for <see cref="Observable{TMessage}"/>.
8378
/// </summary>
79+
#if NET8_0_OR_GREATER && WINDOWS
80+
[WinRTExposedType(typeof(WinRTManagedOnlyTypeDetails))]
81+
#endif
8482
private sealed class Recipient : IRecipient<TMessage>, IDisposable
8583
{
8684
/// <summary>
@@ -159,6 +157,9 @@ public IDisposable Subscribe(IObserver<TMessage> observer)
159157
/// <summary>
160158
/// An <see cref="IRecipient{TMessage}"/> implementation for <see cref="Observable{TMessage, TToken}"/>.
161159
/// </summary>
160+
#if NET8_0_OR_GREATER && WINDOWS
161+
[WinRTExposedType(typeof(WinRTManagedOnlyTypeDetails))]
162+
#endif
162163
private sealed class Recipient : IRecipient<TMessage>, IDisposable
163164
{
164165
/// <summary>

src/CommunityToolkit.Mvvm/Messaging/Internals/ArrayPoolBufferWriter{T}.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static ArrayPoolBufferWriter<T> Create()
5858
/// <summary>
5959
/// Gets a <see cref="ReadOnlySpan{T}"/> with the current items.
6060
/// </summary>
61-
public ReadOnlySpan<T> Span
61+
public readonly ReadOnlySpan<T> Span
6262
{
6363
[MethodImpl(MethodImplOptions.AggressiveInlining)]
6464
get => this.span.Slice(0, this.index);
@@ -116,7 +116,7 @@ private void ResizeBufferAndAdd(T item)
116116
}
117117

118118
/// <inheritdoc cref="IDisposable.Dispose"/>
119-
public void Dispose()
119+
public readonly void Dispose()
120120
{
121121
Array.Clear(this.array, 0, this.index);
122122

src/CommunityToolkit.Mvvm/Messaging/Internals/System/Collections.Generic/Dictionary2.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ public bool MoveNext()
320320
/// Gets the current key.
321321
/// </summary>
322322
[MethodImpl(MethodImplOptions.AggressiveInlining)]
323-
public TKey GetKey()
323+
public readonly TKey GetKey()
324324
{
325325
return this.entries[this.index - 1].Key;
326326
}
@@ -329,7 +329,7 @@ public TKey GetKey()
329329
/// Gets the current value.
330330
/// </summary>
331331
[MethodImpl(MethodImplOptions.AggressiveInlining)]
332-
public TValue GetValue()
332+
public readonly TValue GetValue()
333333
{
334334
return this.entries[this.index - 1].Value!;
335335
}

0 commit comments

Comments
 (0)