Skip to content

Commit

Permalink
chore: Update uno and upgrade sample app to net7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Oct 10, 2023
1 parent c423c00 commit 7ad0ef1
Show file tree
Hide file tree
Showing 23 changed files with 148 additions and 188 deletions.
8 changes: 8 additions & 0 deletions src/TestApp/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project ToolsVersion="15.0">
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<DefineConstants>$(DefineConstants);IS_UNO_RUNTIMETEST_PROJECT</DefineConstants>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<!-- Disabled because of https://github.com/xamarin/xamarin-macios/issues/16401-->
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-macos</TargetFrameworks> -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-macos</TargetFrameworks> -->
<SingleProject>true</SingleProject>
<OutputType>Exe</OutputType>
<!-- Debugger workaround https://github.com/dotnet/maui-samples/blob/8aa6b8780b12e97b157514c3bdc54bb4a13001cd/HelloMacCatalyst/HelloMacCatalyst.csproj#L7 -->
<!-- <MtouchExtraArgs Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">$(MtouchExtraArgs) -setenv:MONO_THREADS_SUSPEND=preemptive</MtouchExtraArgs> -->
<!-- <MtouchExtraArgs Condition="'$(TargetFramework)' == 'net7.0-maccatalyst'">$(MtouchExtraArgs) -setenv:MONO_THREADS_SUSPEND=preemptive</MtouchExtraArgs> -->
<!-- Required for C# Hot Reload, except for macOS which uses CoreCLR (not Mono) -->
<UseInterpreter Condition="'$(Configuration)' == 'Debug' and '$(TargetFramework)' != 'net6.0-maccatalyst' and '$(TargetFramework)' != 'net6.0-macos'">True</UseInterpreter>
<UseInterpreter Condition="'$(Configuration)' == 'Debug' and '$(TargetFramework)' != 'net7.0-maccatalyst' and '$(TargetFramework)' != 'net7.0-macos'">True</UseInterpreter>
<IsUnoHead>true</IsUnoHead>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)'=='net6.0-macos'">10.14</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)'=='net7.0-macos'">10.14</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier)'==''">
<!-- Default values for command line builds -->
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net6.0-ios'">iossimulator-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">maccatalyst-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net6.0-macos'">osx-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net7.0-ios'">iossimulator-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net7.0-maccatalyst'">maccatalyst-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net7.0-macos'">osx-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Uno.UI" Version="4.6.19" />
Expand All @@ -31,7 +31,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<Choose>
<When Condition="'$(TargetFramework)'=='net6.0-android'">
<When Condition="'$(TargetFramework)'=='net7.0-android'">
<ItemGroup>
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.4.0.4" />
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.36" />
Expand All @@ -40,8 +40,8 @@
<AndroidEnvironment Include="Android/environment.conf" />
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net6.0-ios'">
<PropertyGroup Condition="'$(TargetFramework)'=='net6.0-ios'">
<When Condition="'$(TargetFramework)'=='net7.0-ios'">
<PropertyGroup Condition="'$(TargetFramework)'=='net7.0-ios'">
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
<!-- See https://github.com/unoplatform/uno/issues/9430 for more details. -->
<MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>
Expand All @@ -52,7 +52,7 @@
<PackageReference Include="Uno.Extensions.Logging.OSLog" Version="1.4.0" />
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net6.0-maccatalyst'">
<When Condition="'$(TargetFramework)'=='net7.0-maccatalyst'">
<PropertyGroup>
<!-- Configure the GC -->
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
Expand All @@ -67,7 +67,7 @@
<PackageReference Include="Uno.Extensions.Logging.OSLog" Version="1.4.0" />
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net6.0-macos'">
<When Condition="'$(TargetFramework)'=='net7.0-macos'">
<PropertyGroup>
<TrimMode Condition="'$(Configuration)'=='Release'">link</TrimMode>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using GLib;
using Uno.UI.Runtime.Skia;
using Uno.UI.Runtime.Skia.Gtk;

namespace Uno.UI.RuntimeTests.Engine.Skia.Gtk
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType Condition="'$(Configuration)'=='Release'">WinExe</OutputType>
<OutputType Condition="'$(Configuration)'=='Debug'">Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<WarningsNotAsErrors>$(WarningsNotAsErrors);Uno0001</WarningsNotAsErrors>
<DefineConstants>$(DefineConstants);__SKIA__</DefineConstants>
</PropertyGroup>
<ItemGroup Condition="exists('..\Uno.UI.RuntimeTests.Engine.UWP')">
<EmbeddedResource Include="..\Uno.UI.RuntimeTests.Engine.UWP\Package.appxmanifest" LogicalName="Package.appxmanifest" />
Expand All @@ -14,12 +16,12 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageReference Include="Uno.UI.Skia.Gtk" Version="4.6.19" />
<PackageReference Include="Uno.UI.RemoteControl" Version="4.6.19" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="4.6.19" />
<PackageReference Include="Uno.UI.Skia.Gtk" Version="5.0.0-dev.2691" />
<PackageReference Include="Uno.UI.RemoteControl" Version="5.0.0-dev.2691" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.2691" />

<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<Import Project="..\..\shared\uno.ui.runtimetests.engine.Shared.projitems" Label="Shared" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType Condition="'$(Configuration)'=='Release'">WinExe</OutputType>
<OutputType Condition="'$(Configuration)'=='Debug'">Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<NoWarn>$(NoWarn);Uno0001</NoWarn>
<TargetFramework>net7.0</TargetFramework>
<WarningsNotAsErrors>$(WarningsNotAsErrors);Uno0001</WarningsNotAsErrors>
<DefineConstants>$(DefineConstants);__SKIA__;IS_UNO_RUNTIMETEST_PROJECT</DefineConstants>
</PropertyGroup>
<ItemGroup Condition="exists('..\Uno.UI.RuntimeTests.Engine.UWP')">
<EmbeddedResource Include="..\Uno.UI.RuntimeTests.Engine.UWP\Package.appxmanifest" LogicalName="Package.appxmanifest" />
Expand Down
12 changes: 5 additions & 7 deletions src/TestApp/uwp/Uno.UI.RuntimeTests.Engine.Skia.WPF/App.xaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<Application x:Class="Uno.UI.RuntimeTests.Engine.WPF.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Uno.UI.RuntimeTests.Engine.WPF"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Uno.UI.RuntimeTests.Engine.WPF">
<Application.Resources>
</Application.Resources>
</Application>
17 changes: 7 additions & 10 deletions src/TestApp/uwp/Uno.UI.RuntimeTests.Engine.Skia.WPF/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Uno.UI.Runtime.Skia.Wpf;

namespace Uno.UI.RuntimeTests.Engine.WPF
namespace Uno.UI.RuntimeTests.Engine.WPF;

public partial class App : Application
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
public App()
{
new WpfHost(Dispatcher, () => new Uno.UI.RuntimeTests.Engine.App()).Run();
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType Condition="'$(Configuration)'=='Release'">WinExe</OutputType>
<OutputType Condition="'$(Configuration)'=='Debug'">Exe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<WarningsNotAsErrors>$(WarningsNotAsErrors);Uno0001</WarningsNotAsErrors>
<DefineConstants>$(DefineConstants);__SKIA__;IS_UNO_RUNTIMETEST_PROJECT</DefineConstants>
</PropertyGroup>
<ItemGroup Label="AssemblyInfo">
<AssemblyAttribute Include="System.Runtime.InteropServices.ComVisibleAttribute">
Expand All @@ -18,12 +20,12 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageReference Include="Uno.UI.Skia.Wpf" Version="4.6.19" />
<PackageReference Include="Uno.UI.RemoteControl" Version="4.6.19" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="4.6.19" />
<PackageReference Include="Uno.UI.Skia.Wpf" Version="5.0.0-dev.2691" />
<PackageReference Include="Uno.UI.DevServer" Version="5.0.0-dev.2691"/> <!--Note: Keep the DevServer package also in release for hot reload tests (cf. HotReloadHelper).-->
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.2691" />

<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>
<ItemGroup>
<UpToDateCheckInput Include="..\..\shared\**\*.xaml" />
Expand All @@ -32,6 +34,12 @@
<Content Include="Assets\Fonts\uno-fluentui-assets.ttf" />
</ItemGroup>

<ItemGroup>
<AssemblyAttribute Include="Uno.UI.RuntimeTests.Engine.RuntimeTestsSourceProjectAttribute">
<_Parameter1>$(MSBuildProjectFullPath)</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<Import Project="..\..\shared\uno.ui.runtimetests.engine.Shared.projitems" Label="Shared" />
<Import Project="..\..\..\Uno.UI.RuntimeTests.Engine.Library\Uno.UI.RuntimeTests.Engine.Library.projitems" Label="Shared" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<NoWarn>NU1701;Uno0001</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst;net6.0-macos</TargetFrameworks>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst;net7.0-macos</TargetFrameworks>
<SingleProject>true</SingleProject>
<OutputType>Exe</OutputType>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net6.0-ios'">iossimulator-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">maccatalyst-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net6.0-macos'">osx-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net7.0-ios'">iossimulator-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net7.0-maccatalyst'">maccatalyst-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net7.0-macos'">osx-x64</RuntimeIdentifier>
<!-- Debugger workaround https://github.com/dotnet/maui-samples/blob/8aa6b8780b12e97b157514c3bdc54bb4a13001cd/HelloMacCatalyst/HelloMacCatalyst.csproj#L7 -->
<!-- <MtouchExtraArgs Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">$(MtouchExtraArgs) -setenv:MONO_THREADS_SUSPEND=preemptive</MtouchExtraArgs> -->
<!-- <MtouchExtraArgs Condition="'$(TargetFramework)' == 'net7.0-maccatalyst'">$(MtouchExtraArgs) -setenv:MONO_THREADS_SUSPEND=preemptive</MtouchExtraArgs> -->
<!-- Required for C# Hot Reload, except for macOS which uses CoreCLR (not Mono) -->
<!-- Disabled because of https://github.com/dotnet/runtime/issues/68808 -->
<!--<UseInterpreter Condition="'$(Configuration)' == 'Debug' and '$(TargetFramework)' != 'net6.0-maccatalyst' and '$(TargetFramework)' != 'net6.0-macos'">True</UseInterpreter>-->
<!--<UseInterpreter Condition="'$(Configuration)' == 'Debug' and '$(TargetFramework)' != 'net7.0-maccatalyst' and '$(TargetFramework)' != 'net7.0-macos'">True</UseInterpreter>-->
<IsUnoHead>true</IsUnoHead>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)'=='net6.0-macos'">10.14</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)'=='net7.0-macos'">10.14</SupportedOSPlatformVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Uno.WinUI" Version="4.6.19" />
Expand All @@ -27,7 +27,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<Choose>
<When Condition="'$(TargetFramework)'=='net6.0-android'">
<When Condition="'$(TargetFramework)'=='net7.0-android'">
<ItemGroup>
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.4.0.4" />
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.36" />
Expand All @@ -36,8 +36,8 @@
<AndroidEnvironment Include="Android/environment.conf" />
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net6.0-ios'">
<PropertyGroup Condition="'$(TargetFramework)'=='net6.0-ios'">
<When Condition="'$(TargetFramework)'=='net7.0-ios'">
<PropertyGroup Condition="'$(TargetFramework)'=='net7.0-ios'">
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
<!-- See https://github.com/unoplatform/uno/issues/9430 for more details. -->
<MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>
Expand All @@ -48,7 +48,7 @@
<PackageReference Include="Uno.Extensions.Logging.OSLog" Version="1.4.0" />
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net6.0-maccatalyst'">
<When Condition="'$(TargetFramework)'=='net7.0-maccatalyst'">
<PropertyGroup>
<!-- Configure the GC -->
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
Expand All @@ -63,7 +63,7 @@
<PackageReference Include="Uno.Extensions.Logging.OSLog" Version="1.4.0" />
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net6.0-macos'">
<When Condition="'$(TargetFramework)'=='net7.0-macos'">
<PropertyGroup>
</PropertyGroup>
</When>
Expand Down
31 changes: 15 additions & 16 deletions src/TestApp/winui/Uno.UI.RuntimeTests.Engine.Skia.Gtk/Program.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
using GLib;
using System;
using Uno.UI.Runtime.Skia;
using Uno.UI.Runtime.Skia.Gtk;

namespace Uno.UI.RuntimeTests.Engine.Skia.Gtk
namespace Uno.UI.RuntimeTests.Engine.Skia.Gtk;

internal class Program
{
internal class Program
{
static void Main(string[] args)
{
ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
{
Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
expArgs.ExitApplication = true;
};
static void Main(string[] args)
{
ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
{
Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
expArgs.ExitApplication = true;
};

var host = new GtkHost(() => new App());
var host = new GtkHost(() => new App());

host.Run();
}
}
}
host.Run();
}
}
Loading

0 comments on commit 7ad0ef1

Please sign in to comment.