Skip to content

Commit

Permalink
Housekeeping update for WinUI .net6 (#2903)
Browse files Browse the repository at this point in the history
* Update for WinUI .net6

* remove FluentAssertions packages in test projects

* Update ActivationForViewFetcher.cs

* Update ReactiveUI.csproj

* Update ActivationForViewFetcher.cs

* reverted as requested

* Update ApiApprovalTests.ReactiveUI.net5.0.approved.txt
  • Loading branch information
ChrisPulman authored Aug 23, 2021
1 parent 1de2e78 commit 6cba841
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/Directory.build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
</PropertyGroup>

<Target Name="ValidateNugetProperties" Condition="!$(IsTestProject) or $(IsTestProject) == ''" BeforeTargets="Compile">
<Error Condition="$(PackageDescription) == '' or $(PackageDescription) == $(DefaultPackageDescription)" Text="The Nuget PackageDescription property needs to be set for the project. Currently : '$(PackageDescription)'" />
<Error Condition="$(PackageDescription) == '' or $(PackageDescription) == $(DefaultPackageDescription)" Text="The Nuget PackageDescription property needs to be set for the project. Currently : '$(PackageDescription)'" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<Nullable>enable</Nullable>
Expand Down
4 changes: 2 additions & 2 deletions src/ReactiveUI.Fody.Tests/ReactiveUI.Fody.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.Sdk.Extras">
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<FodyTargetFramework>netstandard2.0</FodyTargetFramework>
Expand Down Expand Up @@ -27,7 +27,7 @@
<ItemGroup>
<None Include="API\**\*.txt" CopyToOutputDirectory="PreserveNewest" LinkBase="/" />
</ItemGroup>

<Target Name="CopyWeavers" BeforeTargets="Fody.WeavingTask">
<!-- Fody expects to find weavers in referenced NuGet packages or the Tools directory at the solution level.
Since this is for testing purposes before a NuGet package is created, we'll just use the Tools directory
Expand Down
2 changes: 1 addition & 1 deletion src/ReactiveUI.LeakTests/ReactiveUI.LeakTests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.Sdk.Extras">
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<Nullable>enable</Nullable>
Expand Down
3 changes: 1 addition & 2 deletions src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.Sdk.Extras">
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<FodyTargetFramework>netstandard2.0</FodyTargetFramework>
Expand All @@ -14,5 +14,4 @@
<ItemGroup>
<None Include="API\**\*.txt" CopyToOutputDirectory="PreserveNewest" LinkBase="/" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion src/ReactiveUI.Tests/ReactiveUI.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
<DependentUpon>TestFormNotCanActivate.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<Page Update="Platforms\wpf\Mocks\CanExecuteMock\CanExecuteExecutingView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
Expand Down
1 change: 0 additions & 1 deletion src/ReactiveUI.Uwp/Common/RoutedViewHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ namespace ReactiveUI
/// the View and wire up the ViewModel whenever a new ViewModel is
/// navigated to. Put this control as the only control in your Window.
/// </summary>
[SuppressMessage("Design", "CA1010:Collections should implement generic interface", Justification = "Deliberate usage")]
public
#if HAS_UNO
partial
Expand Down
2 changes: 1 addition & 1 deletion src/ReactiveUI.WinUI/ActivationForViewFetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class ActivationForViewFetcher : IActivationForViewFetcher
/// <inheritdoc/>
public IObservable<bool> GetActivationForView(IActivatableView view)
{
if (!(view is FrameworkElement fe))
if (view is not FrameworkElement fe)
{
return Observable<bool>.Empty;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ReactiveUI.WinUI/ReactiveUI.WinUI.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0-windows10.0.19041.0;net6.0-windows10.0.19041</TargetFrameworks>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<TargetFrameworks>net5.0-windows10.0.19041.0;net6.0-windows10.0.19041.0</TargetFrameworks>
<PackageDescription>Contains the ReactiveUI platform specific extensions for WinUI Desktop</PackageDescription>
<RootNamespace>ReactiveUI.WinUI.Desktop</RootNamespace>
<RuntimeIdentifiers>win10-x86;win10-x64</RuntimeIdentifiers>
<DefineConstants>HAS_WINUI</DefineConstants>
<PackageTags>mvvm;reactiveui;rx;reactive extensions;observable;LINQ;events;winui</PackageTags>
<UseWinUI>true</UseWinUI>
<LangVersion>preview</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ReactiveUI.WinUI/Registrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void Register(Action<Func<object>, Type> registerFunction)
if (!ModeDetector.InUnitTestRunner())
{
// NB: On .NET Core, trying to touch DispatcherScheduler blows up :cry:
RxApp.MainThreadScheduler = new WaitForDispatcherScheduler(() => { return DispatcherQueueScheduler.Current; });
RxApp.MainThreadScheduler = new WaitForDispatcherScheduler(() => DispatcherQueueScheduler.Current);
RxApp.TaskpoolScheduler = TaskPoolScheduler.Default;
}

Expand Down
4 changes: 1 addition & 3 deletions src/ReactiveUI.WinUI/TransitioningContentControl.Empty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ namespace ReactiveUI
/// <summary>
/// A control with a single transition.
/// </summary>
[SuppressMessage("Design", "CA1010:Collections should implement generic interface", Justification = "Deliberate usage")]
public
class TransitioningContentControl : ContentControl
public class TransitioningContentControl : ContentControl
{
}
}
2 changes: 1 addition & 1 deletion src/ReactiveUI.Winforms/ReactiveUI.Winforms.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0-windows;net6.0-windows;net461;net472;net48;net5.0-windows10.0.19041</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0-windows;net6.0-windows;net461;net472;net48;net5.0-windows10.0.19041.0;net6.0-windows10.0.19041.0</TargetFrameworks>
<AssemblyName>ReactiveUI.Winforms</AssemblyName>
<RootNamespace>ReactiveUI.Winforms</RootNamespace>
<PackageDescription>Contains the ReactiveUI platform specific extensions for Windows Forms</PackageDescription>
Expand Down
2 changes: 1 addition & 1 deletion src/ReactiveUI.Wpf/ReactiveUI.Wpf.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0-windows;net6.0-windows;net461;net472;net48;net5.0-windows10.0.19041</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0-windows;net6.0-windows;net461;net472;net48;net5.0-windows10.0.19041.0;net6.0-windows10.0.19041.0</TargetFrameworks>
<PackageDescription>Contains the ReactiveUI platform specific extensions for Windows Presentation Foundation (WPF)</PackageDescription>
<PackageId>ReactiveUI.WPF</PackageId>
<UseWpf>true</UseWpf>
Expand Down
2 changes: 1 addition & 1 deletion src/ReactiveUI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31613.86
MinimumVisualStudioVersion = 10.0.40219.1
MinimumVisualStudioVersion = 16.0.31613.86
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BD9762CF-E104-481C-96A6-26E624B86283}"
ProjectSection(SolutionItems) = preProject
..\.editorconfig = ..\.editorconfig
Expand Down

0 comments on commit 6cba841

Please sign in to comment.