Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Housekeeping Update to Net 9.0 #1232

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor and update code
Ensure that all projects have net9.0
  • Loading branch information
ChrisPulman committed Nov 13, 2024
commit 701a7caccccc33d8d28f81cc8c8946fdb2e16848
3 changes: 2 additions & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<PackageVersion Include="System.IO.FileSystem" Version="4.3.0" />
<PackageVersion Include="System.IO.FileSystem.Watcher" Version="4.3.0" />
<PackageVersion Include="System.Linq" Version="4.3.0" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Net.NameResolution" Version="4.3.0" />
<PackageVersion Include="System.Net.Requests" Version="4.3.0" />
<PackageVersion Include="System.Net.Sockets" Version="4.3.0" />
Expand Down Expand Up @@ -81,4 +82,4 @@
<PackageVersion Include="System.Drawing.Primitives" Version="4.3.0" />
<PackageVersion Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
</ItemGroup>
</Project>
</Project>
4 changes: 2 additions & 2 deletions src/Directory.build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591;1701;1702;1705;VSX1000</NoWarn>
<NoWarn>$(NoWarn);1591;1701;1702;1705;VSX1000;IDE0130</NoWarn>
<Platform>AnyCPU</Platform>
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
<DebugType>embedded</DebugType>
Expand All @@ -14,7 +14,7 @@
<PackageDescription>A library to make things cross-platform that should be.</PackageDescription>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<Owners>anaisbetts;ghuntley</Owners>
<PackageTags>drawing;colours;geometry;logging;unit test detection;service location;image handling;portable;xamarin;xamarin ios;xamarin mac;android;monodroid;uwp;net45</PackageTags>
<PackageTags>drawing;colours;geometry;logging;unit test detection;service location;image handling;portable;xamarin;xamarin ios;xamarin mac;android</PackageTags>
<PackageReleaseNotes>https://github.com/reactiveui/splat/releases</PackageReleaseNotes>
<RepositoryUrl>https://github.com/reactiveui/splat</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down
4 changes: 2 additions & 2 deletions src/ReactiveUI.DI.Tests/ReactiveUI.DI.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;net8.0;</TargetFrameworks>
<TargetFrameworks>net472;net8.0;net9.0</TargetFrameworks>
<NoWarn>$(NoWarn);1591;CA1707;SA1633;CA2000</NoWarn>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
Expand All @@ -14,7 +14,7 @@
<ProjectReference Include="..\Splat.Autofac\Splat.Autofac.csproj" />
</ItemGroup>
</When>
<When Condition="$(TargetFramework.StartsWith('net8.0'))">
<When Condition="$(TargetFramework.StartsWith('net8.0')) or $(TargetFramework.StartsWith('net9.0'))">
<ItemGroup>
<Compile Remove="AutoFacReactiveUIDependencyTests.cs" />
<Compile Remove="NinjectReactiveUIDependencyTests.cs" />
Expand Down
6 changes: 5 additions & 1 deletion src/Splat.Autofac.Tests/Splat.Autofac.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-windows10.0.17763.0</TargetFrameworks>
<TargetFrameworks>net8.0-windows10.0.17763.0;net9.0-windows10.0.17763.0</TargetFrameworks>

<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);1591;CA1707;SA1633;CA2000;CA1851</NoWarn>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Net.Http" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Splat.Autofac\Splat.Autofac.csproj" />
<ProjectReference Include="..\Splat.Common.Test\Splat.Common.Test.csproj" />
Expand Down
11 changes: 3 additions & 8 deletions src/Splat.Autofac/AutofacDependencyResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,9 @@ protected virtual void Dispose(bool disposing)

var lifeTimeScope = _lifetimeScope ?? _internalLifetimeScope;

if (contract is null || string.IsNullOrWhiteSpace(contract))
{
lifeTimeScope.TryResolve(serviceType, out serviceInstance!);
}
else
{
lifeTimeScope.TryResolveNamed(contract, serviceType, out serviceInstance!);
}
_ = contract is null || string.IsNullOrWhiteSpace(contract)
? lifeTimeScope.TryResolve(serviceType, out serviceInstance!)
: lifeTimeScope.TryResolveNamed(contract, serviceType, out serviceInstance!);

return serviceInstance;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Splat.Avalonia.Autofac/AvaloniaMixins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static AppBuilder UseReactiveUIWithDIContainer<TContainer>(
#endif

var container = containerFactory();
Locator.CurrentMutable.RegisterConstant(container, typeof(TContainer));
Locator.CurrentMutable.RegisterConstant(container);
var dependencyResolver = dependencyResolverFactory(container);
Locator.SetLocator(dependencyResolver);
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
Expand Down
4 changes: 2 additions & 2 deletions src/Splat.Avalonia.DryIoc/AvaloniaMixins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static AppBuilder UseReactiveUIWithDryIoc(this AppBuilder builder, Action
#endif

var container = new Container();
Locator.CurrentMutable.RegisterConstant(container, typeof(Container));
Locator.CurrentMutable.RegisterConstant(container);
Locator.SetLocator(new DryIocDependencyResolver(container));
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
containerConfig(container);
Expand Down Expand Up @@ -98,7 +98,7 @@ public static AppBuilder UseReactiveUIWithDIContainer<TContainer>(
#endif

var container = containerFactory();
Locator.CurrentMutable.RegisterConstant(container, typeof(TContainer));
Locator.CurrentMutable.RegisterConstant(container);
var dependencyResolver = dependencyResolverFactory(container);
Locator.SetLocator(dependencyResolver);
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static AppBuilder UseReactiveUIWithMicrosoftDependencyResolver(this AppBu
#endif

IServiceCollection serviceCollection = new ServiceCollection();
Locator.CurrentMutable.RegisterConstant(serviceCollection, typeof(IServiceCollection));
Locator.CurrentMutable.RegisterConstant(serviceCollection);
Locator.SetLocator(new MicrosoftDependencyResolver(serviceCollection));
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
containerConfig(serviceCollection);
Expand Down Expand Up @@ -114,7 +114,7 @@ public static AppBuilder UseReactiveUIWithDIContainer<TContainer>(
#endif

var container = containerFactory();
Locator.CurrentMutable.RegisterConstant(container, typeof(TContainer));
Locator.CurrentMutable.RegisterConstant(container);
var dependencyResolver = dependencyResolverFactory(container);
Locator.SetLocator(dependencyResolver);
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000</NoWarn>
Expand Down
4 changes: 2 additions & 2 deletions src/Splat.Avalonia.Ninject/AvaloniaMixins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static AppBuilder UseReactiveUIWithNinject(this AppBuilder builder, Actio
#endif

var container = new StandardKernel();
Locator.CurrentMutable.RegisterConstant(container, typeof(StandardKernel));
Locator.CurrentMutable.RegisterConstant(container);
Locator.SetLocator(new NinjectDependencyResolver(container));
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
containerConfig(container);
Expand Down Expand Up @@ -98,7 +98,7 @@ public static AppBuilder UseReactiveUIWithDIContainer<TContainer>(
#endif

var container = containerFactory();
Locator.CurrentMutable.RegisterConstant(container, typeof(TContainer));
Locator.CurrentMutable.RegisterConstant(container);
var dependencyResolver = dependencyResolverFactory(container);
Locator.SetLocator(dependencyResolver);
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
Expand Down
2 changes: 1 addition & 1 deletion src/Splat.Avalonia.Tests/Splat.Avalonia.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000</NoWarn>
Expand Down
2 changes: 1 addition & 1 deletion src/Splat.Common.Test/Splat.Common.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
<NoWarn>$(NoWarn);CA2000</NoWarn>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Loading
Loading