Deprecated Package Version
Reason: Legacy
Install
No framework information available.
README
Uno.Sdk
Single project solution for Uno. Supported platforms:
- Mobile(iOS, macOS, MacCatalyst and Android)(
net7.0-maccatalyst;net7.0-android;net7.0-ios;net7.0-macos) - Windows(
net7.0-windows10.0.19041.0or any othernet7.0-windows10) - WebAssembly(
net7.0-webassembly) - Skia.Gkt(
net7.0-gtk) - Skia.Wpf(
net7.0-windows)(this is an implicit indication fornet7.0-windows7) - Skia.Linux.Framebuffer(
net7.0-linux) - Skia.Tizen(
net7.0-tizen)(Untested)
Project Structure like MAUI:
- Platforms
- Android
- iOS
- MacСatalyst
- Windows
- Gtk
- Linux
- Wpf
- WebAssembly
- Resources
- Images
- Icons
- Splash
- Strings
- UnoProgram.cs
- App.xaml
- App.xaml.cs
Usage
Here are three possible uses:
- Use local SDK after installing workload (Recommended)
<Project Sdk="H.Uno.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0-maccatalyst;net7.0-android;net7.0-ios;net7.0-webassembly;net7.0-gtk;net7.0-linux;net7.0-windows</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
</PropertyGroup>
</Project>
- Use SDK via NuGet. A small hack will be used here to disable the error message about missing workloads for webassembly/linux/gtk.
<Project Sdk="H.Uno.Sdk/0.19.0">
<PropertyGroup>
<TargetFrameworks>net7.0-maccatalyst;net7.0-android;net7.0-ios;net7.0-webassembly;net7.0-gtk;net7.0-linux;net7.0-windows</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
</PropertyGroup>
</Project>
Note: To restore correctly from NuGet you need to run this in a project where net7.0-webassembly;net7.0-gtk;net7.0-linux is missing
- Use via
Microsoft.NET.Sdkand<UseUno>true</UseUno>after installing the workload (the most correct, but currently not supported due to the fact that WebAssembly requires Microsoft.NET.Sdk.Web which will not work with some target frameworks)
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0-maccatalyst;net7.0-android;net7.0-ios;net7.0-webassembly;net7.0-gtk;net7.0-linux;net7.0-windows</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<UseUno>true</UseUno> <!-- or UseUnoUwp -->
</PropertyGroup>
</Project>
Fast start
You can use https://github.com/HavenDV/Uno.Sdk.Example/ as a start point or just use templates:
dotnet new install H.Uno.Templates # If you don't have installed workload
mkdir SingleProjectSolution
cd SingleProjectSolution
dotnet new uno
dotnet build
dotnet run --framework net7.0-gtk
Install workload
Although you don't have to do this for NuGet way, full support for the custom target frameworks requires installing the appropriate workload:
- On Linux / macOS:
curl -sSL https://raw.githubusercontent.com/HavenDV/Uno.Sdk/main/scripts/workload-install.sh | sudo bash
- On Windows:
Invoke-WebRequest 'https://raw.githubusercontent.com/HavenDV/Uno.Sdk/main/scripts/workload-install.ps1' -OutFile 'workload-install.ps1';
./workload-install.ps1
Uninstall
dotnet workload uninstall uno
Settings
The SDK is designed to assign default values only to properties that have not been explicitly set by the user. This way the user has full control over what the SDK does. Settings:
<UseUnoUwp>true</UseUnoUwp>- will use Uno.UI packages instead of Uno.WinUI.<UnoVersion>5.0.0</UnoVersion(and other versions, see here) - will change the versions of all implicit PackageReferences
Disclaimer
Although this is a working solution, I have simplified some things regarding workload and manifest, which could theoretically cause problems (for example, when upgrading to a new sdk version).
Docs
Official documentation regarding the design of Workloads and Sdks:
- https://github.com/dotnet/sdk/tree/main/documentation/general/workloads
- https://github.com/dotnet/designs/blob/main/accepted/2020/workloads/workloads.md
- https://github.com/dotnet/designs/blob/main/accepted/2020/workloads/workload-resolvers.md
- https://github.com/dotnet/designs/blob/main/accepted/2020/workloads/workload-manifest.md
- https://github.com/dotnet/designs/blob/main/accepted/2021/workloads/workload-installation.md
- MAUI Workload - https://github.com/dotnet/maui/tree/main/src/Workload
- Tizen Workload - https://github.com/Samsung/Tizen.NET/tree/main/workload
- Uno Single Project Targets - https://github.com/unoplatform/uno/blob/master/build/nuget/uno.winui.single-project.targets
Support
Priority place for bugs: https://github.com/HavenDV/Uno.Sdk/issues
Priority place for ideas and general questions: https://github.com/HavenDV/Uno.Sdk/discussions
Discord: https://discord.gg/g8u2t9dKgE
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.