@@ -23,7 +23,8 @@ public sealed class DependencyManager : IDisposable
23
23
private readonly IDictionary < string , string > unresolvedReferences = new ConcurrentDictionary < string , string > ( ) ;
24
24
private int failedProjects ;
25
25
private int succeededProjects ;
26
- private readonly List < string > allSources ;
26
+ private readonly List < string > nonGeneratedSources ;
27
+ private readonly List < string > generatedSources ;
27
28
private int conflictedReferences = 0 ;
28
29
private readonly IDependencyOptions options ;
29
30
private readonly DirectoryInfo sourceDir ;
@@ -65,7 +66,8 @@ public DependencyManager(string srcDir, IDependencyOptions options, ILogger logg
65
66
var allNonBinaryFiles = allFiles . Where ( f => ! binaryFileExtensions . Contains ( f . Extension . ToLowerInvariant ( ) ) ) . ToList ( ) ;
66
67
var smallNonBinaryFiles = allNonBinaryFiles . SelectSmallFiles ( progressMonitor ) . SelectFileNames ( ) ;
67
68
this . fileContent = new FileContent ( progressMonitor , smallNonBinaryFiles ) ;
68
- this . allSources = allNonBinaryFiles . SelectFileNamesByExtension ( ".cs" ) . ToList ( ) ;
69
+ this . nonGeneratedSources = allNonBinaryFiles . SelectFileNamesByExtension ( ".cs" ) . ToList ( ) ;
70
+ this . generatedSources = new ( ) ;
69
71
var allProjects = allNonBinaryFiles . SelectFileNamesByExtension ( ".csproj" ) ;
70
72
var solutions = options . SolutionFile is not null
71
73
? new [ ] { options . SolutionFile }
@@ -214,7 +216,7 @@ private void GenerateSourceFileFromImplicitUsings()
214
216
}
215
217
}
216
218
217
- this . allSources . Add ( path ) ;
219
+ this . generatedSources . Add ( path ) ;
218
220
}
219
221
}
220
222
@@ -236,7 +238,7 @@ private void GenerateSourceFilesFromWebViews(List<FileInfo> allFiles)
236
238
var razor = new Razor ( sdk , dotnet , progressMonitor ) ;
237
239
var targetDir = GetTemporaryWorkingDirectory ( "razor" ) ;
238
240
var generatedFiles = razor . GenerateFiles ( views , usedReferences . Keys , targetDir ) ;
239
- this . allSources . AddRange ( generatedFiles ) ;
241
+ this . generatedSources . AddRange ( generatedFiles ) ;
240
242
}
241
243
catch ( Exception ex )
242
244
{
@@ -379,10 +381,15 @@ private void ResolveConflicts()
379
381
/// </summary>
380
382
public IEnumerable < string > ProjectSourceFiles => sources . Where ( s => s . Value ) . Select ( s => s . Key ) ;
381
383
384
+ /// <summary>
385
+ /// All of the generated source files in the source directory.
386
+ /// </summary>
387
+ public IEnumerable < string > GeneratedSourceFiles => generatedSources ;
388
+
382
389
/// <summary>
383
390
/// All of the source files in the source directory.
384
391
/// </summary>
385
- public IEnumerable < string > AllSourceFiles => allSources ;
392
+ public IEnumerable < string > AllSourceFiles => generatedSources . Concat ( nonGeneratedSources ) ;
386
393
387
394
/// <summary>
388
395
/// List of assembly IDs which couldn't be resolved.
0 commit comments