1
0
Эх сурвалжийг харах

Update Rx.NET to .NET 10 SDK (#2267)

* Update Rx.NET to .NET 10 SDK
* Add .NET 9.0 install to CI
Ian Griffiths 2 долоо хоног өмнө
parent
commit
3506ba18b3

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/FromEvent.cs

@@ -178,7 +178,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
             if (_conversion == null)
             {
-                handler = ReflectionUtils.CreateDelegate<TDelegate>(onNext, typeof(Action<TEventArgs>).GetMethod(nameof(Action<TEventArgs>.Invoke))!);
+                handler = ReflectionUtils.CreateDelegate<TDelegate>(onNext, typeof(Action<TEventArgs>).GetMethod(nameof(Action<>.Invoke))!);
             }
             else
             {

+ 3 - 3
Rx.NET/Source/src/System.Reactive/Linq/Observable/FromEventPattern.cs

@@ -37,7 +37,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 if (_conversion == null)
                 {
                     Action<object, TEventArgs> h = (sender, eventArgs) => onNext(new EventPattern<TEventArgs>(sender, eventArgs));
-                    handler = ReflectionUtils.CreateDelegate<TDelegate>(h, typeof(Action<object, TEventArgs>).GetMethod(nameof(Action<object, TEventArgs>.Invoke))!);
+                    handler = ReflectionUtils.CreateDelegate<TDelegate>(h, typeof(Action<object, TEventArgs>).GetMethod(nameof(Action<,>.Invoke))!);
                 }
                 else
                 {
@@ -58,7 +58,7 @@ namespace System.Reactive.Linq.ObservableImpl
             protected override TDelegate GetHandler(Action<EventPattern<TSender, TEventArgs>> onNext)
             {
                 Action<TSender, TEventArgs> h = (sender, eventArgs) => onNext(new EventPattern<TSender, TEventArgs>(sender, eventArgs));
-                return ReflectionUtils.CreateDelegate<TDelegate>(h, typeof(Action<TSender, TEventArgs>).GetMethod(nameof(Action<TSender, TEventArgs>.Invoke))!);
+                return ReflectionUtils.CreateDelegate<TDelegate>(h, typeof(Action<TSender, TEventArgs>).GetMethod(nameof(Action<,>.Invoke))!);
             }
         }
 
@@ -85,7 +85,7 @@ namespace System.Reactive.Linq.ObservableImpl
             protected override Delegate GetHandler(Action<TResult> onNext)
             {
                 Action<TSender, TEventArgs> h = (sender, eventArgs) => onNext(_getResult(sender, eventArgs));
-                return ReflectionUtils.CreateDelegate(_delegateType, h, typeof(Action<TSender, TEventArgs>).GetMethod(nameof(Action<TSender, TEventArgs>.Invoke))!);
+                return ReflectionUtils.CreateDelegate(_delegateType, h, typeof(Action<TSender, TEventArgs>).GetMethod(nameof(Action<,>.Invoke))!);
             }
 
             protected override IDisposable AddHandler(Delegate handler)

+ 1 - 1
Rx.NET/Source/tests/Tests.System.Reactive/Tests.System.Reactive.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>net472;net8.0;net8.0-windows10.0.19041;net9.0;net9.0-windows10.0.19041</TargetFrameworks>
+    <TargetFrameworks>net472;net8.0;net8.0-windows10.0.19041;net9.0;net9.0-windows10.0.19041;net10.0;net10.0-windows10.0.19041</TargetFrameworks>
 
     <!-- IDE0330: Prefer 'System.Threading.Lock': not applicable for as long as we support .NET 8.0 or .NET FX, because it is unavailable on those targets.
          MSTEST0049: Consider overload accepting a CancellationToken - there are 136 of these, and since I've not yet run into a situation that this would have helped in, it's not a priority.

+ 20 - 4
azure-pipelines.rx.yml

@@ -34,15 +34,19 @@ stages:
 
     steps:
     - task: UseDotNet@2
-      displayName: Use .NET 9.0.x SDK
+      displayName: Use .NET Core 10.x SDK
       inputs:
-        version: 9.0.x
-        performMultiLevelLookup: true
+        version: 10.x
         includePreviewVersions: true
 
-    # We need .NET 8.0 to be able to run all tests.
+    # We need .NET 8.0 and 9.0 to be able to run all tests.
     # We can't just use the runtime package because we need the desktop framework,
     # and the only way to get that into a build agent seems to be to install the SDK.
+    - task: UseDotNet@2
+      displayName: Use .NET 9.0 SDK
+      inputs:
+        version: '9.0.x'
+
     - task: UseDotNet@2
       displayName: Use .NET 8.0 SDK
       inputs:
@@ -126,6 +130,12 @@ stages:
       DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
 
     steps:
+    - task: UseDotNet@2
+      displayName: Use .NET Core 10.x SDK
+      inputs:
+        version: 10.x
+        includePreviewVersions: true
+
     - task: UseDotNet@2
       displayName: Use .NET 9.0 SDK
       inputs:
@@ -192,6 +202,12 @@ stages:
       DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
 
     steps:
+    - task: UseDotNet@2
+      displayName: Use .NET Core 10.x SDK
+      inputs:
+        version: 10.x
+        includePreviewVersions: true
+
     - task: UseDotNet@2
       displayName: Use .NET 9.0 SDK
       inputs: