diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 4d608a6..87a85f4 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,19 +1,49 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/build", - "title": "Build Schema", "definitions": { - "build": { - "type": "object", + "Host": { + "type": "string", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "ExecutableTarget": { + "type": "string", + "enum": [ + "Clean", + "Compile", + "Deploy", + "Pack", + "Print", + "Restore" + ] + }, + "Verbosity": { + "type": "string", + "description": "", + "enum": [ + "Verbose", + "Normal", + "Minimal", + "Quiet" + ] + }, + "NukeBuild": { "properties": { - "Configuration": { - "type": "string", - "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", - "enum": [ - "Debug", - "Release" - ] - }, "Continue": { "type": "boolean", "description": "Indicates to continue a previously failed build attempt" @@ -23,34 +53,13 @@ "description": "Shows the help text for this build assembly" }, "Host": { - "type": "string", "description": "Host for execution. Default is 'automatic'", - "enum": [ - "AppVeyor", - "AzurePipelines", - "Bamboo", - "Bitbucket", - "Bitrise", - "GitHubActions", - "GitLab", - "Jenkins", - "Rider", - "SpaceAutomation", - "TeamCity", - "Terminal", - "TravisCI", - "VisualStudio", - "VSCode" - ] + "$ref": "#/definitions/Host" }, "NoLogo": { "type": "boolean", "description": "Disables displaying the NUKE logo" }, - "NuGetApiKey": { - "type": "string", - "default": "Secrets must be entered via 'nuke :secrets [profile]'" - }, "Partition": { "type": "string", "description": "Partition to use on CI" @@ -74,47 +83,46 @@ "type": "array", "description": "List of targets to be skipped. Empty list skips all dependencies", "items": { - "type": "string", - "enum": [ - "Clean", - "Compile", - "Deploy", - "Pack", - "Print", - "Restore" - ] + "$ref": "#/definitions/ExecutableTarget" } }, - "Solution": { - "type": "string", - "description": "Path to a solution file that is automatically loaded" - }, "Target": { "type": "array", "description": "List of targets to be invoked. Default is '{default_target}'", "items": { - "type": "string", - "enum": [ - "Clean", - "Compile", - "Deploy", - "Pack", - "Print", - "Restore" - ] + "$ref": "#/definitions/ExecutableTarget" } }, "Verbosity": { - "type": "string", "description": "Logging verbosity during build execution. Default is 'Normal'", + "$ref": "#/definitions/Verbosity" + } + } + } + }, + "allOf": [ + { + "properties": { + "Configuration": { + "type": "string", + "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", "enum": [ - "Minimal", - "Normal", - "Quiet", - "Verbose" + "Debug", + "Release" ] + }, + "NuGetApiKey": { + "type": "string", + "default": "Secrets must be entered via 'nuke :secrets [profile]'" + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" } } + }, + { + "$ref": "#/definitions/NukeBuild" } - } + ] } diff --git a/build/Build.cs b/build/Build.cs index 215f8e2..0ddae52 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -60,7 +60,11 @@ partial class Build : NukeBuild Target Restore => _ => _ .DependsOn(Clean) - .Executes(() => DotNetRestore(s => s.SetProjectFile(Solution))); + .Executes(() => + { + DotNetWorkloadRestore(s => s.DisableSkipManifestUpdate().SetProject(Solution)); + return DotNetRestore(s => s.SetProjectFile(Solution)); + }); Target Compile => _ => _ .DependsOn(Restore, Print) diff --git a/src/Extensions.Hosting.MainUIThread/IUiContext.cs b/src/Extensions.Hosting.MainUIThread/IUiContext.cs index 579420d..65a4058 100644 --- a/src/Extensions.Hosting.MainUIThread/IUiContext.cs +++ b/src/Extensions.Hosting.MainUIThread/IUiContext.cs @@ -15,7 +15,7 @@ public interface IUiContext bool IsLifetimeLinked { get; set; } /// - /// Gets or sets a value indicating whether is the WPF application started and still running?. + /// Gets or sets a value indicating whether is the application started and still running?. /// bool IsRunning { get; set; } } diff --git a/src/Extensions.Hosting.Maui.Example/App.xaml b/src/Extensions.Hosting.Maui.Example/App.xaml new file mode 100644 index 0000000..578fd33 --- /dev/null +++ b/src/Extensions.Hosting.Maui.Example/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/Extensions.Hosting.Maui.Example/App.xaml.cs b/src/Extensions.Hosting.Maui.Example/App.xaml.cs new file mode 100644 index 0000000..7d4a25a --- /dev/null +++ b/src/Extensions.Hosting.Maui.Example/App.xaml.cs @@ -0,0 +1,30 @@ +// Copyright (c) 2019-2025 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace Extensions.Hosting.Maui.Example; + +/// +/// App. +/// +/// +public partial class App : Application +{ + /// + /// Initializes a new instance of the class. + /// + public App() + { + InitializeComponent(); + + // Start the host + MauiProgram.HostApp.StartAsync(); + } + + /// + /// Creates the window. + /// + /// State of the activation. + /// A Window. + protected override Window CreateWindow(IActivationState? activationState) => new(new AppShell()); +} diff --git a/src/Extensions.Hosting.Maui.Example/AppShell.xaml b/src/Extensions.Hosting.Maui.Example/AppShell.xaml new file mode 100644 index 0000000..4f6a19d --- /dev/null +++ b/src/Extensions.Hosting.Maui.Example/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/src/Extensions.Hosting.Maui.Example/AppShell.xaml.cs b/src/Extensions.Hosting.Maui.Example/AppShell.xaml.cs new file mode 100644 index 0000000..67ac278 --- /dev/null +++ b/src/Extensions.Hosting.Maui.Example/AppShell.xaml.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2019-2025 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace Extensions.Hosting.Maui.Example; + +/// +/// AppShell. +/// +/// +public partial class AppShell : Shell +{ + /// + /// Initializes a new instance of the class. + /// + public AppShell() => InitializeComponent(); +} diff --git a/src/Extensions.Hosting.Maui.Example/ExampleMauiService.cs b/src/Extensions.Hosting.Maui.Example/ExampleMauiService.cs new file mode 100644 index 0000000..9abf93d --- /dev/null +++ b/src/Extensions.Hosting.Maui.Example/ExampleMauiService.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2019-2025 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using ReactiveMarbles.Extensions.Hosting.Maui; + +namespace Extensions.Hosting.Maui.Example; + +/// +/// Example MAUI service. +/// +public class ExampleMauiService : IMauiService +{ + /// + /// Initializes the specified application. + /// + /// The application. + public void Initialize(Microsoft.Maui.Controls.Application application) + { + // Example initialization + Console.WriteLine("MAUI application initialized via IMauiService"); + } +} diff --git a/src/Extensions.Hosting.Maui.Example/Extensions.Hosting.Maui.Example.csproj b/src/Extensions.Hosting.Maui.Example/Extensions.Hosting.Maui.Example.csproj new file mode 100644 index 0000000..bbcab96 --- /dev/null +++ b/src/Extensions.Hosting.Maui.Example/Extensions.Hosting.Maui.Example.csproj @@ -0,0 +1,78 @@ + + + + false + net9.0-android; + $(TargetFrameworks);net9.0-windows10.0.19041.0 + + + + + Exe + Extensions.Hosting.Maui.Example + true + true + enable + enable + + + Extensions.Hosting.Maui.Example + + + com.companyname.extensions.hosting.maui.example + + + 1.0 + 1 + + + None + + 15.0 + 15.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + NU1605;SA1633;SA1600;SA1601;SA1027;SA1137;SX1309;CA1805;CA1400;RCS1102;SA1400;SA1508;SA1512;SA1642;SX1101 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + + + + diff --git a/src/Extensions.Hosting.Maui.Example/MainPage.xaml b/src/Extensions.Hosting.Maui.Example/MainPage.xaml new file mode 100644 index 0000000..0a81bb6 --- /dev/null +++ b/src/Extensions.Hosting.Maui.Example/MainPage.xaml @@ -0,0 +1,42 @@ + + + + + + + +