@@ -23,7 +23,8 @@ namespace Uno.UI.RemoteControl.Host.HotReload
23
23
{
24
24
partial class ServerHotReloadProcessor : IServerProcessor , IDisposable
25
25
{
26
- private static readonly StringComparer _pathsComparer = RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ? StringComparer . OrdinalIgnoreCase : StringComparer . Ordinal ;
26
+ private static readonly StringComparer _pathsComparer = OperatingSystem . IsWindows ( ) ? StringComparer . OrdinalIgnoreCase : StringComparer . Ordinal ;
27
+ private static readonly StringComparison _pathsComparison = OperatingSystem . IsWindows ( ) ? StringComparison . OrdinalIgnoreCase : StringComparison . Ordinal ;
27
28
28
29
private FileSystemWatcher [ ] ? _solutionWatchers ;
29
30
private IDisposable ? _solutionWatcherEventsDisposable ;
@@ -96,6 +97,7 @@ private void InitializeInner(ConfigureServer configureServer)
96
97
&& bool . TryParse ( appendStr , out var append )
97
98
&& append ;
98
99
var hasOutputPath = properties . Remove ( "OutputPath" , out var outputPath ) ;
100
+ properties . Remove ( "IntermediateOutputPath" , out var intermediateOutputPath ) ;
99
101
100
102
if ( properties . Remove ( "RuntimeIdentifier" , out var runtimeIdentifier ) )
101
103
{
@@ -116,7 +118,7 @@ private void InitializeInner(ConfigureServer configureServer)
116
118
properties ,
117
119
CancellationToken . None ) ;
118
120
119
- ObserveSolutionPaths ( result . Item1 ) ;
121
+ ObserveSolutionPaths ( result . Item1 , intermediateOutputPath , outputPath ) ;
120
122
121
123
await _remoteControlServer . SendFrame ( new HotReloadWorkspaceLoadResult { WorkspaceInitialized = true } ) ;
122
124
await Notify ( HotReloadEvent . Ready ) ;
@@ -136,16 +138,26 @@ private void InitializeInner(ConfigureServer configureServer)
136
138
CancellationToken . None ) ;
137
139
}
138
140
139
- private void ObserveSolutionPaths ( Solution solution )
141
+ private void ObserveSolutionPaths ( Solution solution , params string ? [ ] excludedDir )
140
142
{
141
143
var observedPaths =
142
144
solution . Projects
143
- . SelectMany ( p => p
144
- . Documents
145
- . Select ( d => d . FilePath )
146
- . Concat ( p . AdditionalDocuments
147
- . Select ( d => d . FilePath ) ) )
148
- . Select ( Path . GetDirectoryName )
145
+ . SelectMany ( project =>
146
+ {
147
+ var projectDir = Path . GetDirectoryName ( project . FilePath ) ;
148
+ ImmutableArray < string > excludedProjectDir = [ .. from dir in excludedDir where dir is not null select Path . Combine ( projectDir ! , dir ) . TrimEnd ( Path . DirectorySeparatorChar , Path . AltDirectorySeparatorChar ) ] ;
149
+
150
+ var paths = project
151
+ . Documents
152
+ . Select ( d => d . FilePath )
153
+ . Concat ( project . AdditionalDocuments . Select ( d => d . FilePath ) )
154
+ . Select ( Path . GetDirectoryName )
155
+ . Where ( path => path is not null && ! excludedProjectDir . Any ( dir => path . StartsWith ( dir , _pathsComparison ) ) )
156
+ . Distinct ( )
157
+ . ToArray ( ) ;
158
+
159
+ return paths ;
160
+ } )
149
161
. Distinct ( )
150
162
. ToArray ( ) ;
151
163
0 commit comments