Skip to content

Commit

Permalink
fix(hr): Prevent double reload on skia/wasm supporting targets
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Oct 30, 2023
1 parent 5304e0e commit b88feeb
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,18 @@ private bool BuildMetadataUpdatesEnabled()
{
var unoRuntimeIdentifier = GetMSBuildProperty("UnoRuntimeIdentifier");
//var targetFramework = GetMSBuildProperty("TargetFramework");
//var buildingInsideVisualStudio = GetMSBuildProperty("BuildingInsideVisualStudio");
var buildingInsideVisualStudio = GetMSBuildProperty("BuildingInsideVisualStudio").Equals("true", StringComparison.OrdinalIgnoreCase);

var enabled = (_forcedHotReloadMode is HotReloadMode.MetadataUpdates or HotReloadMode.Partial)

// CoreCLR Debugger under VS Win already handles metadata updates
// Debugger under VS Code prevents metadata based hot reload
|| (!Debugger.IsAttached && !buildingInsideVisualStudio && unoRuntimeIdentifier.Equals("skia", StringComparison.OrdinalIgnoreCase))

// Mono Debugger under VS Win already handles metadata updates
// Mono Debugger under VS Code prevents metadata based hot reload
|| (!Debugger.IsAttached && !buildingInsideVisualStudio && unoRuntimeIdentifier.Equals("webassembly", StringComparison.OrdinalIgnoreCase))

return (_forcedHotReloadMode is HotReloadMode.MetadataUpdates or HotReloadMode.Partial)
|| unoRuntimeIdentifier.Equals("skia", StringComparison.OrdinalIgnoreCase)
// Disabled until https://github.com/dotnet/runtime/issues/93860 is fixed
//
//||
Expand All @@ -82,6 +90,13 @@ private bool BuildMetadataUpdatesEnabled()
// (!Debugger.IsAttached
// && (targetFramework.Contains("-android") || targetFramework.Contains("-ios")))))
;

if (this.Log().IsEnabled(LogLevel.Trace))
{
this.Log().Trace($"MetadataUpdates Enabled:{enabled} DebuggerAttached:{Debugger.IsAttached} BuildingInsideVS: {buildingInsideVisualStudio} unorid: {unoRuntimeIdentifier}");
}

return enabled;
}

private string[] GetMetadataUpdateCapabilities()
Expand Down

0 comments on commit b88feeb

Please sign in to comment.