Skip to content

Commit

Permalink
fix: Don't generate hotrestart stubs when maui is present
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Jul 27, 2023
1 parent 4cad602 commit 1f2daad
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ public void Run()
}

var mauiAppDelegate = _context.Compilation.GetTypeByMetadataName("Microsoft.Maui.MauiUIApplicationDelegate");
var shouldDefineAppDelegate = (mauiAppDelegate is null).ToString().ToLowerInvariant();

if (mauiAppDelegate is not null)
{
// Support for hot restart is disabled, since the app cannot be started from
// the MauiUIApplicationDelegate as the CreateMaui override cannot be implemented
// in an Uno context.
return;
}

var appType = GetApplicationDefinitionType();

Expand All @@ -63,15 +70,13 @@ public void Run()
// *************************************************************
// </auto-generated>

#if {{shouldDefineAppDelegate}}
namespace Microsoft.Maui
{
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal class MauiUIApplicationDelegate : global::UIKit.UIApplicationDelegate
{
}
}
#endif

[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal class __UnoHotRestartDelegate : global::Microsoft.Maui.MauiUIApplicationDelegate
Expand Down

0 comments on commit 1f2daad

Please sign in to comment.