HavenDV / Uno.Sdk

Single project solution for Uno
Other
7 stars 0 forks source link
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

Uno.Sdk

Nuget package dotnet License: MIT Discord

Single project solution for Uno. Supported platforms:

Project Structure like MAUI:

Usage

Here are three possible uses:

- 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
<Project Sdk="H.Uno.Sdk/0.27.0">

    <PropertyGroup>
        <TargetFrameworks>net8.0-maccatalyst;net8.0-android;net8.0-ios;net8.0-webassembly;net8.0-gtk;net8.0-linux;net8.0-windows</TargetFrameworks>
        <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
    </PropertyGroup>

</Project>

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


### 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:

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:

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:

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

Cons