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

fix: Adding net7.0 support for maui package #1704

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
53 changes: 30 additions & 23 deletions samples/MauiEmbedding/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
<Project ToolsVersion="15.0">
<ItemGroup>
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.2.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.3.230602002" />
<PackageVersion Include="SkiaSharp" Version="2.88.4-preview.89" />
<PackageVersion Include="SkiaSharp.Views.Uno.WinUI" Version="2.88.4-preview.89" />
<PackageVersion Include="SkiaSharp.NativeAssets.iOS" Version="2.88.4-preview.89" />
<PackageVersion Include="Uno.Core.Extensions.Logging.Singleton" Version="4.0.1" />
<PackageVersion Include="Uno.Extensions.Logging.OSLog" Version="1.4.0" />
<PackageVersion Include="Uno.Material.WinUI" Version="3.0.0-dev.262" />
<PackageVersion Include="Uno.Dsp.Tasks" Version="1.1.0" />
<PackageVersion Include="Uno.Toolkit.WinUI" Version="3.1.0-dev.24" />
<PackageVersion Include="Uno.Toolkit.WinUI.Material" Version="3.1.0-dev.24" />
<PackageVersion Include="Uno.Resizetizer" Version="1.2.0-dev.13" />
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.1610" />
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.36" />
<PackageVersion Include="Uno.WinUI" Version="5.0.0-dev.1610" />
<PackageVersion Include="Uno.WinUI.RemoteControl" Version="5.0.0-dev.1610" />
<PackageVersion Include="CommunityToolkit.Maui" Version="2.0.0" />
<PackageVersion Include="Telerik.UI.for.Maui" Version="5.1.0" Condition="$(_UseTelerik)" />
<PackageVersion Include="Esri.ArcGISRuntime.Maui" Version="200.1.0" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.2.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.3.230602002" />
<PackageVersion Include="SkiaSharp" Version="2.88.4-preview.89" />
<PackageVersion Include="SkiaSharp.Views.Uno.WinUI" Version="2.88.4-preview.89" />
<PackageVersion Include="SkiaSharp.NativeAssets.iOS" Version="2.88.4-preview.89" />
<PackageVersion Include="SkiaSharp.Skottie" Version="2.88.4-preview.89" />
<PackageVersion Include="Uno.Core.Extensions.Logging.Singleton" Version="4.0.1" />
<PackageVersion Include="Uno.Extensions.Logging.OSLog" Version="1.4.0" />
<PackageVersion Include="Uno.Material.WinUI" Version="3.0.0-dev.262" />
<PackageVersion Include="Uno.Dsp.Tasks" Version="1.1.0" />
<PackageVersion Include="Uno.Toolkit.WinUI" Version="3.1.0-dev.24" />
<PackageVersion Include="Uno.Toolkit.WinUI.Material" Version="3.1.0-dev.24" />
<PackageVersion Include="Uno.Resizetizer" Version="1.2.0-dev.13" />
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.1610" />
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.36" />
<PackageVersion Include="Uno.WinUI" Version="5.0.0-dev.1610" />
<PackageVersion Include="Uno.WinUI.Skia.Gtk" Version="5.0.0-dev.1610" />
<PackageVersion Include="Uno.WinUI.RemoteControl" Version="5.0.0-dev.1610" />
<PackageVersion Include="CommunityToolkit.Maui" Version="2.0.0" />
<PackageVersion Include="Telerik.UI.for.Maui" Version="5.1.0" Condition="$(_UseTelerik)" />
<PackageVersion Include="Esri.ArcGISRuntime.Maui" Version="200.1.0" />
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="7.0.4" />
<PackageVersion Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.4.0" />
<PackageVersion Include="Uno.WinUI.WebAssembly" Version="5.0.0-dev.1610" />
<PackageVersion Include="Uno.Wasm.Bootstrap" Version="7.0.27" />
<PackageVersion Include="Uno.Wasm.Bootstrap.DevServer" Version="7.0.27" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<!-- Required for C# Hot Reload -->
<UseInterpreter Condition="'$(Configuration)' == 'Debug' and $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'maccatalyst'">True</UseInterpreter>
<IsUnoHead>true</IsUnoHead>

<!-- TODO: Remove one issue fixed: https://github.com/unoplatform/uno.extensions-private/issues/78 -->
<!-- Note that the UnoDisableHotRestartHelperGeneration is inverted -->
<UnoDisableHotRestartHelperGeneration>false</UnoDisableHotRestartHelperGeneration>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- This is only required because this project references Uno.Extensions.Maui.WinUI as a package reference (ie by source) -->
<Import Project="..\..\..\src\Uno.Extensions.Maui.UI\build\Package.props" />

<PropertyGroup>
<OutputType Condition="'$(Configuration)'=='Release'">WinExe</OutputType>
<OutputType Condition="'$(Configuration)'=='Debug'">Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Package.appxmanifest" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Uno.WinUI.Skia.Gtk" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
<PackageReference Include="SkiaSharp.Views.Uno.WinUI" />
<PackageReference Include="SkiaSharp.Skottie" />
<PackageReference Include="Uno.WinUI.RemoteControl" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MauiEmbedding\MauiEmbedding.csproj" />
</ItemGroup>
<Import Project="..\MauiEmbedding.Base\base.props" />
<Import Project="..\..\..\src\Uno.Extensions.Maui.UI\build\Package.targets" />
</Project>
43 changes: 43 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">

<Identity
Name="MauiEmbedding"
Publisher="O=MauiEmbedding"
Version="1.0.0.0" />

<Properties>
<DisplayName>MauiEmbedding</DisplayName>
<PublisherDisplayName>MauiEmbedding</PublisherDisplayName>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="MauiEmbedding"
Description="MauiEmbedding">
<uap:SplashScreen />
</uap:VisualElements>
</Application>
</Applications>

<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
21 changes: 21 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using GLib;
using Uno.UI.Runtime.Skia;

namespace MauiEmbedding.Skia.Gtk;

public class Program
{
public 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 AppHead());

host.Run();
}
}
77 changes: 77 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MauiEmbedding.Gtk"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.

<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />

Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->

<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->

<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->

<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->

<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->

<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->

</application>
</compatibility>

<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->

<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</windowsSettings>
</application>


<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->

</assembly>
11 changes: 11 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Wasm/LinkerConfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<linker>
<assembly fullname="MauiEmbedding" />
<assembly fullname="MauiEmbedding.Wasm" />

<!--
Uncomment this section when using JSON.NET
<assembly fullname="System.Core">
<type fullname="System.Linq.Expressions*" />
</assembly>
-->
</linker>
75 changes: 75 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Wasm/MauiEmbedding.Wasm.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<!-- This is only required because this project references Uno.Extensions.Maui.WinUI as a package reference (ie by source) -->
<Import Project="..\..\..\src\Uno.Extensions.Maui.UI\build\Package.props" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<NoWarn>$(NoWarn);NU1504;NU1505;NU1701</NoWarn>
<!-- Disabled due to issue with Central Package Management with implicit using -->
<ImplicitUsings>disable</ImplicitUsings>
<WasmPWAManifestFile>manifest.webmanifest</WasmPWAManifestFile>
<AppDesignerFolder>Properties</AppDesignerFolder>
<!--
Supports Deep Linking Routes
https://aka.platform.uno/wasm-deeplink
-->
<WasmShellWebAppBasePath>/</WasmShellWebAppBasePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<MonoRuntimeDebuggerEnabled>true</MonoRuntimeDebuggerEnabled>
<DefineConstants>$(DefineConstants);TRACE;DEBUG</DefineConstants>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<!--
IL Linking is disabled in Debug configuration.
When building in Release, see https://platform.uno/docs/articles/features/using-il-linker-WebAssembly.html
-->
<WasmShellILLinkerEnabled>false</WasmShellILLinkerEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<!-- XAML Resource trimming https://aka.platform.uno/xaml-trimming -->
<!--<UnoXamlResourcesTrimming>true</UnoXamlResourcesTrimming>-->
<!-- Improve performance with AOT builds https://aka.platform.uno/wasm-aot -->
<!-- <WasmShellMonoRuntimeExecutionMode>InterpreterAndAOT</WasmShellMonoRuntimeExecutionMode> -->
<!-- Temporarily uncomment to generate an AOT profile https://aka.platform.uno/wasm-aot-profile -->
<!-- <WasmShellGenerateAOTProfile>true</WasmShellGenerateAOTProfile> -->
</PropertyGroup>
<ItemGroup>
<Content Include="manifest.webmanifest" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="WasmCSS\Fonts.css" />
<EmbeddedResource Include="WasmScripts\AppManifest.js" />
</ItemGroup>
<ItemGroup>
<LinkerDescriptor Include="LinkerConfig.xml" />
</ItemGroup>
<ItemGroup>
<!--
This item group is required by the project template because of the
new SDK-Style project, otherwise some files are not added automatically.

You can safely remove this ItemGroup completely.
-->
<None Include="Program.cs" />
<None Include="LinkerConfig.xml" />
<None Include="wwwroot\web.config" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.Compatibility" />
<PackageReference Include="Uno.Wasm.Bootstrap" />
<PackageReference Include="Uno.Wasm.Bootstrap.DevServer" />
<PackageReference Include="Uno.WinUI.WebAssembly" />
<PackageReference Include="Uno.WinUI.RemoteControl" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" />
<PackageReference Include="Uno.Extensions.Logging.WebAssembly.Console" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MauiEmbedding\MauiEmbedding.csproj" />
</ItemGroup>
<Import Project="..\MauiEmbedding.Base\base.props" />
<Import Project="..\..\..\src\Uno.Extensions.Maui.UI\build\Package.targets" />
</Project>
13 changes: 13 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Wasm/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace MauiEmbedding.Wasm;

public class Program
{
private static App? _app;

public static int Main(string[] args)
{
Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead());

return 0;
}
}
28 changes: 28 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Wasm/WasmCSS/Fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
When adding fonts here, make sure to add them using a base64 data uri, otherwise
fonts loading are delayed, and text may get displayed incorrectly.
*/

/* https://github.com/unoplatform/uno/issues/3954 */
@font-face {
font-family: 'Segoe UI';
src: local('Segoe UI'), local('-apple-system'), local('BlinkMacSystemFont'), local('Inter'), local('Cantarell'), local('Ubuntu'), local('Roboto'), local('Open Sans'), local('Noto Sans'), local('Helvetica Neue'), local('sans-serif');
}

@font-face {
font-family: 'Roboto';
src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf) format('truetype');
font-weight: 300;
}

@font-face {
font-family: 'Roboto';
src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf) format('truetype');
font-weight: 400;
}

@font-face {
font-family: 'Roboto';
src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf) format('truetype');
font-weight: 500;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var UnoAppManifest = {
displayName: "MauiEmbedding"
}
10 changes: 10 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Wasm/manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"background_color": "#ffffff",
"description": "MauiEmbedding",
"display": "standalone",
"name": "MauiEmbedding",
"short_name": "MauiEmbedding",
"start_url": "/index.html",
"theme_color": "#ffffff",
"scope": "/"
}
Loading