An open API service indexing awesome lists of open source software.

https://github.com/HavenDV/Uno.Sdk

Single project solution for Uno
https://github.com/HavenDV/Uno.Sdk

configuration csharp dotnet easy gtk linux net6 net7 net8 one-project sdk simple single-project single-project-solution skia templates uno uno-platform workload wpf

Last synced: 3 months ago
JSON representation

Single project solution for Uno

Awesome Lists containing this project

README

          

# Uno.Sdk

[![Nuget package](https://img.shields.io/nuget/vpre/H.Uno.Sdk)](https://www.nuget.org/packages/H.Uno.Sdk/)
[![dotnet](https://github.com/HavenDV/Uno.Sdk/actions/workflows/dotnet.yml/badge.svg?branch=main)](https://github.com/HavenDV/Uno.Sdk/actions/workflows/dotnet.yml)
[![License: MIT](https://img.shields.io/github/license/HavenDV/Uno.Sdk)](https://github.com/HavenDV/Uno.Sdk/blob/main/LICENSE.txt)
[![Discord](https://img.shields.io/discord/1115206893015662663?label=Discord&logo=discord&logoColor=white&color=d82679)](https://discord.gg/Ca2xhfBf3v)

Single project solution for Uno.
Supported platforms:
- Mobile(iOS, macOS, MacCatalyst and Android)(`net8.0-maccatalyst;net8.0-android;net8.0-ios;net8.0-macos`)
- Windows(`net8.0-windows10.0.19041.0` or any other `net8.0-windows10`)
- WebAssembly(`net8.0-webassembly`)
- Skia.Gkt(`net8.0-gtk`)
- Skia.Wpf(`net8.0-windows`)(this is an implicit indication for `net8.0-windows7`)
- Skia.Linux.Framebuffer(`net8.0-linux`)
- Skia.Tizen(`net8.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)
```xml


net8.0-maccatalyst;net8.0-android;net8.0-ios;net8.0-webassembly;net8.0-gtk;net8.0-linux;net8.0-windows
$(TargetFrameworks);net8.0-windows10.0.19041.0

```
- Use SDK via NuGet. A small hack will be used here to disable the error message about missing workloads for webassembly/linux/gtk. But it's better if you install workload also.
```xml


net8.0-maccatalyst;net8.0-android;net8.0-ios;net8.0-webassembly;net8.0-gtk;net8.0-linux;net8.0-windows
$(TargetFrameworks);net8.0-windows10.0.19041.0

```
Note: For some cases to restore correctly from NuGet you need to run this in a project where `net8.0-webassembly;net8.0-gtk;net8.0-linux` is missing
- Use via `Microsoft.NET.Sdk` and `true` 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)
```xml


net8.0-maccatalyst;net8.0-android;net8.0-ios;net8.0-webassembly;net8.0-gtk;net8.0-linux;net8.0-windows
$(TargetFrameworks);net8.0-windows10.0.19041.0
true

```

### Fast start
You can use https://github.com/HavenDV/Uno.Sdk.Example/ as a start point or just use templates:
```shell
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 net8.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:
- `true` - will use Uno.UI packages instead of Uno.WinUI.
- `5.0.0